diff --git a/app/src/main/java/com/orgzly/android/ui/settings/SettingsFragment.kt b/app/src/main/java/com/orgzly/android/ui/settings/SettingsFragment.kt index 0681cdf95..6556ec27a 100644 --- a/app/src/main/java/com/orgzly/android/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/orgzly/android/ui/settings/SettingsFragment.kt @@ -126,6 +126,7 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP /* Update preferences which depend on multiple others. */ updateRemindersScreen() + updateWidgetScreen() } private fun setupVersionPreference() { @@ -326,6 +327,7 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP } updateRemindersScreen() + updateWidgetScreen() /* Always notify about possibly changed data, if settings are modified. * @@ -363,6 +365,16 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP } } + private fun updateWidgetScreen() { + val colorScheme = preference(R.string.pref_key_widget_color_scheme) + + if (colorScheme != null) { + /* Widget opacity isn't supported on the dynamic color scheme. */ + val opacityEnabled = (colorScheme as ListPreference).value != "dynamic" + preference(R.string.pref_key_widget_opacity)?.isEnabled = opacityEnabled + } + } + /** * Update list of possible states that can be used as default for a new note. */