1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2025-02-03 05:27:44 +01:00

Fossil Hybrid HR: Rename widget color definitions

This commit is contained in:
Arjan Schrijver 2021-07-22 13:07:09 +02:00
parent dcf869b988
commit c91403fce3
3 changed files with 8 additions and 8 deletions

View File

@ -299,7 +299,7 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem
break; break;
} }
int widgetColor = layoutItem.getString("color").equals("white") ? HybridHRWatchfaceWidget.COLOR_WHITE_ON_BLACK : HybridHRWatchfaceWidget.COLOR_BLACK_ON_WHITE; int widgetColor = layoutItem.getString("color").equals("white") ? HybridHRWatchfaceWidget.COLOR_WHITE : HybridHRWatchfaceWidget.COLOR_BLACK;
widgets.add(new HybridHRWatchfaceWidget(widgetName, widgets.add(new HybridHRWatchfaceWidget(widgetName,
layoutItem.getJSONObject("pos").getInt("x"), layoutItem.getJSONObject("pos").getInt("x"),
layoutItem.getJSONObject("pos").getInt("y"), layoutItem.getJSONObject("pos").getInt("y"),

View File

@ -66,28 +66,28 @@ public class HybridHRWatchfaceFactory {
widget.put("type", "comp"); widget.put("type", "comp");
widget.put("name", widgetDesc.getWidgetType()); widget.put("name", widgetDesc.getWidgetType());
widget.put("goal_ring", false); widget.put("goal_ring", false);
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE_ON_BLACK ? "white" : "black"); widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
widget.put("bg", "_00.rle"); widget.put("bg", "_00.rle");
break; break;
case "widgetWeather": case "widgetWeather":
widget.put("type", "comp"); widget.put("type", "comp");
widget.put("name", widgetDesc.getWidgetType()); widget.put("name", widgetDesc.getWidgetType());
widget.put("goal_ring", false); widget.put("goal_ring", false);
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE_ON_BLACK ? "white" : "black"); widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
widget.put("bg", "_01.rle"); widget.put("bg", "_01.rle");
break; break;
case "widgetSteps": case "widgetSteps":
widget.put("type", "comp"); widget.put("type", "comp");
widget.put("name", widgetDesc.getWidgetType()); widget.put("name", widgetDesc.getWidgetType());
widget.put("goal_ring", false); widget.put("goal_ring", false);
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE_ON_BLACK ? "white" : "black"); widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
widget.put("bg", "_02.rle"); widget.put("bg", "_02.rle");
break; break;
case "widgetHR": case "widgetHR":
widget.put("type", "comp"); widget.put("type", "comp");
widget.put("name", widgetDesc.getWidgetType()); widget.put("name", widgetDesc.getWidgetType());
widget.put("goal_ring", false); widget.put("goal_ring", false);
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE_ON_BLACK ? "white" : "black"); widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
widget.put("bg", "_03.rle"); widget.put("bg", "_03.rle");
break; break;
default: default:

View File

@ -33,8 +33,8 @@ public class HybridHRWatchfaceWidget {
private int posY; private int posY;
private int color = 0; private int color = 0;
public static int COLOR_WHITE_ON_BLACK = 0; public static int COLOR_WHITE = 0;
public static int COLOR_BLACK_ON_WHITE = 1; public static int COLOR_BLACK = 1;
public HybridHRWatchfaceWidget(String widgetType, int posX, int posY, int color) { public HybridHRWatchfaceWidget(String widgetType, int posX, int posY, int color) {
this.widgetType = widgetType; this.widgetType = widgetType;
@ -58,7 +58,7 @@ public class HybridHRWatchfaceWidget {
public Bitmap getPreviewImage(Context context) throws IOException { public Bitmap getPreviewImage(Context context) throws IOException {
Bitmap preview = BitmapFactory.decodeStream(context.getAssets().open("fossil_hr/" + widgetType + "_preview.png")); Bitmap preview = BitmapFactory.decodeStream(context.getAssets().open("fossil_hr/" + widgetType + "_preview.png"));
if (color == COLOR_WHITE_ON_BLACK) { if (color == COLOR_WHITE) {
return preview; return preview;
} else { } else {
return invertBitmapColors(preview); return invertBitmapColors(preview);