mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 17:18:52 -06:00
make LED blinking for notifications configurable
This commit is contained in:
@@ -263,6 +263,12 @@ public class Preferences
|
||||
for (Listener l : listeners) l.onNotificationsChanged();
|
||||
}
|
||||
|
||||
public void setNotificationsLed(boolean enabled)
|
||||
{
|
||||
storage.putBoolean("pref_led_notifications", enabled);
|
||||
for (Listener l : listeners) l.onNotificationsChanged();
|
||||
}
|
||||
|
||||
public void setCheckmarkSequenceReversed(boolean reverse)
|
||||
{
|
||||
shouldReverseCheckmarks = reverse;
|
||||
@@ -281,6 +287,11 @@ public class Preferences
|
||||
return storage.getBoolean("pref_sticky_notifications", false);
|
||||
}
|
||||
|
||||
public boolean shouldMakeNotificationsLed()
|
||||
{
|
||||
return storage.getBoolean("pref_led_notifications", false);
|
||||
}
|
||||
|
||||
public boolean isCheckmarkSequenceReversed()
|
||||
{
|
||||
if (shouldReverseCheckmarks == null) shouldReverseCheckmarks =
|
||||
|
||||
@@ -159,6 +159,10 @@ public class PreferencesTest extends BaseUnitTest
|
||||
prefs.setNotificationsSticky(true);
|
||||
assertTrue(prefs.shouldMakeNotificationsSticky());
|
||||
|
||||
assertFalse(prefs.shouldMakeNotificationsLed());
|
||||
prefs.setNotificationsLed(true);
|
||||
assertTrue(prefs.shouldMakeNotificationsLed());
|
||||
|
||||
assertThat(prefs.getSnoozeInterval(), equalTo(15L));
|
||||
prefs.setSnoozeInterval(30);
|
||||
assertThat(prefs.getSnoozeInterval(), equalTo(30L));
|
||||
|
||||
Reference in New Issue
Block a user