fix(rings): make widget rings fill available space + higher render res
Build APK / build (pull_request) Successful in 1m42s

Rings were capped at a fixed 86dp; now each gauge fills its half of the widget
(weighted ImageView) so they grow with the placed widget size. Bumped RingRenderer
default bitmap to 360px/36 stroke to stay crisp at the larger display size.
This commit is contained in:
2026-06-12 08:02:11 +00:00
parent 952c8261e9
commit 10cc064f1f
2 changed files with 16 additions and 13 deletions
@@ -40,8 +40,8 @@ object RingRenderer {
markerColor: Int?,
centerText: String,
labelText: String? = null,
sizePx: Int = 240,
strokePx: Float = 24f
sizePx: Int = 360,
strokePx: Float = 36f
): Bitmap {
val bmp = Bitmap.createBitmap(sizePx, sizePx, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bmp)
+14 -11
View File
@@ -65,7 +65,8 @@
android:layout_marginBottom="6dp"
android:background="#2A2A2A" />
<!-- Two ring gauges side by side -->
<!-- Two ring gauges side by side — each fills its half so the ring grows as large as the
placed widget allows (limited by the available height), instead of a fixed 86dp. -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
@@ -76,24 +77,25 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/ring_session"
android:layout_width="86dp"
android:layout_height="86dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="fitCenter"
android:adjustViewBounds="false"
android:contentDescription="Session usage ring" />
<TextView
android:id="@+id/tv_session_label"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginTop="2dp"
android:gravity="center"
android:text=""
android:textColor="#999999"
@@ -104,24 +106,25 @@
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/ring_weekly"
android:layout_width="86dp"
android:layout_height="86dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="fitCenter"
android:adjustViewBounds="false"
android:contentDescription="Weekly usage ring" />
<TextView
android:id="@+id/tv_weekly_label"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginTop="2dp"
android:gravity="center"
android:text=""
android:textColor="#999999"