[Android] TV: Hide preferences concerning touch devices

Geoffrey Métais git at videolan.org
Thu Nov 24 17:13:42 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Nov 24 17:13:04 2016 +0100| [69937c5ab60467931075484725b2d275ce432a46] | committer: Geoffrey Métais

TV: Hide preferences concerning touch devices

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

 .../vlc/gui/tv/preferences/PreferencesAudio.java   | 15 +++++++-------
 .../vlc/gui/tv/preferences/PreferencesUi.java      | 23 +++++++++++-----------
 .../vlc/gui/tv/preferences/PreferencesVideo.java   | 12 ++++++-----
 3 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java
index 50d8160..3271360 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.java
@@ -26,8 +26,6 @@ import android.content.SharedPreferences;
 import android.os.Build;
 import android.os.Bundle;
 
-import android.support.v7.preference.TwoStatePreference;
-
 import org.videolan.libvlc.util.HWDecoderUtil;
 import org.videolan.vlc.R;
 import org.videolan.vlc.util.VLCInstance;
@@ -46,12 +44,6 @@ public class PreferencesAudio extends BasePreferenceFragment implements SharedPr
     }
 
     @Override
-    public void onStart() {
-        super.onStart();
-        getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
-    }
-
-    @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
@@ -59,6 +51,7 @@ public class PreferencesAudio extends BasePreferenceFragment implements SharedPr
         findPreference("enable_play_on_headset_insertion").setVisible(false);
         findPreference("enable_steal_remote_control").setVisible(false);
         findPreference("headset_prefs_category").setVisible(false);
+        findPreference("lockscreen_cover").setVisible(false);
 
         final HWDecoderUtil.AudioOutput aout = HWDecoderUtil.getAudioOutputFromDevice();
         if (aout != HWDecoderUtil.AudioOutput.ALL) {
@@ -67,6 +60,12 @@ public class PreferencesAudio extends BasePreferenceFragment implements SharedPr
         }
     }
 
+    @Override
+    public void onStart() {
+        super.onStart();
+        getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
+    }
+
 
     @Override
     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
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 87779bc..c687bbe 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
@@ -46,6 +46,18 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
     }
 
     @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        findPreference("enable_clone_mode").setVisible(false);
+        findPreference("tv_ui").setVisible(AndroidDevices.hasTsp());
+        findPreference("enable_black_theme").setVisible(false);
+        findPreference("secondary_display_category").setVisible(false);
+        findPreference("secondary_display_category_summary").setVisible(false);
+        findPreference("daynight").setVisible(false);
+    }
+
+    @Override
     public void onStart() {
         super.onStart();
         getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
@@ -59,17 +71,6 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
     }
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        findPreference("enable_clone_mode").setVisible(false);
-        findPreference("tv_ui").setVisible(AndroidDevices.hasTsp());
-        findPreference("enable_black_theme").setVisible(false);
-        findPreference("secondary_display_category").setVisible(false);
-        findPreference("secondary_display_category_summary").setVisible(false);
-    }
-
-    @Override
     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
         if (key.equals("set_locale"))
             UiTools.snacker(getView(), R.string.set_locale_popup);
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesVideo.java b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesVideo.java
index fff1066..4a2e0cb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesVideo.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesVideo.java
@@ -44,20 +44,22 @@ public class PreferencesVideo extends BasePreferenceFragment {
     }
 
     @Override
-    public void onStart() {
-        super.onStart();
-    }
-
-    @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
         findPreference("force_list_portrait").setVisible(false);
+        findPreference("save_brightness").setVisible(false);
+        findPreference("video_min_group_length").setVisible(false);
         findPreference("enable_volume_gesture").setVisible(AndroidDevices.hasTsp());
         findPreference("enable_brightness_gesture").setVisible(AndroidDevices.hasTsp());
     }
 
     @Override
+    public void onStart() {
+        super.onStart();
+    }
+
+    @Override
     public boolean onPreferenceTreeClick(Preference preference) {
         if (preference.getKey() == null)
             return false;



More information about the Android mailing list