mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-24 16:21:16 +02:00
Fossil Hybrid HR: Add 2nd TZ, Active Minutes and Chance Of Rain widgets
This commit is contained in:
parent
478053288f
commit
9f2759a43c
3
app/src/main/assets/fossil_hr/icActiveMins.rle
Normal file
3
app/src/main/assets/fossil_hr/icActiveMins.rle
Normal file
@ -0,0 +1,3 @@
|
||||
!)
|
||||
|
||||
8<0C><>
|
1
app/src/main/assets/fossil_hr/icRainChance.rle
Normal file
1
app/src/main/assets/fossil_hr/icRainChance.rle
Normal file
@ -0,0 +1 @@
|
||||
S
R<0C><>
|
BIN
app/src/main/assets/fossil_hr/widget2ndTZ.bin
Normal file
BIN
app/src/main/assets/fossil_hr/widget2ndTZ.bin
Normal file
Binary file not shown.
BIN
app/src/main/assets/fossil_hr/widget2ndTZ_preview.png
Normal file
BIN
app/src/main/assets/fossil_hr/widget2ndTZ_preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/assets/fossil_hr/widgetActiveMins.bin
Normal file
BIN
app/src/main/assets/fossil_hr/widgetActiveMins.bin
Normal file
Binary file not shown.
BIN
app/src/main/assets/fossil_hr/widgetActiveMins_preview.png
Normal file
BIN
app/src/main/assets/fossil_hr/widgetActiveMins_preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/assets/fossil_hr/widgetChanceOfRain.bin
Normal file
BIN
app/src/main/assets/fossil_hr/widgetChanceOfRain.bin
Normal file
Binary file not shown.
BIN
app/src/main/assets/fossil_hr/widgetChanceOfRain_preview.png
Normal file
BIN
app/src/main/assets/fossil_hr/widgetChanceOfRain_preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
@ -347,6 +347,15 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem
|
||||
case "caloriesSSE":
|
||||
widgetName = "widgetCalories";
|
||||
break;
|
||||
case "activeMinutesSSE":
|
||||
widgetName = "widgetActiveMins";
|
||||
break;
|
||||
case "chanceOfRainSSE":
|
||||
widgetName = "widgetChanceOfRain";
|
||||
break;
|
||||
case "timeZone2SSE":
|
||||
widgetName = "widget2ndTZ";
|
||||
break;
|
||||
}
|
||||
int widgetColor = layoutItem.getString("color").equals("white") ? HybridHRWatchfaceWidget.COLOR_WHITE : HybridHRWatchfaceWidget.COLOR_BLACK;
|
||||
widgets.add(new HybridHRWatchfaceWidget(widgetName,
|
||||
|
@ -63,35 +63,14 @@ public class HybridHRWatchfaceFactory {
|
||||
try {
|
||||
switch (widgetDesc.getWidgetType()) {
|
||||
case "widgetDate":
|
||||
widget.put("type", "comp");
|
||||
widget.put("name", widgetDesc.getWidgetType());
|
||||
widget.put("goal_ring", false);
|
||||
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
|
||||
widget.put("bg", "_00.rle");
|
||||
break;
|
||||
case "widgetWeather":
|
||||
widget.put("type", "comp");
|
||||
widget.put("name", widgetDesc.getWidgetType());
|
||||
widget.put("goal_ring", false);
|
||||
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
|
||||
widget.put("bg", "_01.rle");
|
||||
break;
|
||||
case "widgetSteps":
|
||||
widget.put("type", "comp");
|
||||
widget.put("name", widgetDesc.getWidgetType());
|
||||
widget.put("goal_ring", false);
|
||||
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
|
||||
widget.put("bg", "_02.rle");
|
||||
break;
|
||||
case "widgetHR":
|
||||
widget.put("type", "comp");
|
||||
widget.put("name", widgetDesc.getWidgetType());
|
||||
widget.put("goal_ring", false);
|
||||
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
|
||||
widget.put("bg", "_03.rle");
|
||||
break;
|
||||
case "widgetBattery":
|
||||
case "widgetCalories":
|
||||
case "widgetActiveMins":
|
||||
case "widgetChanceOfRain":
|
||||
case "widget2ndTZ":
|
||||
widget.put("type", "comp");
|
||||
widget.put("name", widgetDesc.getWidgetType());
|
||||
widget.put("goal_ring", false);
|
||||
@ -133,6 +112,9 @@ public class HybridHRWatchfaceFactory {
|
||||
code.put("widgetHR", context.getAssets().open("fossil_hr/widgetHR.bin"));
|
||||
code.put("widgetBattery", context.getAssets().open("fossil_hr/widgetBattery.bin"));
|
||||
code.put("widgetCalories", context.getAssets().open("fossil_hr/widgetCalories.bin"));
|
||||
code.put("widgetActiveMins", context.getAssets().open("fossil_hr/widgetActiveMins.bin"));
|
||||
code.put("widgetChanceOfRain", context.getAssets().open("fossil_hr/widgetChanceOfRain.bin"));
|
||||
code.put("widget2ndTZ", context.getAssets().open("fossil_hr/widget2ndTZ.bin"));
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Unable to read asset file", e);
|
||||
}
|
||||
@ -155,6 +137,8 @@ public class HybridHRWatchfaceFactory {
|
||||
icons.put("icBattEmpty", context.getAssets().open("fossil_hr/icBattEmpty.rle"));
|
||||
icons.put("icBattery", context.getAssets().open("fossil_hr/icBattery.rle"));
|
||||
icons.put("icCalories", context.getAssets().open("fossil_hr/icCalories.rle"));
|
||||
icons.put("icActiveMins", context.getAssets().open("fossil_hr/icActiveMins.rle"));
|
||||
icons.put("icRainChance", context.getAssets().open("fossil_hr/icRainChance.rle"));
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Unable to read asset file", e);
|
||||
}
|
||||
|
@ -51,6 +51,9 @@ public class HybridHRWatchfaceWidget {
|
||||
widgetTypes.put("widgetHR", context.getString(R.string.watchface_widget_type_heart_rate));
|
||||
widgetTypes.put("widgetBattery", context.getString(R.string.watchface_widget_type_battery));
|
||||
widgetTypes.put("widgetCalories", context.getString(R.string.watchface_widget_type_calories));
|
||||
widgetTypes.put("widget2ndTZ", context.getString(R.string.watchface_widget_type_2nd_tz));
|
||||
widgetTypes.put("widgetActiveMins", context.getString(R.string.watchface_widget_type_active_mins));
|
||||
// widgetTypes.put("widgetChanceOfRain", context.getString(R.string.watchface_widget_type_chance_rain)); // Disabled due to missing support in Gadgetbridge
|
||||
return widgetTypes;
|
||||
}
|
||||
|
||||
|
@ -1248,4 +1248,7 @@
|
||||
<string name="watchface_upload_failed">Upload of the watchface failed. Please try again.</string>
|
||||
<string name="watchface_widget_type_battery">Battery</string>
|
||||
<string name="watchface_widget_type_calories">Calories</string>
|
||||
<string name="watchface_widget_type_2nd_tz">2nd time zone</string>
|
||||
<string name="watchface_widget_type_active_mins">Active minutes</string>
|
||||
<string name="watchface_widget_type_chance_rain">Chance of rain</string>
|
||||
</resources>
|
||||
|
5
external/build_fossil_hr_watchface.sh
vendored
5
external/build_fossil_hr_watchface.sh
vendored
@ -9,5 +9,10 @@ $jerry generate -f '' widget_date.js -o widgetDate.bin
|
||||
$jerry generate -f '' widget_weather.js -o widgetWeather.bin
|
||||
$jerry generate -f '' widget_steps.js -o widgetSteps.bin
|
||||
$jerry generate -f '' widget_hr.js -o widgetHR.bin
|
||||
$jerry generate -f '' widget_battery.js -o widgetBattery.bin
|
||||
$jerry generate -f '' widget_calories.js -o widgetCalories.bin
|
||||
$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
|
||||
popd
|
||||
mv fossil-hr-watchface/*.bin ../app/src/main/assets/fossil_hr/
|
||||
|
2
external/fossil-hr-watchface
vendored
2
external/fossil-hr-watchface
vendored
@ -1 +1 @@
|
||||
Subproject commit 71374ce959655a56e71ddf70c626f9feba399a89
|
||||
Subproject commit 01bd1424dc4c492ab25f3e2824be2aa8bf5b5256
|
Loading…
Reference in New Issue
Block a user