Add option to disable notification light

Closes #91
pull/384/head
Alex Baker 10 years ago
parent d7e4cc4fd1
commit 271eded3e7

@ -270,12 +270,16 @@ public class Notifier {
private void activateNotification(int ringTimes, int notificationId, Notification notification, String text) {
if (preferences.getBoolean(R.string.p_rmd_persistent, true)) {
notification.flags |= Notification.FLAG_NO_CLEAR | Notification.FLAG_SHOW_LIGHTS;
notification.flags |= Notification.FLAG_NO_CLEAR;
}
if (preferences.getBoolean(R.string.p_disable_notification_light, false)) {
notification.ledOffMS = 0;
notification.ledOnMS = 0;
} else {
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledOffMS = 5000;
notification.ledOnMS = 700;
notification.ledARGB = Color.YELLOW;
} else {
notification.defaults = Notification.DEFAULT_LIGHTS;
}
if (atLeastJellybean()) {

@ -243,6 +243,7 @@
<string name="p_reverse_sort">reverse_sort</string>
<string name="p_manual_sort">manual_sort</string>
<string name="p_notification_priority">notification_priority</string>
<string name="p_disable_notification_light">disable_notification_light</string>
<string-array name="TEA_control_sets_prefs">
<item>@string/TEA_ctrl_when_pref</item>

@ -137,6 +137,7 @@
<string name="anonymous_usage_blurb">Anonymous usage statistics are collected</string>
<string name="opt_out">Opt-out</string>
<string name="tag_already_exists">Tag already exists</string>
<string name="disable_notification_light">Disable notification light</string>
<string-array name="sync_SPr_interval_entries">
<!-- sync_SPr_interval_entries: Synchronization Intervals -->

@ -33,6 +33,11 @@
android:showDefault="true"
android:showSilent="true"
android:title="@string/sound" />
<CheckBoxPreference
android:defaultValue="false"
android:dependency="@string/p_rmd_enabled"
android:key="@string/p_disable_notification_light"
android:title="@string/disable_notification_light" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:defaultValue="true"
android:dependency="@string/p_rmd_enabled"

Loading…
Cancel
Save