Prevent the small-mode default from changing between portrait and landscape orientations

This commit is contained in:
Cameron Gutman 2016-04-19 20:36:04 -04:00
parent f2bf093691
commit 7c1eb80d62

View File

@ -3,6 +3,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.content.pm.PackageManager;
import android.content.res.Configuration;
import android.os.Build; import android.os.Build;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@ -100,7 +101,10 @@ public class PreferenceConfiguration {
} }
// Use small mode on anything smaller than a 7" tablet // Use small mode on anything smaller than a 7" tablet
return context.getResources().getConfiguration().screenWidthDp < 600; // We check both width and height because these will change when the
// screen is rotated and we don't want this to change the small-mode setting.
Configuration config = context.getResources().getConfiguration();
return config.screenWidthDp < 600 || config.screenHeightDp < 600;
} }
public static int getDefaultBitrate(Context context) { public static int getDefaultBitrate(Context context) {