1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 01:55:50 +01:00

added custom widget apps to gadgetbridge

This commit is contained in:
Daniel Dakhno 2021-11-11 02:50:29 +01:00 committed by Arjan Schrijver
parent bc60b66abf
commit cd183eb953
8 changed files with 20 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -71,6 +71,10 @@ public class HybridHRWatchfaceFactory {
case "widgetCalories":
case "widgetActiveMins":
case "widgetChanceOfRain":
case "widgetCustom0":
case "widgetCustom1":
case "widgetCustom2":
case "widgetCustom3":
widget.put("type", "comp");
widget.put("name", widgetDesc.getWidgetType());
widget.put("goal_ring", false);
@ -143,6 +147,10 @@ public class HybridHRWatchfaceFactory {
if (includeWidget("widgetActiveMins")) code.put("widgetActiveMins", context.getAssets().open("fossil_hr/widgetActiveMins.bin"));
if (includeWidget("widgetChanceOfRain")) code.put("widgetChanceOfRain", context.getAssets().open("fossil_hr/widgetChanceOfRain.bin"));
if (includeWidget("widget2ndTZ")) code.put("widget2ndTZ", context.getAssets().open("fossil_hr/widget2ndTZ.bin"));
if (includeWidget("widgetCustom0")) code.put("widgetCustom0", context.getAssets().open("fossil_hr/widgetCustom0.bin"));
if (includeWidget("widgetCustom1")) code.put("widgetCustom1", context.getAssets().open("fossil_hr/widgetCustom1.bin"));
if (includeWidget("widgetCustom2")) code.put("widgetCustom2", context.getAssets().open("fossil_hr/widgetCustom2.bin"));
if (includeWidget("widgetCustom3")) code.put("widgetCustom3", context.getAssets().open("fossil_hr/widgetCustom3.bin"));
} catch (IOException e) {
LOG.warn("Unable to read asset file", e);
}

View File

@ -59,6 +59,10 @@ public class HybridHRWatchfaceWidget {
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("widgetCustom0", context.getString(R.string.watchface_widget_type_custom_0));
widgetTypes.put("widgetCustom1", context.getString(R.string.watchface_widget_type_custom_1));
widgetTypes.put("widgetCustom2", context.getString(R.string.watchface_widget_type_custom_2));
widgetTypes.put("widgetCustom3", context.getString(R.string.watchface_widget_type_custom_3));
// widgetTypes.put("widgetChanceOfRain", context.getString(R.string.watchface_widget_type_chance_rain)); // Disabled due to missing support in Gadgetbridge
return widgetTypes;
}

View File

@ -1376,5 +1376,9 @@
<string name="sony_automatic_power_off_30_min">30 minutes</string>
<string name="sony_automatic_power_off_1_hour">1 hour</string>
<string name="sony_automatic_power_off_3_hour">3 hours</string>
<string name="watchface_widget_type_custom_0">Custom widget 0</string>
<string name="watchface_widget_type_custom_1">Custom widget 1</string>
<string name="watchface_widget_type_custom_2">Custom widget 2</string>
<string name="watchface_widget_type_custom_3">Custom widget 3</string>
</resources>

View File

@ -14,5 +14,9 @@ $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
$jerry generate -f '' widget_custom.js -o widgetCustom0.bin
cp widgetCustom0.bin widgetCustom1.bin
cp widgetCustom0.bin widgetCustom2.bin
cp widgetCustom0.bin widgetCustom3.bin
popd
mv fossil-hr-watchface/*.bin ../app/src/main/assets/fossil_hr/