[Android] Fix resume asking option not available on TV

Geoffrey Métais git at videolan.org
Tue Oct 20 15:03:38 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Oct 20 15:02:18 2015 +0200| [924341d9080dafc1cb8eb97b2d2b3eed5e675d52] | committer: Geoffrey Métais

Fix resume asking option not available on TV

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=924341d9080dafc1cb8eb97b2d2b3eed5e675d52
---

 .../vlc/gui/preferences/PreferencesFragment.java        |    2 --
 .../org/videolan/vlc/gui/preferences/PreferencesUi.java |   15 +++++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesFragment.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesFragment.java
index bb224e9..c559da8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesFragment.java
@@ -56,12 +56,10 @@ public class PreferencesFragment extends BasePreferenceFragment implements Share
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        Log.d(TAG, "on create");
 
         if (!AndroidDevices.hasTsp()){
             findPreference("screen_orientation").setEnabled(false);
             findPreference("enable_black_theme").setEnabled(false);
-            findPreference("ui_category").setEnabled(false);
         }
 
         // Screen orientation
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 7643c07..5f042ca 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
@@ -23,11 +23,13 @@
 
 package org.videolan.vlc.gui.preferences;
 
+import android.os.Bundle;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.TwoStatePreference;
 
 import org.videolan.vlc.PlaybackService;
 import org.videolan.vlc.R;
+import org.videolan.vlc.util.AndroidDevices;
 
 public class PreferencesUi extends BasePreferenceFragment {
     @Override
@@ -41,6 +43,19 @@ public class PreferencesUi extends BasePreferenceFragment {
     }
 
     @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        if (!AndroidDevices.hasTsp()){
+            findPreference("enable_clone_mode").setEnabled(false);
+            findPreference("force_list_portrait").setEnabled(false);
+            findPreference("enable_brightness_gesture").setEnabled(false);
+            findPreference("enable_headset_detection").setEnabled(false);
+            findPreference("enable_steal_remote_control").setEnabled(false);
+        }
+    }
+
+    @Override
     public boolean onPreferenceTreeClick(Preference preference) {
         if (preference.getKey() == null)
             return false;



More information about the Android mailing list