Skip to content

Commit

Permalink
Round stepper value (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
kul3r4 authored Dec 20, 2023
1 parent 60f2b19 commit d306b81
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.wear.compose.material.Text
import com.google.android.horologist.compose.material.Stepper
import kotlin.math.round

@Composable
internal fun SampleStepperScreen() {
Expand All @@ -31,7 +32,7 @@ internal fun SampleStepperScreen() {
}
Stepper(
value = value,
onValueChange = { value = it },
onValueChange = { value = round(it) },
valueRange = 0f..100f,
steps = 9,
) {
Expand Down

0 comments on commit d306b81

Please sign in to comment.