From ce456d6dcce6e10bd01bda2cb679e36f5b930da8 Mon Sep 17 00:00:00 2001 From: Arjan Schrijver Date: Mon, 12 Sep 2022 17:38:18 +0200 Subject: [PATCH] Fossil Hybrid HR: Allow flick_away as custom event and add move_hands event --- .../assets/fossil_hr/openSourceWatchface.bin | Bin 8466 -> 8528 bytes .../HybridHRWatchfaceDesignerActivity.java | 3 +++ .../qhybrid/HybridHRWatchfaceFactory.java | 1 + .../qhybrid/HybridHRWatchfaceSettings.java | 9 +++++++++ .../HybridHRWatchfaceSettingsActivity.java | 10 ++++++++++ .../devices/qhybrid/QHybridConstants.java | 2 +- app/src/main/res/values/arrays.xml | 6 ++++-- app/src/main/res/values/strings.xml | 1 + .../res/xml/fossil_hr_watchface_settings.xml | 16 ++++++++++++---- external/fossil-hr-watchface | 2 +- 10 files changed, 42 insertions(+), 8 deletions(-) diff --git a/app/src/main/assets/fossil_hr/openSourceWatchface.bin b/app/src/main/assets/fossil_hr/openSourceWatchface.bin index f8af52fdcd1168dc206a6d86c4d6e856d2bb8d77..e17b62ced46c1630571f5c774c6bc2d7e63c0d05 100644 GIT binary patch delta 2789 zcmZ{mU2Ggz6~})wv%9nQt{t!AkB#fB*Xxg2JBk}3yh~#ztx}RP2};@kAxRV4>%^HD z9LK~TG@+^kZ5axv&qNskD<{?5*U8sb23f80EsNP#E(=ru4 z>b<1rO6GP5w}bmQ*dGRK2ZZw9sbb{V5ZGXkKrjN~N5I|Xy{jK;b9O_pTW$A0s!X!f z+~e&xwzY^^yvq`I514z!t9QjHyw7Am5t-gK3QO*jVDAIxW8l{)sMg29`~+D0!TBUu z2f#l7P6N0HAv_57A+VBQJq7+#U>*kNFocJ}J_4)(_Xq?>z?XHS;E#ei2KE@ZV_=Ts zJs0~!iv-afhoBcTax{4_v5tY6j#J!aK?K!ncMH4RfpK0gWwr(o&|pi z>~r9rgYX>qp9l8~D)8oW)ymj(FPD-(`*}r&@Oh!1_wVH5QcnadsmBsMJVo2*)x>e2(b`mcT zyQ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vsdrS&d07M z@>!!H#o20Qt~y?wJ~cImDr|Z^5od0ya`yDBdTUePPz#gOXDi2NrotWL)v1}8=~-tT z(`Q#>jZZC1%~nZqYI;&mIC*+zQZ*O0w}zf)W-8~$Co9#;`23m4N_A@T>OF<1@n6@A BFq{AY 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 64c5a84b7..fdbe0bab5 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 @@ -402,6 +402,9 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem if (watchfaceConfig.has("toggle_backlight_event")) { watchfaceSettings.setToggleBacklightEvent(watchfaceConfig.getString("toggle_backlight_event")); } + if (watchfaceConfig.has("move_hands_event")) { + watchfaceSettings.setMoveHandsEvent(watchfaceConfig.getString("move_hands_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 cef895c0a..cb55791b1 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 @@ -303,6 +303,7 @@ public class HybridHRWatchfaceFactory { config.put("wrist_flick_move_minute", settings.getWristFlickMoveMinute()); config.put("toggle_widgets_event", settings.getToggleWidgetsEvent()); config.put("toggle_backlight_event", settings.getToggleBacklightEvent()); + config.put("move_hands_event", settings.getMoveHandsEvent()); 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 4f947e874..51bfa7df7 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 @@ -27,6 +27,7 @@ public class HybridHRWatchfaceSettings implements Serializable { private int wristFlickMoveMinute = -360; private String toggleWidgetsEvent = ""; private String toggleBacklightEvent = ""; + private String moveHandsEvent = "flick_away"; private boolean powersaveDisplay = false; private boolean powersaveHands = false; private boolean lightUpOnNotification = false; @@ -118,6 +119,14 @@ public class HybridHRWatchfaceSettings implements Serializable { this.toggleBacklightEvent = event; } + public String getMoveHandsEvent() { + return moveHandsEvent; + } + + public void setMoveHandsEvent(String event) { + this.moveHandsEvent = 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 30ffe04d8..dd6ebcf9f 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 @@ -115,6 +115,11 @@ public class HybridHRWatchfaceSettingsActivity extends AbstractSettingsActivity toggle_backlight.setValue(settings.getToggleBacklightEvent()); toggle_backlight.setSummary(toggle_backlight.getEntry()); + ListPreference move_hands = (ListPreference) findPreference("pref_hybridhr_watchface_move_hands"); + move_hands.setOnPreferenceChangeListener(this); + move_hands.setValue(settings.getMoveHandsEvent()); + move_hands.setSummary(move_hands.getEntry()); + SwitchPreference power_saving_display = (SwitchPreference) findPreference("pref_hybridhr_watchface_power_saving_display"); power_saving_display.setOnPreferenceChangeListener(this); power_saving_display.setChecked(settings.getPowersaveDisplay()); @@ -164,6 +169,11 @@ public class HybridHRWatchfaceSettingsActivity extends AbstractSettingsActivity ((ListPreference)preference).setValue(newValue.toString()); preference.setSummary(((ListPreference)preference).getEntry()); break; + case "pref_hybridhr_watchface_move_hands": + settings.setMoveHandsEvent(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 fdda9a68f..c241ea1a2 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 @@ -22,7 +22,7 @@ import java.util.Map; import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind; public final class QHybridConstants { - public static final String HYBRIDHR_WATCHFACE_VERSION = "1.6"; + public static final String HYBRIDHR_WATCHFACE_VERSION = "1.7"; 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 9a65ed49f..41d682345 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -2046,21 +2046,23 @@ widget_bg_dashed_circle - + @string/menuitem_nothing @string/pref_title_upper_button_function_short @string/pref_title_upper_button_function_long @string/pref_title_middle_button_function_short @string/pref_title_lower_button_function_short @string/pref_title_lower_button_function_long + @string/watchface_setting_title_wrist_flick - + top_short_press_release top_hold middle_short_press_release bottom_short_press_release bottom_hold + flick_away diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ff9457603..d64be7f0c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1559,6 +1559,7 @@ Custom events Toggle widgets Turn backlight on + Move hands 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 ff3bb4717..5a56feb2b 100644 --- a/app/src/main/res/xml/fossil_hr_watchface_settings.xml +++ b/app/src/main/res/xml/fossil_hr_watchface_settings.xml @@ -51,18 +51,26 @@ android:persistent="false" android:title="@string/watchface_setting_button_toggle_widgets" android:key="pref_hybridhr_watchface_toggle_widgets" - android:entries="@array/pref_hybridhr_watchface_buttonevents_items" - android:entryValues="@array/pref_hybridhr_watchface_buttonevents_values" + android:entries="@array/pref_hybridhr_watchface_events_items" + android:entryValues="@array/pref_hybridhr_watchface_events_values" android:dialogTitle="@string/watchface_setting_button_toggle_widgets" android:negativeButtonText="@string/Cancel"/> + diff --git a/external/fossil-hr-watchface b/external/fossil-hr-watchface index 2cb107b23..a858758bc 160000 --- a/external/fossil-hr-watchface +++ b/external/fossil-hr-watchface @@ -1 +1 @@ -Subproject commit 2cb107b23e26546ab27b8d13eacf8b0852d8b514 +Subproject commit a858758bc9e287c9f902e061511f12aee4870972