1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-23 09:07:44 +01:00

Fossil/Skagen Gen. 6 Hybrids: Add SpO2 watchface widget

This commit is contained in:
Arjan Schrijver 2024-12-01 22:13:33 +01:00
parent 6a68071702
commit 98e9a0dbf0
9 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,4 @@
                        
  
 
                                                      <0C><>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -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<includeWidget("widget2ndTZ"); i++) {
code.put("widget2ndTZ" + i, context.getAssets().open("fossil_hr/widget2ndTZ.bin"));
}
@ -222,6 +224,7 @@ public class HybridHRWatchfaceFactory {
if (includeWidget("widgetCalories") > 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";

View File

@ -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;
}

View File

@ -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<String, String> KNOWN_WAPP_VERSIONS = new HashMap<String, String>() {

View File

@ -2477,6 +2477,7 @@
<string name="watchface_widget_type_active_mins">Active minutes</string>
<string name="watchface_widget_type_chance_rain">Chance of rain</string>
<string name="watchface_widget_type_uv_index">UV index</string>
<string name="watchface_widget_type_sp02">SpO2</string>
<string name="watchface_setting_title_power_saving">Power saving</string>
<string name="watchface_setting_power_saving_display">Disable display updates while off wrist</string>
<string name="watchface_setting_power_saving_hands">Disable hands movement while off wrist</string>

View File

@ -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/

@ -1 +1 @@
Subproject commit 465320a7160affaaaaa2137b4047a3e12bea1830
Subproject commit 0734e0edd59242e2e5a7a5eaf265fef8c01d930d