Compose Unstyled 2.0 is out! Check the official announcement blog ->
Interface

TimePickerState

A state object that can be hoisted to observe the time picker state.

Source set: Common
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.

Properties

minute

Source set: Common
@get:IntRange(from = 0, to = 59) @setparam:IntRange(from = 0, to = 59) 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.

hour

Source set: Common
@get:IntRange(from = 0, to = 23) @setparam:IntRange(from = 0, to = 23) 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

Source set: Common
@get:IntRange(from = 0)
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.

minuteInput

Source set: Common
@get:IntRange(from = 0)
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.

is24hour

Source set: Common
var is24hour: Boolean

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

selection

Source set: Common
var selection: TimePickerSelectionMode

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

Last updated: