You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to manually change the time on a button click, for instance:
Column(
horizontalAlignment =Alignment.CenterHorizontally,
verticalArrangement =Arrangement.Center
) {
var changeableTime:LocalTime by remember {
mutableStateOf(LocalTime.now())
}
WheelTimePicker(
startTime = changeableTime,
timeFormat =TimeFormat.HOUR_24,
size =DpSize(200.dp, 100.dp),
rowCount =5,
textStyle =MaterialTheme.typography.titleSmall,
textColor =Color(0xFFffc300),
selectorProperties =WheelPickerDefaults.selectorProperties(
enabled =true,
shape =RoundedCornerShape(0.dp),
color =Color(0xFFf1faee).copy(alpha =0.2f),
border =BorderStroke(2.dp, Color(0xFFf1faee))
)
){ snappedDateTime ->// Do something with snapped time
}
Button(onClick = {
changeableTime =LocalTime.now()
}) {
Text(text ="Set time to now")
}
}
Unfortunately the WheelTimePicker does not get recomposed when startTime is mutable and changed.
Should this work using the library or is this out of scope?
The text was updated successfully, but these errors were encountered:
I would like to manually change the time on a button click, for instance:
Unfortunately the
WheelTimePicker
does not get recomposed whenstartTime
is mutable and changed.Should this work using the library or is this out of scope?
The text was updated successfully, but these errors were encountered: