Fix crashing for theme switcher

Very hacky but it's better than it crashing for non-english locales

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/230/head
androidacy-user 2 years ago
parent f07627da59
commit dfe53576bd

@ -233,18 +233,9 @@ public class MainApplication extends FoxApplication implements androidx.work.Con
themeResId = monet ? R.style.Theme_MagiskModuleManager_Monet_Light : R.style.Theme_MagiskModuleManager_Light;
break;
}
// Handle force black theme
if (theme.equals("dark") && isForceBlackThemeEnabled()) {
// just black background
themeResId = monet ? R.style.Theme_MagiskModuleManager_Monet_Black : R.style.Theme_MagiskModuleManager_Black;
}
this.setManagerThemeResId(themeResId);
}
private boolean isForceBlackThemeEnabled() {
return getSharedPreferences().getBoolean("pref_force_black_theme", false);
}
@StyleRes
public int getManagerThemeResId() {
return managerThemeResId;

@ -153,6 +153,16 @@ public class Http {
builder.enableBrotli(true);
builder.enableHttp2(true);
builder.enableQuic(true);
// Cache size is 10MB
// Make the directory if it does not exist
File cacheDir = new File(mainApplication.getCacheDir(), "cronet");
if (!cacheDir.exists()) {
if (!cacheDir.mkdirs()) {
throw new IOException("Failed to create cronet cache directory");
}
}
builder.setStoragePath(mainApplication.getCacheDir().getAbsolutePath() + "/cronet");
builder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_DISK_NO_HTTP, 10 * 1024 * 1024);
CronetEngine engine =
builder.build();
httpclientBuilder.addInterceptor(CronetInterceptor.newBuilder(engine).build());

@ -1,14 +1,8 @@
<resources>
<!-- If translating, please remove "theme_values"
<string-array name="theme_values" translatable="false">
<item>system</item>
<item>dark</item>
<item>light</item>
</string-array>-->
<string-array name="theme_values_names">
<item>Dle systému</item>
<item>Tmavá</item>
<item>AMOLED Black</item>
<item>Světlá</item>
</string-array>
</resources>

@ -3,6 +3,7 @@
<string-array name="theme_values_names">
<item>Systemvorgabe</item>
<item>Dunkel</item>
<item>AMOLED Black</item>
<item>Hell</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Προεπιλογή συστήματως</item>
<item>Σκωτεινό</item>
<item>AMOLED Black</item>
<item>Ανοιχτό</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Sistema</item>
<item>Oscuro</item>
<item>AMOLED Black</item>
<item>Claro</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Süsteem</item>
<item>Tume</item>
<item>AMOLED Black</item>
<item>Hele</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Système</item>
<item>Sombre</item>
<item>AMOLED Black</item>
<item>Clair</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Sistem</item>
<item>Gelap</item>
<item>AMOLED Black</item>
<item>Terang</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Sistema</item>
<item>Scuro</item>
<item>AMOLED Black</item>
<item>Chiaro</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>システムの設定を使用</item>
<item>ダーク</item>
<item>AMOLED Black</item>
<item>ライト</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item comment="theme_values_names">Zgodny z systemem</item>
<item comment="theme_values_names">Ciemny</item>
<item>AMOLED Black</item>
<item comment="theme_values_names">Jasny</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Sistema</item>
<item>Escuro</item>
<item>AMOLED Black</item>
<item>Claro</item>
</string-array>
</resources>

@ -4,6 +4,7 @@
<string-array name="theme_values_names">
<item>Sistem</item>
<item>Întunecată</item>
<item>AMOLED Black</item>
<item>Luminoasă</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Как в системе</item>
<item>Тёмная</item>
<item>AMOLED Black</item>
<item>Светлая</item>
</string-array>
</resources>

@ -1,14 +1,8 @@
<resources>
<!-- If translating, please remove "theme_values"
<string-array name="theme_values" translatable="false">
<item>system</item>
<item>dark</item>
<item>light</item>
</string-array>-->
<string-array name="theme_values_names">
<item>Podľa systému</item>
<item>Tmavá</item>
<item>AMOLED Black</item>
<item>Svetlá</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>Sistem</item>
<item>Koyu</item>
<item>AMOLED Black</item>
<item>ık</item>
</string-array>
</resources>

@ -3,6 +3,7 @@
<string-array name="theme_values_names">
<item>Hệ thống</item>
<item>Tối</item>
<item>AMOLED Black</item>
<item>Sáng</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>跟随系统</item>
<item>深色模式</item>
<item>AMOLED Black</item>
<item>明亮模式</item>
</string-array>
</resources>

@ -2,6 +2,7 @@
<string-array name="theme_values_names">
<item>跟隨系統</item>
<item>深色主題</item>
<item>AMOLED Black</item>
<item>淺色主題</item>
</string-array>
</resources>
Loading…
Cancel
Save