From f2078c902d34836453a33972991005cdeb67b77f Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Mon, 24 Aug 2026 22:48:59 +0200 Subject: [PATCH] Draw Android determinate progress bars without M3 stop dot and gap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Material3 1.7's LinearProgressIndicator draws an expressive stop indicator dot at the track's end plus a gap between the progress tip and the track. On the thin bars this element renders they read as stray dots at both edges — a near-empty bar shows exactly two dots and nothing else. iOS's ProgressView draws a plain continuous bar; match it. Indeterminate bars keep the animated M3 style. --- resources/android/ProgressBarRenderer.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/android/ProgressBarRenderer.kt b/resources/android/ProgressBarRenderer.kt index 75045c0..35a9034 100644 --- a/resources/android/ProgressBarRenderer.kt +++ b/resources/android/ProgressBarRenderer.kt @@ -5,6 +5,7 @@ import androidx.compose.material3.LinearProgressIndicator import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics import com.nativephp.mobile.ui.nativerender.NativeUINode @@ -38,11 +39,19 @@ object ProgressBarRenderer { trackColor = track, ) } else { + // Determinate bars drop M3 1.7's expressive extras — the stop + // indicator dot at the track's end and the gap between progress + // tip and track. On the thin bars this element renders they read + // as stray dots at both edges (a near-empty bar shows exactly + // two dots and nothing else), and the iOS renderer's ProgressView + // draws a plain continuous bar — parity wins. LinearProgressIndicator( progress = { p.getFloat("value").coerceIn(0f, 1f) }, modifier = barModifier, color = tint, trackColor = track, + gapSize = 0.dp, + drawStopIndicator = {}, ) } }