android: fix progress bar gap (#726)

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/724/merge
kari-ts 5 days ago committed by GitHub
parent d0442f75da
commit 9c5f890358
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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