[Android] Hide phone preference when relevant

Geoffrey Métais git at videolan.org
Thu Feb 7 15:26:14 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb  7 14:27:42 2019 +0100| [454140fd753da3e13f5343575893aea98302f010] | committer: Geoffrey Métais

Hide phone preference when relevant

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

 .../src/org/videolan/vlc/gui/preferences/PreferencesUi.java   | 11 +++++++----
 .../org/videolan/vlc/gui/tv/preferences/PreferencesUi.java    |  4 +++-
 2 files changed, 10 insertions(+), 5 deletions(-)

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 58802c91d..5fd4d1c50 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesUi.java
@@ -25,15 +25,17 @@ package org.videolan.vlc.gui.preferences;
 
 import android.content.SharedPreferences;
 import android.os.Bundle;
-import androidx.appcompat.app.AppCompatDelegate;
-import androidx.preference.ListPreference;
-import androidx.preference.Preference;
-import androidx.preference.SwitchPreferenceCompat;
 
 import org.videolan.vlc.R;
 import org.videolan.vlc.gui.helpers.UiTools;
+import org.videolan.vlc.util.AndroidDevices;
 import org.videolan.vlc.util.LocalePair;
 
+import androidx.appcompat.app.AppCompatDelegate;
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+import androidx.preference.SwitchPreferenceCompat;
+
 
 
 public class PreferencesUi extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@@ -64,6 +66,7 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        findPreference("resume_playback").setVisible(AndroidDevices.isPhone);
         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 0b84c195f..1b89bf0b7 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
@@ -27,13 +27,14 @@ import android.annotation.TargetApi;
 import android.content.SharedPreferences;
 import android.os.Build;
 import android.os.Bundle;
-import androidx.preference.ListPreference;
 
 import org.videolan.vlc.R;
 import org.videolan.vlc.gui.helpers.UiTools;
 import org.videolan.vlc.util.AndroidDevices;
 import org.videolan.vlc.util.LocalePair;
 
+import androidx.preference.ListPreference;
+
 
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
 public class PreferencesUi extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@@ -59,6 +60,7 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
         findPreference("secondary_display_category_summary").setVisible(false);
         findPreference("daynight").setVisible(false);
         findPreference("blurred_cover_background").setVisible(false);
+        findPreference("resume_playback").setVisible(false);
         prepareLocaleList();
     }
 



More information about the Android mailing list