From 071bf82bc7494368808f622aeacfcb1612570cad Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 16 May 2022 18:46:39 +0200 Subject: [PATCH] Fix a theme issue when starting the app the first time --- .../java/app/fedilab/android/MainApplication.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/MainApplication.java b/app/src/main/java/app/fedilab/android/MainApplication.java index a54a1fc5..5fea3aaf 100644 --- a/app/src/main/java/app/fedilab/android/MainApplication.java +++ b/app/src/main/java/app/fedilab/android/MainApplication.java @@ -59,11 +59,14 @@ public class MainApplication extends MultiDexApplication { Cyanea.init(this, super.getResources()); List 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());