mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-02-04 04:54:10 +01:00
Fossil HR: added feature to light up screen on new notification
This commit is contained in:
parent
15f5d6ba9d
commit
77becb7702
Binary file not shown.
@ -456,6 +456,9 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem
|
|||||||
if (watchfaceConfig.has("powersave_hands")) {
|
if (watchfaceConfig.has("powersave_hands")) {
|
||||||
watchfaceSettings.setPowersaveHands(watchfaceConfig.getBoolean("powersave_hands"));
|
watchfaceSettings.setPowersaveHands(watchfaceConfig.getBoolean("powersave_hands"));
|
||||||
}
|
}
|
||||||
|
if (watchfaceConfig.has("light_up_on_notification")) {
|
||||||
|
watchfaceSettings.setLightUpOnNotification(watchfaceConfig.getBoolean("light_up_on_notification"));
|
||||||
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
LOG.warn("JSON parsing error", e);
|
LOG.warn("JSON parsing error", e);
|
||||||
}
|
}
|
||||||
|
@ -247,6 +247,7 @@ public class HybridHRWatchfaceFactory {
|
|||||||
config.put("wrist_flick_duration", settings.getWristFlickDuration());
|
config.put("wrist_flick_duration", settings.getWristFlickDuration());
|
||||||
config.put("wrist_flick_move_hour", settings.getWristFlickMoveHour());
|
config.put("wrist_flick_move_hour", settings.getWristFlickMoveHour());
|
||||||
config.put("wrist_flick_move_minute", settings.getWristFlickMoveMinute());
|
config.put("wrist_flick_move_minute", settings.getWristFlickMoveMinute());
|
||||||
|
config.put("light_up_on_notification", settings.getLightUpOnNotification());
|
||||||
config.put("powersave_display", settings.getPowersaveDisplay());
|
config.put("powersave_display", settings.getPowersaveDisplay());
|
||||||
config.put("powersave_hands", settings.getPowersaveHands());
|
config.put("powersave_hands", settings.getPowersaveHands());
|
||||||
configuration.put("config", config);
|
configuration.put("config", config);
|
||||||
|
@ -27,6 +27,7 @@ public class HybridHRWatchfaceSettings implements Serializable {
|
|||||||
private int wristFlickMoveMinute = -360;
|
private int wristFlickMoveMinute = -360;
|
||||||
private boolean powersaveDisplay = false;
|
private boolean powersaveDisplay = false;
|
||||||
private boolean powersaveHands = false;
|
private boolean powersaveHands = false;
|
||||||
|
private boolean lightUpOnNotification = false;
|
||||||
|
|
||||||
public HybridHRWatchfaceSettings() {
|
public HybridHRWatchfaceSettings() {
|
||||||
}
|
}
|
||||||
@ -63,6 +64,14 @@ public class HybridHRWatchfaceSettings implements Serializable {
|
|||||||
this.wristFlickDuration = wristFlickDuration;
|
this.wristFlickDuration = wristFlickDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getLightUpOnNotification() {
|
||||||
|
return lightUpOnNotification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLightUpOnNotification(boolean lightUpOnNotification) {
|
||||||
|
this.lightUpOnNotification = lightUpOnNotification;
|
||||||
|
}
|
||||||
|
|
||||||
public int getWristFlickMoveHour() {
|
public int getWristFlickMoveHour() {
|
||||||
return wristFlickMoveHour;
|
return wristFlickMoveHour;
|
||||||
}
|
}
|
||||||
|
@ -111,6 +111,10 @@ public class HybridHRWatchfaceSettingsActivity extends AbstractSettingsActivity
|
|||||||
SwitchPreference power_saving_hands = (SwitchPreference) findPreference("pref_hybridhr_watchface_power_saving_hands");
|
SwitchPreference power_saving_hands = (SwitchPreference) findPreference("pref_hybridhr_watchface_power_saving_hands");
|
||||||
power_saving_hands.setOnPreferenceChangeListener(new PreferenceChangeListener());
|
power_saving_hands.setOnPreferenceChangeListener(new PreferenceChangeListener());
|
||||||
power_saving_hands.setChecked(settings.getPowersaveHands());
|
power_saving_hands.setChecked(settings.getPowersaveHands());
|
||||||
|
|
||||||
|
SwitchPreference light_up_on_notification = (SwitchPreference) findPreference("pref_hybridhr_watchface_light_up_on_notification");
|
||||||
|
light_up_on_notification.setOnPreferenceChangeListener(new PreferenceChangeListener());
|
||||||
|
light_up_on_notification.setChecked(settings.getLightUpOnNotification());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class PreferenceChangeListener implements Preference.OnPreferenceChangeListener {
|
private static class PreferenceChangeListener implements Preference.OnPreferenceChangeListener {
|
||||||
@ -136,6 +140,9 @@ public class HybridHRWatchfaceSettingsActivity extends AbstractSettingsActivity
|
|||||||
settings.setWristFlickMoveMinute(Integer.parseInt(newValue.toString()));
|
settings.setWristFlickMoveMinute(Integer.parseInt(newValue.toString()));
|
||||||
preference.setSummary(newValue.toString());
|
preference.setSummary(newValue.toString());
|
||||||
break;
|
break;
|
||||||
|
case "pref_hybridhr_watchface_light_up_on_notification":
|
||||||
|
settings.setLightUpOnNotification((boolean) newValue);
|
||||||
|
break;
|
||||||
case "pref_hybridhr_watchface_wrist_flick_duration":
|
case "pref_hybridhr_watchface_wrist_flick_duration":
|
||||||
settings.setWristFlickDuration(Integer.parseInt(newValue.toString()));
|
settings.setWristFlickDuration(Integer.parseInt(newValue.toString()));
|
||||||
preference.setSummary(newValue.toString());
|
preference.setSummary(newValue.toString());
|
||||||
|
@ -1589,4 +1589,5 @@
|
|||||||
<string name="sony_anc_optimize_confirmation_description">Verwende den Kopfhörer wie gewohnt. Wenn sich die Tragebedingungen oder der Luftdruck ändern, führe den Optimierer erneut aus.</string>
|
<string name="sony_anc_optimize_confirmation_description">Verwende den Kopfhörer wie gewohnt. Wenn sich die Tragebedingungen oder der Luftdruck ändern, führe den Optimierer erneut aus.</string>
|
||||||
<string name="devicetype_amazfit_pop">Amazfit Pop</string>
|
<string name="devicetype_amazfit_pop">Amazfit Pop</string>
|
||||||
<string name="devicetype_amazfit_pop_pro">Amazfit Pop Pro</string>
|
<string name="devicetype_amazfit_pop_pro">Amazfit Pop Pro</string>
|
||||||
|
<string name="watchface_setting_light_up_on_notification">Bei neuen Benachrichtigungen aufleuchten</string>
|
||||||
</resources>
|
</resources>
|
@ -1516,4 +1516,5 @@
|
|||||||
<string name="menuitem_menu">Menu</string>
|
<string name="menuitem_menu">Menu</string>
|
||||||
<string name="fossil_hr_button_config_info">Some buttons cannot be configured because their functions are hard-coded in the watch firmware.\n\nWarning: long-pressing the upper button when a watchface from the official Fossil app is installed will also toggle between showing/hiding widgets.</string>
|
<string name="fossil_hr_button_config_info">Some buttons cannot be configured because their functions are hard-coded in the watch firmware.\n\nWarning: long-pressing the upper button when a watchface from the official Fossil app is installed will also toggle between showing/hiding widgets.</string>
|
||||||
<string name="watchface_dialog_widget_width">Width:</string>
|
<string name="watchface_dialog_widget_width">Width:</string>
|
||||||
|
<string name="watchface_setting_light_up_on_notification">Light up on new notification</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -57,6 +57,11 @@
|
|||||||
android:key="pref_hybridhr_watchface_power_saving_hands"
|
android:key="pref_hybridhr_watchface_power_saving_hands"
|
||||||
android:title="@string/watchface_setting_power_saving_hands"
|
android:title="@string/watchface_setting_power_saving_hands"
|
||||||
android:singleLineTitle="false" />
|
android:singleLineTitle="false" />
|
||||||
|
<SwitchPreference
|
||||||
|
android:persistent="false"
|
||||||
|
android:key="pref_hybridhr_watchface_light_up_on_notification"
|
||||||
|
android:title="@string/watchface_setting_light_up_on_notification"
|
||||||
|
android:singleLineTitle="false" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
Loading…
Reference in New Issue
Block a user