MaterialTimePicker.Builder

public static final class MaterialTimePicker.Builder
extends Object

java.lang.Object
   ↳ com.google.android.material.timepicker.MaterialTimePicker.Builder


Used to create MaterialTimePicker instances.

Summary

Public constructors

Builder()

Public methods

MaterialTimePicker build()

Creates a MaterialTimePicker with the provided options.

MaterialTimePicker.Builder setHour(int hour)

Sets the hour with which to start the time picker.

MaterialTimePicker.Builder setInputMode(int inputMode)

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(int negativeButtonTextResId)

Sets the text used in the negative action button.

MaterialTimePicker.Builder setNegativeButtonText(CharSequence negativeButtonText)

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 setTimeFormat(int format)

Sets the time format for the time picker.

MaterialTimePicker.Builder setTitleText(int titleTextResId)

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

MaterialTimePicker.Builder setTitleText(CharSequence charSequence)

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

Inherited methods

Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait(long arg0, int arg1)
final void wait(long arg0)
final void wait()

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
hour int: The hour value is independent of the time format (setTimeFormat(int)), and should always be a number in the [0, 23] range.

setInputMode

public MaterialTimePicker.Builder setInputMode (int inputMode)

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

Parameters
inputMode int

setMinute

public MaterialTimePicker.Builder setMinute (int minute)

Sets the minute with which to start the time picker.

Parameters
minute int

setNegativeButtonText

public MaterialTimePicker.Builder setNegativeButtonText (int negativeButtonTextResId)

Sets the text used in the negative action button.

Parameters
negativeButtonTextResId int

setNegativeButtonText

public MaterialTimePicker.Builder setNegativeButtonText (CharSequence negativeButtonText)

Sets the text used in the negative action button.

Parameters
negativeButtonText CharSequence

setPositiveButtonText

public MaterialTimePicker.Builder setPositiveButtonText (CharSequence positiveButtonText)

Sets the text used in the positive action button.

Parameters
positiveButtonText CharSequence

setPositiveButtonText

public MaterialTimePicker.Builder setPositiveButtonText (int positiveButtonTextResId)

Sets the text used in the positive action button.

Parameters
positiveButtonTextResId int

setTheme

public MaterialTimePicker.Builder setTheme (int themeResId)

Sets the theme for the time picker.

Parameters
themeResId int

setTimeFormat

public MaterialTimePicker.Builder setTimeFormat (int format)

Sets the time format for the time picker.

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

setTitleText

public MaterialTimePicker.Builder setTitleText (int titleTextResId)

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

Parameters
titleTextResId int

setTitleText

public MaterialTimePicker.Builder setTitleText (CharSequence charSequence)

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

Parameters
charSequence CharSequence