AlertDialog
In Wear Material 3 Compose

@Composable
fun PickerGroupSample() {
var selectedPickerIndex by remember { mutableIntStateOf(0) }
val pickerStateHour = rememberPickerState(initialNumberOfOptions = 24)
val pickerStateMinute = rememberPickerState(initialNumberOfOptions = 60)
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
Spacer(modifier = Modifier.size(30.dp))
val label = if (selectedPickerIndex == 0) "Hours" else "Minutes"
AnimatedContent(targetState = label) { targetText -> Text(text = targetText) }
Spacer(modifier = Modifier.size(10.dp))
PickerGroup(
selectedPickerState =
if (selectedPickerIndex == 0) pickerStateHour else pickerStateMinute,
autoCenter = false,
) {
PickerGroupItem(
pickerState = pickerStateHour,
selected = selectedPickerIndex == 0,
onSelected = { selectedPickerIndex = 0 },
option = { optionIndex, _ -> Text(text = "%02d".format(optionIndex)) },
contentDescription = { "Hours" },
modifier = Modifier.size(80.dp, 100.dp),
)
PickerGroupItem(
pickerState = pickerStateMinute,
selected = selectedPickerIndex == 1,
onSelected = { selectedPickerIndex = 1 },
option = { optionIndex, _ -> Text(text = "%02d".format(optionIndex)) },
contentDescription = { "Minutes" },
modifier = Modifier.size(80.dp, 100.dp),
)
}
}
}