SeslTimePicker

A widget for selecting a time of day, in either 24-hour or AM/PM mode.

For a dialog using SeslTimePicker, see android.app.TimePickerDialog.

The view is a FrameLayout that contains a SeslTimePickerSpinnerDelegate. The delegate is responsible for rendering and handling the user interaction with the time picker.

The time picker supports two modes: spinner and clock. The spinner mode allows the user to select the time by scrolling through the hour and minute pickers. The clock mode allows the user to select the time by tapping on the clock face.

The time picker also supports 24-hour and 12-hour (AM/PM) formats. The format can be set using the setIs24HourView method.

The time picker can be configured to display the time in 5-minute intervals using the set5MinuteInterval method.

The time picker can be enabled or disabled using the setEnabled method.

The time picker provides two listeners for handling time changes: OnTimeChangedListener and OnEditTextModeChangedListener. The OnTimeChangedListener is called when the user changes the time. The OnEditTextModeChangedListener is called when the user switches between spinner and edit text mode.

The time picker can be customized by setting the text size and typeface of the number pickers using the setNumberPickerTextSize and setNumberPickerTextTypeface methods.

The time picker supports saving and restoring its state using the onSaveInstanceState and onRestoreInstanceState methods.

The time picker supports accessibility by providing a delegate for handling accessibility events.

Constructors

Link copied to clipboard
constructor(@NonNull context: Context)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int)

Types

Link copied to clipboard

Properties

Link copied to clipboard
val PICKER_AMPM: Int = 2
Link copied to clipboard
Link copied to clipboard
val PICKER_HOUR: Int = 0
Link copied to clipboard

Functions

Link copied to clipboard
open fun getBaseline(): Int
Link copied to clipboard
open fun getEditText(picker: Int): EditText
Link copied to clipboard
open fun getHour(): Int
Link copied to clipboard
open fun getMinute(): Int
Link copied to clipboard
Link copied to clipboard
open fun is24HourView(): Boolean
Link copied to clipboard
Link copied to clipboard
open fun isEnabled(): Boolean
Link copied to clipboard
open fun requestLayout()
Link copied to clipboard
open fun set5MinuteInterval(interval: Boolean)
Link copied to clipboard
open fun setEditTextMode(editTextMode: Boolean)
Link copied to clipboard
open fun setEnabled(enabled: Boolean)
Link copied to clipboard
open fun setHour(@IntRange(from = 0, to = 23) hour: Int)
Link copied to clipboard
open fun setIs24HourView(@NonNull is24HourView: Boolean)
Link copied to clipboard
open fun setLocale(locale: Locale)
Link copied to clipboard
open fun setMinute(@IntRange(from = 0, to = 59) minute: Int)
Link copied to clipboard
open fun setNumberPickerTextSize(picker: Int, size: Float)
Link copied to clipboard
open fun setNumberPickerTextTypeface(picker: Int, typeface: Typeface)
Link copied to clipboard
Link copied to clipboard
open fun showMarginLeft(@NonNull show: Boolean)
Link copied to clipboard
open fun startAnimation(delayTime: Int, listener: SeslAnimationListener)