TimePickerState
-
Cmn
interface TimePickerState
A state object that can be hoisted to observe the time picker state. It holds the current values and allows for directly setting those values.
| See also | |
|---|---|
rememberTimePickerState |
to construct the default implementation. |
Summary
Public properties |
||
|---|---|---|
Int |
The currently selected hour (0-23). |
Cmn
|
open Int |
The input for the hour. |
Cmn
|
Boolean |
Indicates whether the time picker uses 24-hour format ( |
Cmn
|
Int |
The currently selected minute (0-59). |
Cmn
|
open Int |
The input for the minute. |
Cmn
|
TimePickerSelectionMode |
Specifies whether the hour or minute component is being actively selected by the user. |
Cmn
|
Extension properties |
||
|---|---|---|
Boolean |
|
Cmn
|
Boolean |
|
Cmn
|
Boolean |
|
Cmn
|
Boolean |
Indicates whether the selected time falls within the period from 12 PM inclusive to 12 AM non inclusive. |
Cmn
|
Public properties
hour
var hour: Int
The currently selected hour (0-23).
This value is always valid. hourInput was added later to allow tracking invalid input (e.g. mid-typing in TimeInput) without changing the behavior of this property, which always guarantees a valid value.
hourInput
open var hourInput: Int
The input for the hour.
UI should be bound to this value. This value can be invalid (e.g. during typing). If valid, it updates hour. This property was added to allow tracking mid-typing state in TimeInput without polluting hour with invalid values.
is24hour
var is24hour: Boolean
Indicates whether the time picker uses 24-hour format (true) or 12-hour format with AM/PM (false).
minute
var minute: Int
The currently selected minute (0-59).
This value is always valid. minuteInput was added later to allow tracking invalid input (e.g. mid-typing in TimeInput) without changing the behavior of this property, which always guarantees a valid value.
minuteInput
open var minuteInput: Int
The input for the minute.
UI should be bound to this value. This value can be invalid (e.g. during typing). If valid, it updates minute. This property was added to allow tracking mid-typing state in TimeInput without polluting minute with invalid values.
selection
var selection: TimePickerSelectionMode
Specifies whether the hour or minute component is being actively selected by the user.
Extension properties
TimePickerState.isHourInputValid
val TimePickerState.isHourInputValid: Boolean
true if the current hourInput represents a valid hour (0-23 for 24h, 0-11 for 12h AM, 12-23 for 12h PM).
TimePickerState.isInputValid
val TimePickerState.isInputValid: Boolean
true if the time input values are valid.
TimePickerState.isMinuteInputValid
val TimePickerState.isMinuteInputValid: Boolean
true if the current minuteInput represents a valid minute (0-59).
TimePickerState.isPm
val TimePickerState.isPm: Boolean
Indicates whether the selected time falls within the period from 12 PM inclusive to 12 AM non inclusive.