feat(ui): save theme selection to preferences

This commit is contained in:
2026-03-28 22:37:55 +01:00
parent 93008f7247
commit d0e412ca83
2 changed files with 11 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.michatec.radio.Keys
import com.michatec.radio.R
import com.michatec.radio.helpers.AppThemeHelper
import com.michatec.radio.helpers.PreferencesHelper
/*
@@ -85,10 +86,10 @@ class ThemeSelectionDialog(private var themeSelectionDialogListener: ThemeSelect
R.id.radio_theme_dark -> Keys.STATE_THEME_DARK_MODE
else -> Keys.STATE_THEME_FOLLOW_SYSTEM
}
// save theme selection to preferences
PreferencesHelper.saveThemeSelection(selectedTheme)
// apply theme immediately
AppThemeHelper.setTheme(selectedTheme)
// update radio buttons to reflect new theme
updateRadioButtons(context, radioFollowSystem, radioLight, radioDark)
// notify listener
themeSelectionDialogListener.onThemeSelectionDialog(true, selectedTheme)
// dismiss dialog