[Android] Option to filter non media files from browsers

Geoffrey Métais git at videolan.org
Tue Oct 16 10:53:39 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Oct 16 10:51:53 2018 +0200| [6d6cb24e1900b480f92a33d38ff05a2f3bd6c2ce] | committer: Geoffrey Métais

Option to filter non media files from browsers

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

 vlc-android/res/values/strings.xml                                  | 2 ++
 vlc-android/res/xml/preferences_ui.xml                              | 6 ++++++
 vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java | 4 ++--
 .../src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java      | 3 +++
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 47fa0290d..258f24d2f 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -443,6 +443,8 @@
     <string name="restart_message">Changes will take effect once application has restarted.\n\nRestart now?</string>
     <string name="restart_message_OK">OK</string>
     <string name="restart_message_Later">Later</string>
+    <string name="browser_show_all_title">Show all files in browser</string>
+    <string name="browser_show_all_summary">Display files that are not recognized as audio or video in browsers</string>
 
     <string name="developer_prefs_category">Developer</string>
     <string name="enable_verbose_mode">Verbose</string>
diff --git a/vlc-android/res/xml/preferences_ui.xml b/vlc-android/res/xml/preferences_ui.xml
index d4e034577..b8a2c9763 100644
--- a/vlc-android/res/xml/preferences_ui.xml
+++ b/vlc-android/res/xml/preferences_ui.xml
@@ -40,6 +40,12 @@
         android:summary="@string/resume_playback_summary"
         android:title="@string/resume_playback_title" />
 
+    <CheckBoxPreference
+        android:defaultValue="true"
+        android:key="browser_show_all_files"
+        android:summary="@string/browser_show_all_summary"
+        android:title="@string/browser_show_all_title" />
+
     <CheckBoxPreference
         android:defaultValue="true"
         android:key="blurred_cover_background"
diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
index de70b2248..8dfe8c0e6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
@@ -86,8 +86,8 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
     }
     @Override
     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
-        if (key.equals("set_locale"))
-            UiTools.restartDialog(getActivity());
+        if (key.equals("set_locale")) UiTools.restartDialog(getActivity());
+        else if (key.equals("browser_show_all_files")) ((PreferencesActivity) getActivity()).setRestart();
     }
 
     private void prepareLocaleList() {
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java
index 8aceeefdc..eb693e274 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesUi.java
@@ -84,6 +84,9 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
                 case "tv_ui":
                     ((PreferencesActivity) getActivity()).setRestartApp();
                     break;
+                case "browser_show_all_files":
+                    ((PreferencesActivity) getActivity()).setRestart();
+                    break;
             }
     }
 



More information about the Android mailing list