summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/cyngn/theme/perapptheming/PerAppThemingWindow.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/cyngn/theme/perapptheming/PerAppThemingWindow.java b/src/com/cyngn/theme/perapptheming/PerAppThemingWindow.java
index c4c0c12..a23f714 100644
--- a/src/com/cyngn/theme/perapptheming/PerAppThemingWindow.java
+++ b/src/com/cyngn/theme/perapptheming/PerAppThemingWindow.java
@@ -186,7 +186,7 @@ public class PerAppThemingWindow extends Service implements OnTouchListener,
mThemeApplyingView = mThemeListLayout.findViewById(R.id.applying_theme_text);
final Configuration config = getResources().getConfiguration();
- mThemeConfig = config != null ? config.themeConfig : null;
+ mThemeConfig = getThemeConfig(config);
loadThemes();
getContentResolver().registerContentObserver(ThemesColumns.CONTENT_URI, true,
mThemesObserver);
@@ -315,7 +315,7 @@ public class PerAppThemingWindow extends Service implements OnTouchListener,
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
- mThemeConfig = newConfig.themeConfig;
+ mThemeConfig = getThemeConfig(newConfig);
}
@Override
@@ -344,6 +344,14 @@ public class PerAppThemingWindow extends Service implements OnTouchListener,
});
}
+ private ThemeConfig getThemeConfig(Configuration config) {
+ if (config != null && config.themeConfig != null) {
+ return config.themeConfig;
+ }
+
+ return ThemeConfig.getBootTheme(getContentResolver());
+ }
+
private void removeViewIfAttached(View view) {
if (view.isAttachedToWindow()) {
mWindowManager.removeViewImmediate(view);