Fix theme and icon color on startup

This commit is contained in:
CappielloAntonio 2021-04-12 17:56:09 +02:00
parent ecc941dc11
commit b3ae8b1fff
7 changed files with 20 additions and 4 deletions

View file

@ -2,6 +2,9 @@ package com.cappielloantonio.play;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.preference.PreferenceManager;
import com.cappielloantonio.play.helper.ThemeHelper;
import com.cappielloantonio.play.util.PreferenceUtil;
@ -24,7 +27,9 @@ public class App extends Application {
public void onCreate() {
super.onCreate();
ThemeHelper.applyTheme(PreferenceUtil.getInstance(getApplicationContext()).getTheme());
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
String themePref = sharedPreferences.getString("themePref", ThemeHelper.DEFAULT_MODE);
ThemeHelper.applyTheme(themePref);
}
public static App getInstance() {