From 98e9a0dbf0432aee861e0aeb9db0554423a22766 Mon Sep 17 00:00:00 2001 From: Arjan Schrijver Date: Sun, 1 Dec 2024 22:13:33 +0100 Subject: [PATCH] Fossil/Skagen Gen. 6 Hybrids: Add SpO2 watchface widget --- app/src/main/assets/fossil_hr/icSpO2.rle | 4 ++++ app/src/main/assets/fossil_hr/widgetSpO2.bin | Bin 0 -> 670 bytes .../main/assets/fossil_hr/widgetSpO2_preview.png | Bin 0 -> 5006 bytes .../qhybrid/HybridHRWatchfaceFactory.java | 6 ++++++ .../devices/qhybrid/HybridHRWatchfaceWidget.java | 1 + .../devices/qhybrid/QHybridConstants.java | 2 +- app/src/main/res/values/strings.xml | 1 + external/build_fossil_hr_gbapps.sh | 1 + external/fossil-hr-gbapps | 2 +- 9 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 app/src/main/assets/fossil_hr/icSpO2.rle create mode 100644 app/src/main/assets/fossil_hr/widgetSpO2.bin create mode 100644 app/src/main/assets/fossil_hr/widgetSpO2_preview.png diff --git a/app/src/main/assets/fossil_hr/icSpO2.rle b/app/src/main/assets/fossil_hr/icSpO2.rle new file mode 100644 index 000000000..3841e259c --- /dev/null +++ b/app/src/main/assets/fossil_hr/icSpO2.rle @@ -0,0 +1,4 @@ +                         +    +   +                                                       ÿÿ \ No newline at end of file diff --git a/app/src/main/assets/fossil_hr/widgetSpO2.bin b/app/src/main/assets/fossil_hr/widgetSpO2.bin new file mode 100644 index 0000000000000000000000000000000000000000..78bb18e2d8cb58e14e8124e151fc8de00f470573 GIT binary patch literal 670 zcmYk1zi!iD6vco36aPz`)Wt|17>F1W1{f;QN{E%lLV`*~3{2*e{W<-RV_UJ)s#~`{ zKp!HH(3J(H4^WA{OJ4&y0mNPIJx539-1Fh|^lQX!t~Ahq4iC{7V}Rz5Y+wUiYp~W} zro%>ui2-W^W+ptEFz>;{f{g_=a0i63u7%GcGcsa&F;x5J01?+Z^QfB zyq>P>jx(|0+TQtW9GG}8>BAwqFaqzLIn`e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-c%itQ<`TMW*4}0zZXz$C21tv7#C+W$t(!I&vfrZB0Zp#a9cfRyn z-=rty>gud>m$t;K-6PKMsS>!)?#H`w<2@sG2bj)x*s$!*g=(!CO{;znD}}O|KR47- L@v5D}C(r&bZCM#% literal 0 HcmV?d00001 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 7560fd16d..1fa1c9a19 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 @@ -105,6 +105,7 @@ public class HybridHRWatchfaceFactory { case "widgetActiveMins": case "widgetChanceOfRain": case "widgetUV": + case "widgetSpO2": widget.put("type", "comp"); widget.put("name", widgetDesc.getWidgetType()); widget.put("goal_ring", false); @@ -191,6 +192,7 @@ public class HybridHRWatchfaceFactory { if (includeWidget("widgetActiveMins") > 0) code.put("widgetActiveMins", context.getAssets().open("fossil_hr/widgetActiveMins.bin")); if (includeWidget("widgetChanceOfRain") > 0) code.put("widgetChanceOfRain", context.getAssets().open("fossil_hr/widgetChanceOfRain.bin")); if (includeWidget("widgetUV") > 0) code.put("widgetUV", context.getAssets().open("fossil_hr/widgetUV.bin")); + if (includeWidget("widgetSpO2") > 0) code.put("widgetSpO2", context.getAssets().open("fossil_hr/widgetSpO2.bin")); for (int i=0; i 0) icons.put("icCalories", context.getAssets().open("fossil_hr/icCalories.rle")); if (includeWidget("widgetActiveMins") > 0) icons.put("icActiveMins", context.getAssets().open("fossil_hr/icActiveMins.rle")); if (includeWidget("widgetChanceOfRain") > 0) icons.put("icRainChance", context.getAssets().open("fossil_hr/icRainChance.rle")); + if (includeWidget("widgetSpO2") > 0) icons.put("icSpO2", context.getAssets().open("fossil_hr/icSpO2.rle")); if (includeWidget("widgetCustom") > 0) icons.put("widget_bg_error.rle", context.getAssets().open("fossil_hr/widget_bg_error.rle")); // Note: we have to check and invert every used widget background here, // because the watch doesn't invert the background image when the widget color is inverted @@ -356,6 +359,9 @@ public class HybridHRWatchfaceFactory { case "timeZone2SSE": widgetName = "widget2ndTZ"; break; + case "spo2SSE": + widgetName = "widgetSpO2"; + break; } if (widgetName.startsWith("widget2ndTZ")) { widgetName = "widget2ndTZ"; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceWidget.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceWidget.java index 64b71fe11..5b2eb7363 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceWidget.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceWidget.java @@ -78,6 +78,7 @@ public class HybridHRWatchfaceWidget implements Serializable { widgetTypes.put("widgetActiveMins", context.getString(R.string.watchface_widget_type_active_mins)); widgetTypes.put("widgetChanceOfRain", context.getString(R.string.watchface_widget_type_chance_rain)); widgetTypes.put("widgetUV", context.getString(R.string.watchface_widget_type_uv_index)); + widgetTypes.put("widgetSpO2", context.getString(R.string.watchface_widget_type_sp02)); widgetTypes.put("widgetCustom", context.getString(R.string.watchface_widget_type_custom)); return widgetTypes; } 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 52f36f53f..7ce5fd8c5 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.12"; + public static final String HYBRIDHR_WATCHFACE_VERSION = "1.13"; 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/strings.xml b/app/src/main/res/values/strings.xml index 1baf3f147..4423f08e7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2477,6 +2477,7 @@ Active minutes Chance of rain UV index + SpO2 Power saving Disable display updates while off wrist Disable hands movement while off wrist diff --git a/external/build_fossil_hr_gbapps.sh b/external/build_fossil_hr_gbapps.sh index 82a341c4e..78346c7c8 100755 --- a/external/build_fossil_hr_gbapps.sh +++ b/external/build_fossil_hr_gbapps.sh @@ -17,6 +17,7 @@ $jerry generate -f '' widget_2nd_tz.js -o widget2ndTZ.bin $jerry generate -f '' widget_activemins.js -o widgetActiveMins.bin $jerry generate -f '' widget_chanceofrain.js -o widgetChanceOfRain.bin $jerry generate -f '' widget_uv.js -o widgetUV.bin +$jerry generate -f '' widget_spo2.js -o widgetSpO2.bin $jerry generate -f '' widget_custom.js -o widgetCustom.bin popd mv fossil-hr-gbapps/watchface/*.bin ../app/src/main/assets/fossil_hr/ diff --git a/external/fossil-hr-gbapps b/external/fossil-hr-gbapps index 465320a71..0734e0edd 160000 --- a/external/fossil-hr-gbapps +++ b/external/fossil-hr-gbapps @@ -1 +1 @@ -Subproject commit 465320a7160affaaaaa2137b4047a3e12bea1830 +Subproject commit 0734e0edd59242e2e5a7a5eaf265fef8c01d930d