Skip to content

Commit 749b8f6

Browse files
committed
fix(ui): hacky fix for updating colors on show question marks setting change
This only applies if the grey completed setting is enabled. This is to avoid restarting the app to see the resulting color change, when changing the show question marks setting. It'll be good to call `finish()` on the settings activity, to avoid stacking activities every time the setting is changed.
1 parent fb5c1cf commit 749b8f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

uhabits-android/src/main/java/org/isoron/uhabits/activities/habits/list/ListHabitsActivity.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,12 @@ class ListHabitsActivity : AppCompatActivity(), Preferences.Listener {
7575
private lateinit var menu: ListHabitsMenu
7676

7777
override fun onQuestionMarksChanged() {
78-
invalidateOptionsMenu()
79-
menu.behavior.onPreferencesChanged()
78+
if (prefs.greyCompleted) {
79+
restartWithFade(this::class.java)
80+
} else {
81+
invalidateOptionsMenu()
82+
menu.behavior.onPreferencesChanged()
83+
}
8084
}
8185

8286
override fun onCreate(savedInstanceState: Bundle?) {

0 commit comments

Comments
 (0)