Commit 454140fd authored by Geoffrey Métais's avatar Geoffrey Métais

Hide phone preference when relevant

parent 598301ea
...@@ -25,15 +25,17 @@ package org.videolan.vlc.gui.preferences; ...@@ -25,15 +25,17 @@ package org.videolan.vlc.gui.preferences;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; 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.R;
import org.videolan.vlc.gui.helpers.UiTools; import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.LocalePair; 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 { public class PreferencesUi extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
...@@ -64,6 +66,7 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe ...@@ -64,6 +66,7 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
findPreference("resume_playback").setVisible(AndroidDevices.isPhone);
prepareLocaleList(); prepareLocaleList();
} }
......
...@@ -27,13 +27,14 @@ import android.annotation.TargetApi; ...@@ -27,13 +27,14 @@ import android.annotation.TargetApi;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import androidx.preference.ListPreference;
import org.videolan.vlc.R; import org.videolan.vlc.R;
import org.videolan.vlc.gui.helpers.UiTools; import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.util.AndroidDevices; import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.LocalePair; import org.videolan.vlc.util.LocalePair;
import androidx.preference.ListPreference;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public class PreferencesUi extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener { public class PreferencesUi extends BasePreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
...@@ -59,6 +60,7 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe ...@@ -59,6 +60,7 @@ public class PreferencesUi extends BasePreferenceFragment implements SharedPrefe
findPreference("secondary_display_category_summary").setVisible(false); findPreference("secondary_display_category_summary").setVisible(false);
findPreference("daynight").setVisible(false); findPreference("daynight").setVisible(false);
findPreference("blurred_cover_background").setVisible(false); findPreference("blurred_cover_background").setVisible(false);
findPreference("resume_playback").setVisible(false);
prepareLocaleList(); prepareLocaleList();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment