From 7c1eb80d62b81a17fc9190082e78588a74ef39e2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 19 Apr 2016 20:36:04 -0400 Subject: [PATCH] Prevent the small-mode default from changing between portrait and landscape orientations --- .../com/limelight/preferences/PreferenceConfiguration.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java b/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java index c7757573..fe11ef01 100644 --- a/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java +++ b/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java @@ -3,6 +3,7 @@ package com.limelight.preferences; import android.content.Context; import android.content.SharedPreferences; import android.content.pm.PackageManager; +import android.content.res.Configuration; import android.os.Build; import android.preference.PreferenceManager; @@ -100,7 +101,10 @@ public class PreferenceConfiguration { } // 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) {