1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 20:36:51 +01:00

Fossil Hybrid HR: Add steps and HR widgets

This commit is contained in:
Arjan Schrijver 2021-07-15 14:15:09 +02:00 committed by Gitea
parent 6743af98e9
commit d4c69ebca3
10 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,2 @@
L                         
               ; <0C><>

View File

@ -0,0 +1,5 @@
5              
     
  
 
            6 <0C><>

View File

@ -0,0 +1 @@
2                                                        8 <0C><>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -237,6 +237,13 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem
case "weatherSSE": case "weatherSSE":
widgetName = "widgetWeather"; widgetName = "widgetWeather";
break; break;
case "stepsSSE":
widgetName = "widgetSteps";
break;
case "hrSSE":
widgetName = "widgetHR";
break;
} }
widgets.add(new HybridHRWatchfaceWidget(widgetName, widgets.add(new HybridHRWatchfaceWidget(widgetName,
layoutItem.getJSONObject("pos").getInt("x"), layoutItem.getJSONObject("pos").getInt("x"),

View File

@ -71,6 +71,20 @@ public class HybridHRWatchfaceFactory {
widget.put("color", "white"); widget.put("color", "white");
widget.put("bg", "_01.rle"); widget.put("bg", "_01.rle");
break; 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: default:
LOG.warn("Invalid widget name: " + widgetDesc.getWidgetType()); LOG.warn("Invalid widget name: " + widgetDesc.getWidgetType());
return; return;
@ -103,6 +117,8 @@ public class HybridHRWatchfaceFactory {
code.put(watchfaceName, context.getAssets().open("fossil_hr/openSourceWatchface.bin")); code.put(watchfaceName, context.getAssets().open("fossil_hr/openSourceWatchface.bin"));
code.put("widgetDate", context.getAssets().open("fossil_hr/widgetDate.bin")); code.put("widgetDate", context.getAssets().open("fossil_hr/widgetDate.bin"));
code.put("widgetWeather", context.getAssets().open("fossil_hr/widgetWeather.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) { } catch (IOException e) {
LOG.warn("Unable to read asset file", 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("icWthSnowy", context.getAssets().open("fossil_hr/icWthSnowy.rle"));
icons.put("icWthStormy", context.getAssets().open("fossil_hr/icWthStormy.rle")); icons.put("icWthStormy", context.getAssets().open("fossil_hr/icWthStormy.rle"));
icons.put("icWthWindy", context.getAssets().open("fossil_hr/icWthWindy.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) { } catch (IOException e) {
LOG.warn("Unable to read asset file", e); LOG.warn("Unable to read asset file", e);
} }

View File

@ -38,6 +38,8 @@ public class HybridHRWatchfaceWidget {
LinkedHashMap<String, String> widgetTypes = new LinkedHashMap<>(); LinkedHashMap<String, String> widgetTypes = new LinkedHashMap<>();
widgetTypes.put("widgetDate", "Date"); widgetTypes.put("widgetDate", "Date");
widgetTypes.put("widgetWeather", "Weather"); widgetTypes.put("widgetWeather", "Weather");
widgetTypes.put("widgetSteps", "Steps");
widgetTypes.put("widgetHR", "Heart rate");
return widgetTypes; return widgetTypes;
} }