Skip to content

Commit

Permalink
Disabled the progress slider if indeterminate. (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
EranBoudjnah authored Jan 25, 2024
1 parent 28aba94 commit 1eacd37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ fun ControlPanel(
onValueChange = { progress.value = it },
modifier = Modifier
.width(350.dp)
.align(Alignment.CenterHorizontally)
.align(Alignment.CenterHorizontally),
enabled = progressMode.value != ProgressState.Indeterminate::class
)
MultipleValueSelector(
selectedOption = progressMode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fun SliderWithTitle(
value: Float,
onValueChange: (Float) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
color: Color = MaterialTheme.colorScheme.onSurface
) {
Column(modifier) {
Expand All @@ -28,6 +29,7 @@ fun SliderWithTitle(
)
Slider(
value = value.coerceIn(0f, 1f),
enabled = enabled,
onValueChange = onValueChange
)
}
Expand Down

0 comments on commit 1eacd37

Please sign in to comment.