mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-24 00:27:33 +01:00
Fossil Hybrid HR: Rename widget color definitions
This commit is contained in:
parent
dcf869b988
commit
c91403fce3
@ -299,7 +299,7 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem
|
||||
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,
|
||||
layoutItem.getJSONObject("pos").getInt("x"),
|
||||
layoutItem.getJSONObject("pos").getInt("y"),
|
||||
|
@ -66,28 +66,28 @@ public class HybridHRWatchfaceFactory {
|
||||
widget.put("type", "comp");
|
||||
widget.put("name", widgetDesc.getWidgetType());
|
||||
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");
|
||||
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_ON_BLACK ? "white" : "black");
|
||||
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_ON_BLACK ? "white" : "black");
|
||||
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_ON_BLACK ? "white" : "black");
|
||||
widget.put("color", widgetDesc.getColor() == HybridHRWatchfaceWidget.COLOR_WHITE ? "white" : "black");
|
||||
widget.put("bg", "_03.rle");
|
||||
break;
|
||||
default:
|
||||
|
@ -33,8 +33,8 @@ public class HybridHRWatchfaceWidget {
|
||||
private int posY;
|
||||
private int color = 0;
|
||||
|
||||
public static int COLOR_WHITE_ON_BLACK = 0;
|
||||
public static int COLOR_BLACK_ON_WHITE = 1;
|
||||
public static int COLOR_WHITE = 0;
|
||||
public static int COLOR_BLACK = 1;
|
||||
|
||||
public HybridHRWatchfaceWidget(String widgetType, int posX, int posY, int color) {
|
||||
this.widgetType = widgetType;
|
||||
@ -58,7 +58,7 @@ public class HybridHRWatchfaceWidget {
|
||||
|
||||
public Bitmap getPreviewImage(Context context) throws IOException {
|
||||
Bitmap preview = BitmapFactory.decodeStream(context.getAssets().open("fossil_hr/" + widgetType + "_preview.png"));
|
||||
if (color == COLOR_WHITE_ON_BLACK) {
|
||||
if (color == COLOR_WHITE) {
|
||||
return preview;
|
||||
} else {
|
||||
return invertBitmapColors(preview);
|
||||
|
Loading…
x
Reference in New Issue
Block a user