[Android] add TV setting to toggle hidden files in file browser
Andres Bott
git at videolan.org
Wed May 3 12:54:56 UTC 2023
vlc-android | branch: master | Andres Bott <contact at andresbott.com> | Mon May 1 15:53:14 2023 +0200| [ba51e4ef71219aa34fcdc0dde898a12bf345fbce] | committer: Duncan McNamara
add TV setting to toggle hidden files in file browser
> https://code.videolan.org/videolan/vlc-android/commit/ba51e4ef71219aa34fcdc0dde898a12bf345fbce
---
application/resources/src/main/res/values/strings.xml | 2 ++
.../java/org/videolan/television/ui/preferences/PreferencesUi.kt | 2 ++
application/vlc-android/res/xml/preferences_ui.xml | 8 ++++++++
3 files changed, 12 insertions(+)
diff --git a/application/resources/src/main/res/values/strings.xml b/application/resources/src/main/res/values/strings.xml
index 9bf5416e2c..ab12f1c303 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -468,6 +468,8 @@
<string name="show_headers_summary">Split lists by headers depending on the sort type</string>
<string name="tv_folders_first">Show folders first</string>
<string name="tv_folders_first_summary">Show folders and then files in the file browser</string>
+ <string name="tv_show_hidden_files">Show hidden files</string>
+ <string name="tv_show_hidden_files_summary">Show hidden files in the file browser</string>
<string name="extensions_prefs_category">Extensions</string>
<string name="extensions_empty">No extension detected</string>
diff --git a/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesUi.kt b/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesUi.kt
index 2d4509aef1..6ecef98fdc 100644
--- a/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesUi.kt
+++ b/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesUi.kt
@@ -61,6 +61,7 @@ class PreferencesUi : BasePreferenceFragment(), SharedPreferences.OnSharedPrefer
findPreference<Preference>(KEY_APP_THEME)?.isVisible = false
findPreference<Preference>(LIST_TITLE_ELLIPSIZE)?.isVisible = false
findPreference<Preference>(TV_FOLDERS_FIRST)?.isVisible = true
+ findPreference<Preference>(BROWSER_SHOW_HIDDEN_FILES)?.isVisible = true
prepareLocaleList()
currentLocale = AppContextProvider.locale
}
@@ -96,6 +97,7 @@ class PreferencesUi : BasePreferenceFragment(), SharedPreferences.OnSharedPrefer
}
"browser_show_all_files" -> (activity as PreferencesActivity).setRestart()
TV_FOLDERS_FIRST -> Settings.tvFoldersFirst = sharedPreferences.getBoolean(TV_FOLDERS_FIRST, true)
+ BROWSER_SHOW_HIDDEN_FILES-> Settings.showHiddenFiles = sharedPreferences.getBoolean(BROWSER_SHOW_HIDDEN_FILES, false)
}
}
diff --git a/application/vlc-android/res/xml/preferences_ui.xml b/application/vlc-android/res/xml/preferences_ui.xml
index f5e3eb5405..611abbd8c2 100644
--- a/application/vlc-android/res/xml/preferences_ui.xml
+++ b/application/vlc-android/res/xml/preferences_ui.xml
@@ -49,6 +49,14 @@
android:summary="@string/tv_folders_first_summary"
android:title="@string/tv_folders_first"/>
+ <CheckBoxPreference
+ app:singleLineTitle="false"
+ android:key="browser_show_hidden_files"
+ android:defaultValue="false"
+ app:isPreferenceVisible="false"
+ android:summary="@string/tv_show_hidden_files_summary"
+ android:title="@string/tv_show_hidden_files"/>
+
<CheckBoxPreference
app:singleLineTitle="false"
android:key="include_missing"
More information about the Android
mailing list