mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 02:53:05 +00:00
Set small icon by default on phones
This commit is contained in:
parent
336f85a31c
commit
d3052cd97d
@ -64,7 +64,7 @@ public class PreferenceConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean getDefaultSmallMode(Context context) {
|
||||
public static boolean getDefaultSmallMode(Context context) {
|
||||
// Use small mode on anything smaller than a 7" tablet
|
||||
return context.getResources().getConfiguration().smallestScreenWidthDp < 600;
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.limelight.preferences;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
public class SmallIconCheckboxPreference extends CheckBoxPreference {
|
||||
public SmallIconCheckboxPreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public SmallIconCheckboxPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object onGetDefaultValue(TypedArray a, int index) {
|
||||
return PreferenceConfiguration.getDefaultSmallMode(getContext());
|
||||
}
|
||||
}
|
@ -54,11 +54,10 @@
|
||||
android:entryValues="@array/language_values"
|
||||
android:summary="@string/summary_language_list"
|
||||
android:defaultValue="default" />
|
||||
<CheckBoxPreference
|
||||
<com.limelight.preferences.SmallIconCheckboxPreference
|
||||
android:key="checkbox_small_icon_mode"
|
||||
android:title="@string/title_checkbox_small_icon_mode"
|
||||
android:summary="@string/summary_checkbox_small_icon_mode"
|
||||
android:defaultValue="false" />
|
||||
android:summary="@string/summary_checkbox_small_icon_mode" />
|
||||
<CheckBoxPreference
|
||||
android:key="checkbox_list_mode"
|
||||
android:title="@string/title_checkbox_list_mode"
|
||||
|
Loading…
x
Reference in New Issue
Block a user