Fix a theme issue when starting the app the first time

This commit is contained in:
Thomas 2022-05-16 18:46:39 +02:00
parent 0c8f2a4a03
commit 071bf82bc7
1 changed files with 7 additions and 4 deletions

View File

@ -59,11 +59,14 @@ public class MainApplication extends MultiDexApplication {
Cyanea.init(this, super.getResources());
List<CyaneaTheme> list = CyaneaTheme.Companion.from(getAssets(), "themes/cyanea_themes.json");
int theme = sharedpreferences.getInt(getString(R.string.SET_THEME), 0);
boolean custom_theme = sharedpreferences.getBoolean("use_custom_theme", false);
/*if (!custom_theme) {
list.get(theme).apply(Cyanea.getInstance());
}*/
boolean no_theme_set = sharedpreferences.getBoolean("no_theme_set", true);
if (no_theme_set && !custom_theme) {
list.get(0).apply(Cyanea.getInstance());
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean("no_theme_set", false);
editor.apply();
}
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());