Add "Force Tablet Mode"

This commit is contained in:
Ivan K
2022-03-15 17:12:32 +03:00
parent 8449c87506
commit 25e0ea54cd
4 changed files with 15 additions and 0 deletions

View File

@@ -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

View File

@@ -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
}
}
}
}
}

View File

@@ -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);
}

View File

@@ -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>