hey guys, what i'm doing wrong (code in thread)
# compose
f
hey guys, what i'm doing wrong (code in thread)
Copy code
Dialog(
    onDismissRequest = {}, properties =
    DialogProperties(dismissOnBackPress = false,
        dismissOnClickOutside = false)
) {
    Column(
        horizontalAlignment = Alignment.CenterHorizontally,
        modifier = Modifier
            .background(MaterialTheme.colors.background, shape = Shapes.medium)
    ) {
        Text(
            text = stringResource(id = R.string.copying_file),
            modifier = Modifier
                .align(Alignment.CenterHorizontally)
                .padding(16.dp)
        )
        LinearProgressIndicator(
            progress = progress,
            modifier = Modifier
                .align(Alignment.CenterHorizontally)
                .padding(horizontal = 16.dp, vertical = 8.dp)
        )
        Text(
            text = "%${progress.toInt()}",
            modifier = Modifier
                .align(Alignment.CenterHorizontally)
                .padding(horizontal = 16.dp)
                .padding(top = 8.dp, bottom = 16.dp)
        )
    }
}
I don't want the
Copy code
LinearProgressIndicator
to go outside the frame box 😕
c
progress
should be between 0 and 1
I notice the docs say "Values outside of this range are coerced into the range", but that doesn't appear to be happening
c
What's wrong with it? 😂
c
You shouldn't be using a value greater than 1. The docs for LinearProgressIndicator.progress indicate that it treats anything > 1 as 100% anyway, but the LinearProgressIndicator code doesn't actually look like it does that, which is why your line goes past 100%. So you have a bug, and perhaps LinearProgressIndicator has a bug 🙂
âž• 1