Add "Force Tablet Mode"
This commit is contained in:
@@ -19,6 +19,7 @@ object ExteraConfig {
|
||||
var hidePhoneNumber by sharedPreferences.boolean("hidePhoneNumber", false)
|
||||
var showID by sharedPreferences.boolean("showID", false)
|
||||
var chatsOnTitle by sharedPreferences.boolean("chatsOnTitle", true)
|
||||
var forceTabletMode by sharedPreferences.boolean("ForceTabletMode", false)
|
||||
// Drawer
|
||||
|
||||
// Chats
|
||||
|
||||
@@ -83,6 +83,16 @@ class AppearancePreferencesEntry : BasePreferencesEntry {
|
||||
ExteraConfig.chatsOnTitle = it
|
||||
}
|
||||
}
|
||||
switch {
|
||||
title = LocaleController.getString("ForceTabletMode", R.string.ForceTabletMode)
|
||||
summary = LocaleController.getString("RestartRequired", R.string.RestartRequired)
|
||||
|
||||
contract({
|
||||
return@contract ExteraConfig.forceTabletMode
|
||||
}) {
|
||||
ExteraConfig.forceTabletMode = it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,6 +162,8 @@ import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.exteragram.messenger.ExteraConfig;
|
||||
|
||||
public class AndroidUtilities {
|
||||
public final static int LIGHT_STATUS_BAR_OVERLAY = 0x0f000000, DARK_STATUS_BAR_OVERLAY = 0x33000000;
|
||||
|
||||
@@ -1895,6 +1897,7 @@ public class AndroidUtilities {
|
||||
}
|
||||
|
||||
public static boolean isTablet() {
|
||||
if (ExteraConfig.INSTANCE.getForceTabletMode()) isTablet = true;
|
||||
if (isTablet == null) {
|
||||
isTablet = ApplicationLoader.applicationContext != null && ApplicationLoader.applicationContext.getResources().getBoolean(R.bool.isTablet);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
<string name="HidePhoneNumber">Hide Phone Number</string>
|
||||
<string name="ShowID">Show ID in Profile</string>
|
||||
<string name="ChatsOnTitle">\"Chats\" instead of \"exteraGram\"</string>
|
||||
<string name="ForceTabletMode">Force Tablet Mode</string>
|
||||
|
||||
<!-- Chats -->
|
||||
<string name="StickerSize">Stickers size</string>
|
||||
|
||||
Reference in New Issue
Block a user