/** Updates all theme observers. */ public static void updateThemeObservers() { for (ThemeObserver curObserver : THEME_OBSERVERS) { curObserver.updateTheme(); } // GUIMediator.getMainOptionsComponent().validate(); // GUIMediator.getAppFrame().validate(); }
@SuppressWarnings("WrongConstant") private void setTheme(@Theme int themeId) { currentTheme = themeId; prefs.edit().putString(deprecatedThemeKey, String.valueOf(currentTheme)).apply(); prefs.edit().putBoolean(themeKey, isDarkTheme()).apply(); for (ThemeObserver observer : observers) { observer.onThemeHasChanged(currentTheme); } }