diff --git a/app/src/main/assets/fossil_hr/openSourceWatchface.bin b/app/src/main/assets/fossil_hr/openSourceWatchface.bin index f73d261b0..481534f58 100644 Binary files a/app/src/main/assets/fossil_hr/openSourceWatchface.bin and b/app/src/main/assets/fossil_hr/openSourceWatchface.bin differ diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java index 6e18fd2f5..0cdf0edd7 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java @@ -399,6 +399,9 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem if (watchfaceConfig.has("toggle_widgets_event")) { watchfaceSettings.setToggleWidgetsEvent(watchfaceConfig.getString("toggle_widgets_event")); } + if (watchfaceConfig.has("toggle_backlight_event")) { + watchfaceSettings.setToggleBacklightEvent(watchfaceConfig.getString("toggle_backlight_event")); + } if (watchfaceConfig.has("powersave_display")) { watchfaceSettings.setPowersaveDisplay(watchfaceConfig.getBoolean("powersave_display")); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceFactory.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceFactory.java index 6e85ead4c..cef895c0a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceFactory.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceFactory.java @@ -302,6 +302,7 @@ public class HybridHRWatchfaceFactory { config.put("wrist_flick_move_hour", settings.getWristFlickMoveHour()); config.put("wrist_flick_move_minute", settings.getWristFlickMoveMinute()); config.put("toggle_widgets_event", settings.getToggleWidgetsEvent()); + config.put("toggle_backlight_event", settings.getToggleBacklightEvent()); config.put("powersave_display", settings.getPowersaveDisplay()); config.put("powersave_hands", settings.getPowersaveHands()); config.put("light_up_on_notification", settings.getLightUpOnNotification()); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceSettings.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceSettings.java index c11309f42..4f947e874 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceSettings.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceSettings.java @@ -26,6 +26,7 @@ public class HybridHRWatchfaceSettings implements Serializable { private int wristFlickMoveHour = 360; private int wristFlickMoveMinute = -360; private String toggleWidgetsEvent = ""; + private String toggleBacklightEvent = ""; private boolean powersaveDisplay = false; private boolean powersaveHands = false; private boolean lightUpOnNotification = false; @@ -109,6 +110,14 @@ public class HybridHRWatchfaceSettings implements Serializable { this.toggleWidgetsEvent = event; } + public String getToggleBacklightEvent() { + return toggleBacklightEvent; + } + + public void setToggleBacklightEvent(String event) { + this.toggleBacklightEvent = event; + } + public boolean getPowersaveDisplay() { return powersaveDisplay; } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceSettingsActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceSettingsActivity.java index 82d3e22b9..30ffe04d8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceSettingsActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceSettingsActivity.java @@ -110,6 +110,11 @@ public class HybridHRWatchfaceSettingsActivity extends AbstractSettingsActivity toggle_widgets.setValue(settings.getToggleWidgetsEvent()); toggle_widgets.setSummary(toggle_widgets.getEntry()); + ListPreference toggle_backlight = (ListPreference) findPreference("pref_hybridhr_watchface_toggle_backlight"); + toggle_backlight.setOnPreferenceChangeListener(this); + toggle_backlight.setValue(settings.getToggleBacklightEvent()); + toggle_backlight.setSummary(toggle_backlight.getEntry()); + SwitchPreference power_saving_display = (SwitchPreference) findPreference("pref_hybridhr_watchface_power_saving_display"); power_saving_display.setOnPreferenceChangeListener(this); power_saving_display.setChecked(settings.getPowersaveDisplay()); @@ -154,6 +159,11 @@ public class HybridHRWatchfaceSettingsActivity extends AbstractSettingsActivity ((ListPreference)preference).setValue(newValue.toString()); preference.setSummary(((ListPreference)preference).getEntry()); break; + case "pref_hybridhr_watchface_toggle_backlight": + settings.setToggleBacklightEvent(newValue.toString()); + ((ListPreference)preference).setValue(newValue.toString()); + preference.setSummary(((ListPreference)preference).getEntry()); + break; case "pref_hybridhr_watchface_power_saving_display": settings.setPowersaveDisplay((boolean) newValue); break; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridConstants.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridConstants.java index 36e90b1e2..b00cd0f09 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridConstants.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridConstants.java @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.Map; public final class QHybridConstants { - public static final String HYBRIDHR_WATCHFACE_VERSION = "1.3"; + public static final String HYBRIDHR_WATCHFACE_VERSION = "1.4"; public static final int HYBRID_HR_WATCHFACE_WIDGET_SIZE = 76; public static Map KNOWN_WAPP_VERSIONS = new HashMap() { diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 40ced400d..85de64751 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -1824,7 +1824,7 @@ widget_bg_dashed_circle - + @string/menuitem_nothing @string/pref_title_upper_button_function_short @string/pref_title_upper_button_function_long @@ -1832,7 +1832,7 @@ @string/pref_title_lower_button_function_short @string/pref_title_lower_button_function_long - + top_short_press_release top_hold diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 387055622..7209b5a2d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1472,8 +1472,9 @@ Hour hand (-360 to 360) Minute hand (-360 to 360) Duration (in ms) - Toggle widgets - Button action + Custom events + Toggle widgets + Turn backlight on A watchface with this name already exists in the cache. Do you want to overwrite it? Upload of the watchface failed. Please try again. Battery diff --git a/app/src/main/res/xml/fossil_hr_watchface_settings.xml b/app/src/main/res/xml/fossil_hr_watchface_settings.xml index d6d47fd82..ff3bb4717 100644 --- a/app/src/main/res/xml/fossil_hr_watchface_settings.xml +++ b/app/src/main/res/xml/fossil_hr_watchface_settings.xml @@ -45,16 +45,24 @@ + android:title="@string/watchface_setting_title_custom_events"> + diff --git a/external/fossil-hr-watchface b/external/fossil-hr-watchface index 0e2551757..6b3754690 160000 --- a/external/fossil-hr-watchface +++ b/external/fossil-hr-watchface @@ -1 +1 @@ -Subproject commit 0e2551757d8c70031c2533d3d94a0f284c05ca9f +Subproject commit 6b3754690359b8ae964d73d18e607d4631e1eaf2