Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2016f034 authored by Michael W's avatar Michael W Committed by Michael Bestas
Browse files

DeskClock: Fix wrong screensaver clock style being displayed

* Similar to commit e96455ab, the preference didn't reflect the actual
  value
* Get the value from settings manually and assign the preference the
  correct index and summary

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/5918
Change-Id: I07a5f2478149bd106c4fd48ccb6f218b37f21362
parent c3763b44
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -87,7 +87,10 @@ public final class ScreensaverSettingsActivity extends AppCompatActivity {
            final ListPreference clockStylePref = findPreference(KEY_CLOCK_STYLE);
            final CheckBoxPreference nightModePref = findPreference(KEY_NIGHT_MODE);
            if (clockStylePref != null && nightModePref != null) {
                clockStylePref.setSummary(clockStylePref.getEntry());
                final int index = clockStylePref.findIndexOfValue(DataModel.getDataModel().
                        getScreensaverClockStyle().toString().toLowerCase());
                clockStylePref.setValueIndex(index);
                clockStylePref.setSummary(clockStylePref.getEntries()[index]);
                clockStylePref.setOnPreferenceChangeListener(this);
                nightModePref.setChecked(DataModel.getDataModel().getScreensaverNightModeOn());
            }