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 (true) or 12-hour format with AM/PM (false).

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

true if the current hourInput represents a valid hour (0-23).

Cmn
Boolean

true if the time input values are valid.

Cmn
Boolean

true if the current minuteInput represents a valid minute (0-59).

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 hourInt

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 hourInputInt

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 is24hourBoolean

Indicates whether the time picker uses 24-hour format (true) or 12-hour format with AM/PM (false).

minute

var minuteInt

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 minuteInputInt

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 selectionTimePickerSelectionMode

Specifies whether the hour or minute component is being actively selected by the user.

Extension properties

TimePickerState.isHourInputValid

val TimePickerState.isHourInputValidBoolean

true if the current hourInput represents a valid hour (0-23).

TimePickerState.isInputValid

val TimePickerState.isInputValidBoolean

true if the time input values are valid.

TimePickerState.isMinuteInputValid

val TimePickerState.isMinuteInputValidBoolean

true if the current minuteInput represents a valid minute (0-59).

TimePickerState.isPm

val TimePickerState.isPmBoolean

Indicates whether the selected time falls within the period from 12 PM inclusive to 12 AM non inclusive.