add Camera, Settings and About to ShowAll actionbar

This commit is contained in:
tibbi 2016-12-06 18:11:15 +01:00
parent 3e779c0a98
commit 4c0a0a43b8
4 changed files with 30 additions and 2 deletions

View file

@ -77,7 +77,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
showSortingDialog() showSortingDialog()
true true
} }
R.id.camera -> { R.id.open_camera -> {
launchCamera() launchCamera()
true true
} }

View file

@ -107,6 +107,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
menu.findItem(R.id.unhide_folder).isVisible = isFolderHidden && !mShowAll menu.findItem(R.id.unhide_folder).isVisible = isFolderHidden && !mShowAll
menu.findItem(R.id.folder_view).isVisible = mShowAll menu.findItem(R.id.folder_view).isVisible = mShowAll
menu.findItem(R.id.open_camera).isVisible = mShowAll
menu.findItem(R.id.settings).isVisible = mShowAll
menu.findItem(R.id.about).isVisible = mShowAll
return true return true
} }
@ -121,6 +124,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
toggleFilenameVisibility() toggleFilenameVisibility()
true true
} }
R.id.open_camera -> {
launchCamera()
true
}
R.id.folder_view -> { R.id.folder_view -> {
switchToFolderView() switchToFolderView()
true true
@ -133,6 +140,14 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
unhideFolder() unhideFolder()
true true
} }
R.id.settings -> {
launchSettings()
true
}
R.id.about -> {
launchAbout()
true
}
else -> super.onOptionsItemSelected(item) else -> super.onOptionsItemSelected(item)
} }
} }

View file

@ -7,7 +7,7 @@
android:title="@string/sort_by" android:title="@string/sort_by"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item <item
android:id="@+id/camera" android:id="@+id/open_camera"
android:icon="@mipmap/camera" android:icon="@mipmap/camera"
android:title="@string/open_camera" android:title="@string/open_camera"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>

View file

@ -11,6 +11,11 @@
android:icon="@mipmap/toggle_filename" android:icon="@mipmap/toggle_filename"
android:title="@string/toggle_filename" android:title="@string/toggle_filename"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item
android:id="@+id/open_camera"
android:icon="@mipmap/camera"
android:title="@string/open_camera"
app:showAsAction="ifRoom"/>
<item <item
android:id="@+id/folder_view" android:id="@+id/folder_view"
android:title="@string/folder_view" android:title="@string/folder_view"
@ -23,4 +28,12 @@
android:id="@+id/unhide_folder" android:id="@+id/unhide_folder"
android:title="@string/unhide_folder" android:title="@string/unhide_folder"
app:showAsAction="never"/> app:showAsAction="never"/>
<item
android:id="@+id/settings"
android:title="@string/settings"
app:showAsAction="never"/>
<item
android:id="@+id/about"
android:title="@string/about"
app:showAsAction="never"/>
</menu> </menu>