diff --git a/app/src/main/assets/fossil_hr/widgetDate_preview.png b/app/src/main/assets/fossil_hr/widgetDate_preview.png new file mode 100644 index 000000000..26b7a8f1e Binary files /dev/null and b/app/src/main/assets/fossil_hr/widgetDate_preview.png differ diff --git a/app/src/main/assets/fossil_hr/widgetWeather_preview.png b/app/src/main/assets/fossil_hr/widgetWeather_preview.png new file mode 100644 index 000000000..65edd54c8 Binary files /dev/null and b/app/src/main/assets/fossil_hr/widgetWeather_preview.png differ diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java index da396868c..ebb7360ad 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/HybridHRWatchfaceDesignerActivity.java @@ -293,8 +293,8 @@ public class HybridHRWatchfaceDesignerActivity extends AbstractGBActivity implem widgetPaint.setColor(Color.RED); widgetPaint.setStyle(Paint.Style.STROKE); widgetPaint.setStrokeWidth(5); - Bitmap widgetBitmap = Bitmap.createBitmap((int)(widgetSize * scaleFactor), (int)(widgetSize * scaleFactor), Bitmap.Config.ARGB_8888); - Canvas widgetCanvas = new Canvas(widgetBitmap); + Bitmap widgetNoPreviewBitmap = Bitmap.createBitmap((int)(widgetSize * scaleFactor), (int)(widgetSize * scaleFactor), Bitmap.Config.ARGB_8888); + Canvas widgetCanvas = new Canvas(widgetNoPreviewBitmap); widgetCanvas.drawRect(0, 0, widgetSize * scaleFactor, widgetSize * scaleFactor, widgetPaint); for (int i=0; i. */ package nodomain.freeyourgadget.gadgetbridge.devices.qhybrid; +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; + +import java.io.IOException; + public class HybridHRWatchfaceWidget { private String widgetType; private int posX; @@ -31,6 +37,10 @@ public class HybridHRWatchfaceWidget { return widgetType; } + public Bitmap getPreviewImage(Context context) throws IOException { + return BitmapFactory.decodeStream(context.getAssets().open("fossil_hr/" + widgetType + "_preview.png")); + } + public int getPosX() { return posX; }