android: fix progress bar gap

androidx.compose.material3 1.3.0 added a gap between the active and inactive track and a stop indicator at the end. Here, we add a negative gap to compensate for the rounded cap occupying extra space past the end of the progress, and use an empty function to hide the indicator.

Fixes tailscale/corp#35495
Signed-off-by: kari-ts <kari@tailscale.com>
pull/726/head
kari-ts 3 weeks ago
parent d0442f75da
commit 6b0d2bdc8b

@ -126,10 +126,15 @@ fun SimpleActivityIndicator(size: Int = 32) {
@Composable
fun ActivityIndicator(progress: Double, size: Int = 32) {
// LinearProgressIndicator defaults to a 4.dp height in Material3.
val height = 4.dp
LinearProgressIndicator(
progress = progress.toFloat(),
progress = {progress.toFloat()},
modifier = Modifier.width(size.dp),
color = ts_color_light_blue,
trackColor = MaterialTheme.colorScheme.secondary,
gapSize = -height,
drawStopIndicator = {}
)
}

Loading…
Cancel
Save