MaterialTimePicker.Builder

public final class MaterialTimePicker.Builder


Used to create MaterialTimePicker instances.

Summary

Public constructors

Public methods

MaterialTimePicker

Creates a MaterialTimePicker with the provided options.

MaterialTimePicker.Builder
setHour(int hour)

Sets the hour with which to start the time picker.

MaterialTimePicker.Builder

Sets the input mode with which to start the time picker.

MaterialTimePicker.Builder
setMinute(int minute)

Sets the minute with which to start the time picker.

MaterialTimePicker.Builder
setNegativeButtonText(CharSequence negativeButtonText)

Sets the text used in the negative action button.

MaterialTimePicker.Builder
setNegativeButtonText(int negativeButtonTextResId)

Sets the text used in the negative action button.

MaterialTimePicker.Builder
setPositiveButtonText(CharSequence positiveButtonText)

Sets the text used in the positive action button.

MaterialTimePicker.Builder
setPositiveButtonText(int positiveButtonTextResId)

Sets the text used in the positive action button.

MaterialTimePicker.Builder
setTheme(int themeResId)

Sets the theme for the time picker.

MaterialTimePicker.Builder

Sets the time format for the time picker.

MaterialTimePicker.Builder
setTitleText(CharSequence charSequence)

Sets the text used to guide the user at the top of the picker.

MaterialTimePicker.Builder
setTitleText(int titleTextResId)

Sets the text used to guide the user at the top of the picker.

Public constructors

Builder

public Builder()

Public methods

build

public MaterialTimePicker build()

Creates a MaterialTimePicker with the provided options.

setHour

public MaterialTimePicker.Builder setHour(int hour)

Sets the hour with which to start the time picker.

Parameters
int hour

The hour value is independent of the time format (setTimeFormat), and should always be a number in the [0, 23] range.

setInputMode

public MaterialTimePicker.Builder setInputMode(@MaterialTimePicker.InputMode int inputMode)

Sets the input mode with which to start the time picker.

setMinute

public MaterialTimePicker.Builder setMinute(int minute)

Sets the minute with which to start the time picker.

setNegativeButtonText

public MaterialTimePicker.Builder setNegativeButtonText(CharSequence negativeButtonText)

Sets the text used in the negative action button.

setNegativeButtonText

public MaterialTimePicker.Builder setNegativeButtonText(int negativeButtonTextResId)

Sets the text used in the negative action button.

setPositiveButtonText

public MaterialTimePicker.Builder setPositiveButtonText(CharSequence positiveButtonText)

Sets the text used in the positive action button.

setPositiveButtonText

public MaterialTimePicker.Builder setPositiveButtonText(int positiveButtonTextResId)

Sets the text used in the positive action button.

setTheme

public MaterialTimePicker.Builder setTheme(int themeResId)

Sets the theme for the time picker.

setTimeFormat

public MaterialTimePicker.Builder setTimeFormat(@TimeFormat int format)

Sets the time format for the time picker.

Parameters
@TimeFormat int format

Either CLOCK_12H 12 hour format with an AM/PM toggle or CLOCK_24 24 hour format without toggle.

setTitleText

public MaterialTimePicker.Builder setTitleText(CharSequence charSequence)

Sets the text used to guide the user at the top of the picker.

setTitleText

public MaterialTimePicker.Builder setTitleText(int titleTextResId)

Sets the text used to guide the user at the top of the picker.