remember Time Picker State
Creates and remembers a TimePickerState. Initial time values are read when the state is first created.
Return
A TimePickerState initialized with the given time values.
Parameters
The initial hour to be selected. If timeFormat is TimeFormat.HOUR_12, this value is automatically adjusted to the 12-hour format (1-12).
The initial minute to be selected.
The initial period (AM/PM) to be selected. Defaults to the current period based on the current hour.
The time format (12-hour or 24-hour). Defaults to TimeFormat.HOUR_24.
Creates and remembers a TimePickerState from a LocalTime.
When timeFormat is TimeFormat.HOUR_12, the hour is converted to the format-hour range (1-12) and the AM/PM period is derived from initialTime.
Return
A TimePickerState initialized from initialTime.
Parameters
The initial time to be selected.
The time format (12-hour or 24-hour). Defaults to TimeFormat.HOUR_24.
Creates and remembers a TimePickerState whose initial value is coerced by items.
Initial values and items are read when the state is first created. An items-only recomposition does not reset the state. If timeFormat changes, the state is recreated against the latest items. On recreation, the items supplied by the recreated composition also coerce the saved value, so the picker cannot restore outside its current custom lists or time bounds.
Return
A TimePickerState initialized to the closest selectable time.
Parameters
Selectable values used to coerce initialTime before creating the state.
The requested initial time.
The time format (12-hour or 24-hour). Defaults to TimeFormat.HOUR_24.
Throws
if the item lists needed by timeFormat are invalid or contain no time allowed by their constraints.
Creates and remembers a TimePickerState whose explicit initial time parts are coerced by items.
Initial values and items are read when the state is first created. initialHour is interpreted the same way as rememberTimePickerState without items: as an hour-of-day in 0..23, then converted to the active timeFormat. In 12-hour mode, initialPeriod can override the period derived from initialHour. On recreation, the items supplied by the recreated composition also coerce the saved value.
Return
A TimePickerState initialized to the closest selectable time.
Parameters
Selectable values used to coerce initialHour and initialMinute.
The requested initial hour-of-day. Must be in 0..23.
The requested initial minute. Must be in 0..59.
The requested AM/PM period when timeFormat is TimeFormat.HOUR_12.
The time format (12-hour or 24-hour). Defaults to TimeFormat.HOUR_24.
Throws
if initialHour or initialMinute is outside its supported range, or if the item lists needed by timeFormat are invalid or contain no time allowed by their constraints.