TimePicker
Composable Component
A full screen TimePicker with configurable columns that allows users to select a time.
Android
@RequiresApi(Build.VERSION_CODES.O)
@Composable
public fun TimePicker(
initialTime: LocalTime,
onTimePicked: (LocalTime) -> Unit,
modifier: Modifier = Modifier,
timePickerType: TimePickerType = TimePickerDefaults.timePickerType,
colors: TimePickerColors = TimePickerDefaults.timePickerColors(),
)
Parameters
initialTime | The initial time to be displayed in the TimePicker. |
onTimePicked | The callback that is called when the user confirms the time selection. It provides the selected time as LocalTime . |
modifier | Modifier to be applied to the Box containing the UI elements. |
timePickerType | The different TimePickerType supported by this time picker. It indicates whether to show seconds or AM/PM selector as well as hours and minutes. |
colors | TimePickerColors be applied to the TimePicker. |