JengaTimePickerDialog

fun JengaTimePickerDialog(onDismissRequest: () -> Unit, onConfirm: (LocalTime) -> Unit, title: String, confirmLabel: String, dismissLabel: String, initialTime: LocalTime, hourLabel: String, minuteLabel: String, amLabel: String, pmLabel: String, modifier: Modifier = Modifier, style: JengaTimeInputStyle = JengaTimeInputStyle.Wheel, is24Hour: Boolean = false, minuteStep: Int = 1)(source)

A dialog holding a JengaTimeInput, with dismiss and confirm actions. The time is only reported when the confirm action is tapped.

Parameters

onDismissRequest

called when the dialog is dismissed (dismiss action, scrim tap or back).

onConfirm

called with the picked time when the confirm action is tapped.

title

the dialog title (e.g. "Delivery time").

confirmLabel

the confirm action label.

dismissLabel

the dismiss action label.

initialTime

the time shown when the dialog opens.

hourLabel

the label for the hour wheel or field.

minuteLabel

the label for the minute wheel or field.

amLabel

the label for the morning half.

pmLabel

the label for the afternoon half.

modifier

the Modifier for the dialog surface.

style

wheels or typed fields; see JengaTimeInputStyle.

is24Hour

whether hours run 0 to 23 with no AM / PM choice.

minuteStep

the gap between minutes on the minute wheel.

Samples

var open by remember {
    mutableStateOf(
        value = true,
    )
}
if (open) {
    JengaTimePickerDialog(
        onDismissRequest = { open = false },
        onConfirm = { open = false },
        title = "Delivery time",
        confirmLabel = "OK",
        dismissLabel = "Cancel",
        initialTime = LocalTime(
            hour = 14,
            minute = 0,
        ),
        hourLabel = "Hour",
        minuteLabel = "Minute",
        amLabel = "AM",
        pmLabel = "PM",
    )
}