adding a menu item for toggling filename visibility

This commit is contained in:
tibbi 2021-01-25 14:34:27 +01:00
parent 14bb9db182
commit 9d3b1796be
3 changed files with 12 additions and 1 deletions

View File

@ -58,7 +58,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.33.9' implementation 'com.simplemobiletools:commons:5.33.10'
implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootTools:df729dcb13'
implementation 'com.github.Stericson:RootShell:1.6' implementation 'com.github.Stericson:RootShell:1.6'
implementation 'com.alexvasilkov:gesture-views:2.5.2' implementation 'com.alexvasilkov:gesture-views:2.5.2'

View File

@ -91,6 +91,7 @@ class MainActivity : SimpleActivity() {
findItem(R.id.remove_favorite).isVisible = favorites.contains(fragment.currentPath) findItem(R.id.remove_favorite).isVisible = favorites.contains(fragment.currentPath)
findItem(R.id.go_to_favorite).isVisible = favorites.isNotEmpty() findItem(R.id.go_to_favorite).isVisible = favorites.isNotEmpty()
findItem(R.id.toggle_filename).isVisible = config.getFolderViewType(fragment.currentPath) == VIEW_TYPE_GRID
findItem(R.id.go_home).isVisible = fragment.currentPath != config.homeFolder findItem(R.id.go_home).isVisible = fragment.currentPath != config.homeFolder
findItem(R.id.set_as_home).isVisible = fragment.currentPath != config.homeFolder findItem(R.id.set_as_home).isVisible = fragment.currentPath != config.homeFolder
@ -111,6 +112,7 @@ class MainActivity : SimpleActivity() {
R.id.sort -> showSortingDialog() R.id.sort -> showSortingDialog()
R.id.add_favorite -> addFavorite() R.id.add_favorite -> addFavorite()
R.id.remove_favorite -> removeFavorite() R.id.remove_favorite -> removeFavorite()
R.id.toggle_filename -> toggleFilenameVisibility()
R.id.set_as_home -> setAsHome() R.id.set_as_home -> setAsHome()
R.id.change_view_type -> changeViewType() R.id.change_view_type -> changeViewType()
R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden() R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden()
@ -267,6 +269,10 @@ class MainActivity : SimpleActivity() {
config.removeFavorite(fragment.currentPath) config.removeFavorite(fragment.currentPath)
} }
private fun toggleFilenameVisibility() {
}
private fun goToFavorite() { private fun goToFavorite() {
val favorites = config.favorites val favorites = config.favorites
val items = ArrayList<RadioItem>(favorites.size) val items = ArrayList<RadioItem>(favorites.size)

View File

@ -32,6 +32,11 @@
android:icon="@drawable/ic_star_on_vector" android:icon="@drawable/ic_star_on_vector"
android:title="@string/remove_from_favorites" android:title="@string/remove_from_favorites"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item
android:id="@+id/toggle_filename"
android:icon="@drawable/ic_label_vector"
android:title="@string/toggle_filename"
app:showAsAction="ifRoom" />
<item <item
android:id="@+id/set_as_home" android:id="@+id/set_as_home"
android:title="@string/set_as_home_folder" android:title="@string/set_as_home_folder"