Mi Band: for vibration settings, group navication types (email, sms, chat, social network, navigation)
This commit is contained in:
parent
cd195a5969
commit
a094f0cc76
|
@ -23,4 +23,24 @@ public enum NotificationType {
|
||||||
public String getFixedValue() {
|
public String getFixedValue() {
|
||||||
return name().toLowerCase();
|
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";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -534,26 +534,8 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNotification(NotificationSpec notificationSpec) {
|
public void onNotification(NotificationSpec notificationSpec) {
|
||||||
String origin = notificationSpec.type.getFixedValue();
|
String origin = notificationSpec.type.getGenericType();
|
||||||
switch (notificationSpec.type) {
|
performPreferredNotification(origin + " received", origin, null);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -184,12 +184,17 @@
|
||||||
<string name="vibration_profile_ring">Ring</string>
|
<string name="vibration_profile_ring">Ring</string>
|
||||||
<string name="vibration_profile_alarm_clock">Alarm Clock</string>
|
<string name="vibration_profile_alarm_clock">Alarm Clock</string>
|
||||||
<string name="miband_prefs_vibration">Vibration</string>
|
<string name="miband_prefs_vibration">Vibration</string>
|
||||||
|
|
||||||
|
<string name="vibration_try">Try</string>
|
||||||
<string name="pref_screen_notification_profile_sms">SMS Notification</string>
|
<string name="pref_screen_notification_profile_sms">SMS Notification</string>
|
||||||
<string name="pref_header_vibration_settings">Vibration Settings</string>
|
<string name="pref_header_vibration_settings">Vibration Settings</string>
|
||||||
<string name="pref_screen_notification_profile_generic">Generic Notification</string>
|
<string name="pref_screen_notification_profile_generic">Generic Notification</string>
|
||||||
<string name="pref_screen_notification_profile_pebblemsg">Pebble Notification</string>
|
|
||||||
<string name="pref_screen_notification_profile_email">Email Notification</string>
|
<string name="pref_screen_notification_profile_email">Email Notification</string>
|
||||||
<string name="pref_screen_notification_profile_incoming_call">Incoming Call Notification</string>
|
<string name="pref_screen_notification_profile_incoming_call">Incoming Call Notification</string>
|
||||||
|
<string name="pref_screen_notification_profile_generic_chat">Chat</string>
|
||||||
|
<string name="pref_screen_notification_profile_generic_navigation">Navigation</string>
|
||||||
|
<string name="pref_screen_notification_profile_generic_social">Social Network</string>
|
||||||
|
|
||||||
<string name="control_center_find_lost_device">Find lost Device</string>
|
<string name="control_center_find_lost_device">Find lost Device</string>
|
||||||
<string name="control_center_cancel_to_stop_vibration">Cancel to stop vibration.</string>
|
<string name="control_center_cancel_to_stop_vibration">Cancel to stop vibration.</string>
|
||||||
<string name="title_activity_charts">Your Activity</string>
|
<string name="title_activity_charts">Your Activity</string>
|
||||||
|
@ -333,9 +338,4 @@
|
||||||
|
|
||||||
<!-- Strings related to Vibration Activity -->
|
<!-- Strings related to Vibration Activity -->
|
||||||
<string name="title_activity_vibration">Vibration</string>
|
<string name="title_activity_vibration">Vibration</string>
|
||||||
<string name="vibration_try">Try</string>
|
|
||||||
<string name="pref_screen_notification_profile_chat">Chat</string>
|
|
||||||
<string name="pref_screen_notification_profile_facebook">Facebook</string>
|
|
||||||
<string name="pref_screen_notification_profile_twitter">Twitter</string>
|
|
||||||
<string name="pref_screen_notification_profile_telegram">Telegram</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -121,31 +121,6 @@
|
||||||
android:title="@string/vibration_try"/>
|
android:title="@string/vibration_try"/>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
||||||
<PreferenceScreen
|
|
||||||
android:key="vibration_profile_key"
|
|
||||||
android:title="@string/pref_screen_notification_profile_telegram"
|
|
||||||
android:persistent="false">
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="@string/p_waterdrop"
|
|
||||||
android:entries="@array/vibration_profile"
|
|
||||||
android:entryValues="@array/vibration_profile_values"
|
|
||||||
android:key="mi_vibration_profile_telegram"
|
|
||||||
android:title="@string/miband_prefs_vibration"
|
|
||||||
android:summary="%s" />
|
|
||||||
|
|
||||||
<EditTextPreference
|
|
||||||
android:defaultValue="3"
|
|
||||||
android:inputType="number"
|
|
||||||
android:key="mi_vibration_count_telegram"
|
|
||||||
android:maxLength="1"
|
|
||||||
android:title="@string/pref_title_notifications_repetitions" />
|
|
||||||
<Preference
|
|
||||||
android:key="mi_try_telegram"
|
|
||||||
android:persistent="false"
|
|
||||||
android:title="@string/vibration_try"/>
|
|
||||||
</PreferenceScreen>
|
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:key="vibration_profile_key"
|
android:key="vibration_profile_key"
|
||||||
android:title="@string/pref_screen_notification_profile_chat"
|
android:title="@string/pref_screen_notification_profile_chat"
|
||||||
|
@ -173,51 +148,51 @@
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:key="vibration_profile_key"
|
android:key="vibration_profile_key"
|
||||||
android:title="@string/pref_screen_notification_profile_twitter"
|
android:title="@string/pref_screen_notification_profile_generic_social"
|
||||||
android:persistent="false">
|
android:persistent="false">
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="@string/p_waterdrop"
|
android:defaultValue="@string/p_waterdrop"
|
||||||
android:entries="@array/vibration_profile"
|
android:entries="@array/vibration_profile"
|
||||||
android:entryValues="@array/vibration_profile_values"
|
android:entryValues="@array/vibration_profile_values"
|
||||||
android:key="mi_vibration_profile_twitter"
|
android:key="mi_vibration_profile_generic_social"
|
||||||
android:title="@string/miband_prefs_vibration"
|
android:title="@string/miband_prefs_vibration"
|
||||||
android:summary="%s" />
|
android:summary="%s" />
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:defaultValue="3"
|
android:defaultValue="3"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:key="mi_vibration_count_twitter"
|
android:key="mi_vibration_count_generic_social"
|
||||||
android:maxLength="1"
|
android:maxLength="1"
|
||||||
android:title="@string/pref_title_notifications_repetitions" />
|
android:title="@string/pref_title_notifications_repetitions" />
|
||||||
<Preference
|
<Preference
|
||||||
android:key="mi_try_twitter"
|
android:key="mi_try_generic_social"
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:title="@string/vibration_try"/>
|
android:title="@string/vibration_try"/>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:key="vibration_profile_key"
|
android:key="vibration_profile_key"
|
||||||
android:title="@string/pref_screen_notification_profile_facebook"
|
android:title="@string/pref_screen_notification_profile_generic_navigation"
|
||||||
android:persistent="false">
|
android:persistent="false">
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:defaultValue="@string/p_waterdrop"
|
android:defaultValue="@string/p_waterdrop"
|
||||||
android:entries="@array/vibration_profile"
|
android:entries="@array/vibration_profile"
|
||||||
android:entryValues="@array/vibration_profile_values"
|
android:entryValues="@array/vibration_profile_values"
|
||||||
android:key="mi_vibration_profile_facebook"
|
android:key="mi_vibration_profile_generic_navigation"
|
||||||
android:title="@string/miband_prefs_vibration"
|
android:title="@string/miband_prefs_vibration"
|
||||||
android:summary="%s" />
|
android:summary="%s" />
|
||||||
|
|
||||||
<EditTextPreference
|
<EditTextPreference
|
||||||
android:defaultValue="3"
|
android:defaultValue="3"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:key="mi_vibration_count_facebook"
|
android:key="mi_vibration_count_generic_navigation"
|
||||||
android:maxLength="1"
|
android:maxLength="1"
|
||||||
android:title="@string/pref_title_notifications_repetitions" />
|
android:title="@string/pref_title_notifications_repetitions" />
|
||||||
<Preference
|
<Preference
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:key="mi_try_facebook"
|
android:key="mi_try_generic_navigation"
|
||||||
android:title="@string/vibration_try"/>
|
android:title="@string/vibration_try"/>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue