Skip to content

Commit

Permalink
Fix dark mode being always applied to member list
Browse files Browse the repository at this point in the history
  • Loading branch information
MCMrARM committed Feb 24, 2019
1 parent 87068b4 commit 5e2bf0b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/src/main/java/io/mrarm/irc/util/theme/ThemeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,15 @@ public void applyThemeToActivity(Activity activity) {
theme.getResTable());
currentCustomThemePatcher = new Theme(context, themeFile.getAbsolutePath());
}
ThemeResInfo currentBaseTheme = currentTheme;
if (currentCustomTheme != null)
currentBaseTheme = currentCustomTheme.baseThemeInfo;
if (mNeedsApplyIrcColors) {
Configuration c = new Configuration();
c.setToDefaults();
c.uiMode = Configuration.UI_MODE_TYPE_NORMAL;
c.uiMode |= Configuration.UI_MODE_NIGHT_YES;
if (currentBaseTheme instanceof BaseTheme && ((BaseTheme) currentBaseTheme).isDark)
c.uiMode |= Configuration.UI_MODE_NIGHT_YES;
Resources r = new Resources(currentCustomThemePatcher != null ?
currentCustomThemePatcher.getAssetManager() : context.getAssets(),
new DisplayMetrics(), c);
Expand All @@ -271,9 +275,6 @@ public void applyThemeToActivity(Activity activity) {
if (currentCustomThemePatcher != null) {
currentCustomThemePatcher.applyToActivity(activity);
}
ThemeResInfo currentBaseTheme = currentTheme;
if (currentCustomTheme != null)
currentBaseTheme = currentCustomTheme.baseThemeInfo;
if (currentBaseTheme instanceof BaseTheme) {
if (((BaseTheme) currentBaseTheme).isDark)
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
Expand Down

0 comments on commit 5e2bf0b

Please sign in to comment.