mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-26 14:00:08 +00:00
Don't use small mode on TVs
This commit is contained in:
1 parent
7e1884acb5
commit
f0b22f9119
1 file changed
+7
@@ -2,6 +2,7 @@ package com.limelight.preferences;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
public class PreferenceConfiguration {
|
public class PreferenceConfiguration {
|
||||||
@@ -67,6 +68,12 @@ public class PreferenceConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getDefaultSmallMode(Context context) {
|
public static boolean getDefaultSmallMode(Context context) {
|
||||||
|
PackageManager manager = context.getPackageManager();
|
||||||
|
if (manager != null && manager.hasSystemFeature(PackageManager.FEATURE_TELEVISION)) {
|
||||||
|
// TVs shouldn't use small mode by default
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Use small mode on anything smaller than a 7" tablet
|
// Use small mode on anything smaller than a 7" tablet
|
||||||
return context.getResources().getConfiguration().smallestScreenWidthDp < 600;
|
return context.getResources().getConfiguration().smallestScreenWidthDp < 600;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user