diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java index 5f7577a19..48b564903 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/NotificationType.java @@ -23,4 +23,24 @@ public enum NotificationType { public String getFixedValue() { return name().toLowerCase(); } + + public String getGenericType() { + switch (this) { + case GENERIC_EMAIL: + case GENERIC_NAVIGATION: + case GENERIC_SMS: + return getFixedValue(); + case FACEBOOK: + case TWITTER: + return "generic_social"; + case CONVERSATIONS: + case FACEBOOK_MESSENGER: + case SIGNAL: + case TELEGRAM: + return "generic_chat"; + case UNKNOWN: + default: + return "generic"; + } + } } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java index ce11b0f45..49a90d92a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/miband/MiBandSupport.java @@ -534,26 +534,8 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { @Override public void onNotification(NotificationSpec notificationSpec) { - String origin = notificationSpec.type.getFixedValue(); - switch (notificationSpec.type) { - case GENERIC_SMS: - performPreferredNotification("sms received", origin, null); - break; - case GENERIC_EMAIL: - performPreferredNotification("email received", origin, null); - break; - case CONVERSATIONS: - case FACEBOOK: - case FACEBOOK_MESSENGER: - case SIGNAL: - case TELEGRAM: - case TWITTER: - performPreferredNotification("chat message received", origin, null); - break; - case UNKNOWN: - default: - performPreferredNotification("generic notification received", origin, null); - } + String origin = notificationSpec.type.getGenericType(); + performPreferredNotification(origin + " received", origin, null); } @Override diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eb9887ae3..689b5b6d1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -184,12 +184,17 @@ Ring Alarm Clock Vibration + + Try SMS Notification Vibration Settings Generic Notification - Pebble Notification Email Notification Incoming Call Notification + Chat + Navigation + Social Network + Find lost Device Cancel to stop vibration. Your Activity @@ -333,9 +338,4 @@ Vibration - Try - Chat - Facebook - Twitter - Telegram diff --git a/app/src/main/res/xml/miband_preferences.xml b/app/src/main/res/xml/miband_preferences.xml index 74f57c531..c5040effe 100644 --- a/app/src/main/res/xml/miband_preferences.xml +++ b/app/src/main/res/xml/miband_preferences.xml @@ -121,31 +121,6 @@ android:title="@string/vibration_try"/> - - - - - - - -