mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 10:05:49 +01:00
Fossil Hybrid HR: Add steps and HR widgets
This commit is contained in:
parent
6743af98e9
commit
d4c69ebca3
2
app/src/main/assets/fossil_hr/icHeart.rle
Normal file
2
app/src/main/assets/fossil_hr/icHeart.rle
Normal file
@ -0,0 +1,2 @@
|
||||
L
|
||||
;<0C><>
|
5
app/src/main/assets/fossil_hr/icSteps.rle
Normal file
5
app/src/main/assets/fossil_hr/icSteps.rle
Normal file
@ -0,0 +1,5 @@
|
||||
5
|
||||
|
||||
|
||||
|
||||
6<0C><>
|
1
app/src/main/assets/fossil_hr/icTrophy.rle
Normal file
1
app/src/main/assets/fossil_hr/icTrophy.rle
Normal file
@ -0,0 +1 @@
|
||||
2
8<0C><>
|
BIN
app/src/main/assets/fossil_hr/widgetHR.bin
Normal file
BIN
app/src/main/assets/fossil_hr/widgetHR.bin
Normal file
Binary file not shown.
BIN
app/src/main/assets/fossil_hr/widgetHR_preview.png
Normal file
BIN
app/src/main/assets/fossil_hr/widgetHR_preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.1 KiB |
BIN
app/src/main/assets/fossil_hr/widgetSteps.bin
Normal file
BIN
app/src/main/assets/fossil_hr/widgetSteps.bin
Normal file
Binary file not shown.
BIN
app/src/main/assets/fossil_hr/widgetSteps_preview.png
Normal file
BIN
app/src/main/assets/fossil_hr/widgetSteps_preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@ -237,6 +237,13 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem
|
||||
case "weatherSSE":
|
||||
widgetName = "widgetWeather";
|
||||
break;
|
||||
case "stepsSSE":
|
||||
widgetName = "widgetSteps";
|
||||
break;
|
||||
case "hrSSE":
|
||||
widgetName = "widgetHR";
|
||||
break;
|
||||
|
||||
}
|
||||
widgets.add(new HybridHRWatchfaceWidget(widgetName,
|
||||
layoutItem.getJSONObject("pos").getInt("x"),
|
||||
|
@ -71,6 +71,20 @@ public class HybridHRWatchfaceFactory {
|
||||
widget.put("color", "white");
|
||||
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", "white");
|
||||
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", "white");
|
||||
widget.put("bg", "_03.rle");
|
||||
break;
|
||||
default:
|
||||
LOG.warn("Invalid widget name: " + widgetDesc.getWidgetType());
|
||||
return;
|
||||
@ -103,6 +117,8 @@ public class HybridHRWatchfaceFactory {
|
||||
code.put(watchfaceName, context.getAssets().open("fossil_hr/openSourceWatchface.bin"));
|
||||
code.put("widgetDate", context.getAssets().open("fossil_hr/widgetDate.bin"));
|
||||
code.put("widgetWeather", context.getAssets().open("fossil_hr/widgetWeather.bin"));
|
||||
code.put("widgetSteps", context.getAssets().open("fossil_hr/widgetSteps.bin"));
|
||||
code.put("widgetHR", context.getAssets().open("fossil_hr/widgetHR.bin"));
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Unable to read asset file", e);
|
||||
}
|
||||
@ -118,6 +134,9 @@ public class HybridHRWatchfaceFactory {
|
||||
icons.put("icWthSnowy", context.getAssets().open("fossil_hr/icWthSnowy.rle"));
|
||||
icons.put("icWthStormy", context.getAssets().open("fossil_hr/icWthStormy.rle"));
|
||||
icons.put("icWthWindy", context.getAssets().open("fossil_hr/icWthWindy.rle"));
|
||||
icons.put("icSteps", context.getAssets().open("fossil_hr/icSteps.rle"));
|
||||
icons.put("icTrophy", context.getAssets().open("fossil_hr/icTrophy.rle"));
|
||||
icons.put("icHeart", context.getAssets().open("fossil_hr/icHeart.rle"));
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Unable to read asset file", e);
|
||||
}
|
||||
|
@ -38,6 +38,8 @@ public class HybridHRWatchfaceWidget {
|
||||
LinkedHashMap<String, String> widgetTypes = new LinkedHashMap<>();
|
||||
widgetTypes.put("widgetDate", "Date");
|
||||
widgetTypes.put("widgetWeather", "Weather");
|
||||
widgetTypes.put("widgetSteps", "Steps");
|
||||
widgetTypes.put("widgetHR", "Heart rate");
|
||||
return widgetTypes;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user