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 {
implementation 'com.simplemobiletools:commons:5.33.9'
implementation 'com.simplemobiletools:commons:5.33.10'
implementation 'com.github.Stericson:RootTools:df729dcb13'
implementation 'com.github.Stericson:RootShell:1.6'
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.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.set_as_home).isVisible = fragment.currentPath != config.homeFolder
@ -111,6 +112,7 @@ class MainActivity : SimpleActivity() {
R.id.sort -> showSortingDialog()
R.id.add_favorite -> addFavorite()
R.id.remove_favorite -> removeFavorite()
R.id.toggle_filename -> toggleFilenameVisibility()
R.id.set_as_home -> setAsHome()
R.id.change_view_type -> changeViewType()
R.id.temporarily_show_hidden -> tryToggleTemporarilyShowHidden()
@ -267,6 +269,10 @@ class MainActivity : SimpleActivity() {
config.removeFavorite(fragment.currentPath)
}
private fun toggleFilenameVisibility() {
}
private fun goToFavorite() {
val favorites = config.favorites
val items = ArrayList<RadioItem>(favorites.size)

View File

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