Add scan button to folder toolbar
This commit is contained in:
parent
95bde3dd94
commit
db42454261
4 changed files with 17 additions and 0 deletions
|
|
@ -265,6 +265,12 @@ public class FoldersFragment extends AbsMainActivityFragment implements MainActi
|
|||
case R.id.action_go_to_start_directory:
|
||||
setCrumb(new BreadCrumbLayout.Crumb(tryGetCanonicalFile(PreferenceUtil.getInstance(getActivity()).getStartDirectory())), true);
|
||||
return true;
|
||||
case R.id.action_scan:
|
||||
BreadCrumbLayout.Crumb crumb = getActiveCrumb();
|
||||
if (crumb != null) {
|
||||
new ListPathsAsyncTask(getActivity(), paths -> scanPaths(paths)).execute(new ListPathsAsyncTask.LoadingInfo(crumb.getFile(), getFileFilter()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
|
|
|||
4
app/src/main/res/drawable/ic_scanner_white_24dp.xml
Normal file
4
app/src/main/res/drawable/ic_scanner_white_24dp.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
|
||||
<path android:fillColor="#FFFFFF" android:pathData="M19.8,10.7L4.2,5l-0.7,1.9L17.6,12L5,12c-1.1,0 -2,0.9 -2,2v4c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2v-5.5c0,-0.8 -0.5,-1.6 -1.2,-1.8zM7,17L5,17v-2h2v2zM19,17L9,17v-2h10v2z"/>
|
||||
</vector>
|
||||
|
|
@ -2,6 +2,12 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_scan"
|
||||
android:icon="@drawable/ic_scanner_white_24dp"
|
||||
android:title="@string/action_scan_directory"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_go_to_start_directory"
|
||||
android:icon="@drawable/ic_bookmark_music_white_24dp"
|
||||
|
|
|
|||
|
|
@ -295,4 +295,5 @@
|
|||
<string name="library_categories">Library categories</string>
|
||||
<string name="pref_summary_library_categories">Configure visibility and order of library categories.</string>
|
||||
<string name="you_have_to_select_at_least_one_category">You have to select at least one category.</string>
|
||||
<string name="action_scan_directory">Scan directory</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue