diff options
-rw-r--r-- | build.gradle | 4 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/NotificationService.java | 11 | ||||
-rw-r--r-- | src/main/res/values-de/strings.xml | 2 | ||||
-rw-r--r-- | src/main/res/xml/preferences.xml | 5 |
4 files changed, 19 insertions, 3 deletions
diff --git a/build.gradle b/build.gradle index 0cd30cf9..5219ef1d 100644 --- a/build.gradle +++ b/build.gradle @@ -43,8 +43,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 21 - versionCode 60 - versionName "1.2.3" + versionCode 61 + versionName "1.2.4" } compileOptions { diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 7269a559..fa079829 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -215,12 +215,21 @@ public class NotificationService { mBuilder.setDefaults(0); mBuilder.setSmallIcon(R.drawable.ic_notification); mBuilder.setDeleteIntent(createDeleteIntent()); - mBuilder.setLights(0xff00FF00, 2000, 3000); + mBuilder.setLights(this.getLedNotificationColor(preferences), 2000, 4000); final Notification notification = mBuilder.build(); notificationManager.notify(NOTIFICATION_ID, notification); } } + private int getLedNotificationColor(SharedPreferences preferences) { + String ledColorString = preferences.getString("led_notification_color", "0xffffffff"); + try { + return Integer.valueOf(ledColorString); + } catch (NumberFormatException e) { + return 0xffffffff; + } + } + private Builder buildMultipleConversation() { final Builder mBuilder = new NotificationCompat.Builder( mXmppConnectionService); diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml index 44a7efb2..14e5b091 100644 --- a/src/main/res/values-de/strings.xml +++ b/src/main/res/values-de/strings.xml @@ -433,4 +433,6 @@ <item quantity="one">%d Kontakt ausgewählt</item> <item quantity="other">%d Kontakte ausgewählt</item> </plurals> + <string name="pref_led_notification_color">LED-Benachrichtigung Farbe</string> + <string name="pref_led_notification_color_summary">Setze die Farbe der LED-Benachrichtigung</string> </resources> diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index d055f573..adc15c6f 100644 --- a/src/main/res/xml/preferences.xml +++ b/src/main/res/xml/preferences.xml @@ -151,6 +151,11 @@ android:key="keep_foreground_service" android:title="@string/pref_keep_foreground_service" android:summary="@string/pref_keep_foreground_service_summary" /> + <EditTextPreference + android:defaultValue="0xffffffff" + android:key="led_notification_color" + android:title="@string/pref_led_notification_color" + android:summary="@string/pref_led_notification_color_summary"/> </PreferenceCategory> </PreferenceScreen> |