[Android] Remove useless settings in the browser's overflow

Nicolas Pomepuy git at videolan.org
Wed Apr 10 16:13:11 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Mar 25 15:15:02 2024 +0100| [c6d6f19b89f2e544b31dbb85be7cbb062dd416df] | committer: Duncan McNamara

Remove useless settings in the browser's overflow

> https://code.videolan.org/videolan/vlc-android/commit/c6d6f19b89f2e544b31dbb85be7cbb062dd416df
---

 application/vlc-android/res/menu/activity_option.xml        |  7 -------
 .../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt | 13 +------------
 .../videolan/vlc/gui/browser/MLStorageBrowserFragment.kt    |  1 -
 .../org/videolan/vlc/gui/browser/StorageBrowserFragment.kt  |  1 -
 4 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/application/vlc-android/res/menu/activity_option.xml b/application/vlc-android/res/menu/activity_option.xml
index 8dcb31cb64..31d61654b2 100644
--- a/application/vlc-android/res/menu/activity_option.xml
+++ b/application/vlc-android/res/menu/activity_option.xml
@@ -174,13 +174,6 @@
             android:contentDescription="@string/add_custom_path_description"
             android:visible="false"/>
 
-    <item
-            android:orderInCategory="3"
-            android:title="@string/browser_show_hidden_files_title"
-            android:visible="false"
-            android:checkable="true"
-            vlc:showAsAction="never"
-            android:id="@+id/browser_show_hidden_files" />
     <item
             android:orderInCategory="5"
             android:title="@string/rename_group"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index 354933a8a1..d329e2e0d2 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -244,15 +244,12 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
         super.onPrepareOptionsMenu(menu)
         menu.findItem(R.id.ml_menu_display_options)?.isVisible = true
         menu.findItem(R.id.ml_menu_filter)?.isVisible = enableSearchOption()
-        menu.findItem(R.id.ml_menu_sortby)?.isVisible = !isRootDirectory
+        menu.findItem(R.id.ml_menu_sortby)?.isVisible = false
         menu.findItem(R.id.ml_menu_sortby_media_number)?.isVisible = false
         menu.findItem(R.id.ml_menu_add_playlist)?.isVisible = !isRootDirectory
         addPlaylistFolderOnly = menu.findItem(R.id.folder_add_playlist)
         addPlaylistFolderOnly.isVisible = adapter.mediaCount > 0
 
-        val browserShowHiddenFiles = menu.findItem(R.id.browser_show_hidden_files)
-        browserShowHiddenFiles.isVisible = true
-        browserShowHiddenFiles.isChecked = Settings.showHiddenFiles
         if (requireActivity().isTalkbackIsEnabled()) menu.findItem(R.id.play_all).isVisible = true
         UiTools.updateSortTitles(this)
     }
@@ -648,14 +645,6 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
                 true
             }
 
-            R.id.browser_show_hidden_files -> {
-                item.isChecked = !Settings.getInstance(requireActivity()).getBoolean(BROWSER_SHOW_HIDDEN_FILES, true)
-                Settings.getInstance(requireActivity()).putSingle(BROWSER_SHOW_HIDDEN_FILES, item.isChecked)
-                Settings.showHiddenFiles = item.isChecked
-                viewModel.refresh()
-                true
-            }
-
             R.id.ml_menu_scan -> {
                 currentMedia?.let { media ->
                     addToScannedFolders(media)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/MLStorageBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/MLStorageBrowserFragment.kt
index ed46d862fa..57554bca24 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/MLStorageBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/MLStorageBrowserFragment.kt
@@ -191,7 +191,6 @@ class MLStorageBrowserFragment : BaseFragment(), IStorageFragmentDelegate by Sto
         val onboarding = arguments?.getBoolean(FROM_ONBOARDING, false) == true
         menu.findItem(R.id.ml_menu_custom_dir)?.isVisible = !onboarding
         menu.findItem(R.id.ml_menu_refresh)?.isVisible = false
-        menu.findItem(R.id.browser_show_hidden_files)?.isVisible = false
         menu.findItem(R.id.ml_menu_add_playlist)?.isVisible = false
     }
 
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt
index 4e7f3b4d3b..2e03934d75 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/StorageBrowserFragment.kt
@@ -129,7 +129,6 @@ class StorageBrowserFragment : FileBrowserFragment(), BrowserContainer<MediaLibr
         super.onPrepareOptionsMenu(menu)
         menu.findItem(R.id.ml_menu_custom_dir)?.isVisible = true
         menu.findItem(R.id.ml_menu_refresh)?.isVisible = false
-        menu.findItem(R.id.browser_show_hidden_files)?.isVisible = false
         menu.findItem(R.id.ml_menu_add_playlist)?.isVisible = false
     }
 



More information about the Android mailing list