MaterialDatePicker.Builder

public static final class MaterialDatePicker.Builder
extends Object

java.lang.Object
   ↳ com.google.android.material.datepicker.MaterialDatePicker.Builder<S>


Used to create MaterialDatePicker instances with default and overridden settings

Summary

Public methods

MaterialDatePicker<S> build()

Creates a MaterialDatePicker with the provided options.

static Builder<Long> datePicker()

Used to create a Builder that allows for choosing a single date in the MaterialDatePicker.

static Builder<Pair<Long, Long>> dateRangePicker()

Used to create a Builder that allows for choosing a date range in the MaterialDatePicker.

Builder<S> setCalendarConstraints(CalendarConstraints bounds)

Sets the first, last, and starting ERROR(/Month).

Builder<S> setSelection(S selection)
Builder<S> setTheme(int themeResId)

Sets the theme controlling fullscreen mode as well as other styles.

Builder<S> setTitleText(int titleTextResId)

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

Builder<S> setTitleText(CharSequence charSequence)

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

Inherited methods

From class java.lang.Object

Public methods

build

MaterialDatePicker<S> build ()

Creates a MaterialDatePicker with the provided options.

Returns
MaterialDatePicker<S>

datePicker

Builder<Long> datePicker ()

Used to create a Builder that allows for choosing a single date in the MaterialDatePicker.

Returns
Builder<Long>

dateRangePicker

Builder<Pair<Long, Long>> dateRangePicker ()

Used to create a Builder that allows for choosing a date range in the MaterialDatePicker.

Returns
Builder<Pair<Long, Long>>

setCalendarConstraints

Builder<S> setCalendarConstraints (CalendarConstraints bounds)

Sets the first, last, and starting ERROR(/Month).

Parameters
bounds CalendarConstraints

Returns
Builder<S>

setSelection

Builder<S> setSelection (S selection)

Parameters
selection S

Returns
Builder<S>

setTheme

Builder<S> setTheme (int themeResId)

Sets the theme controlling fullscreen mode as well as other styles.

Parameters
themeResId int

Returns
Builder<S>

setTitleText

Builder<S> setTitleText (int titleTextResId)

Sets the text used to guide the user at the top of the picker. Defaults to a standard title based upon the type of selection.

Parameters
titleTextResId int

Returns
Builder<S>

setTitleText

Builder<S> setTitleText (CharSequence charSequence)

Sets the text used to guide the user at the top of the picker. Setting to null will use a default title based upon the type of selection.

Parameters
charSequence CharSequence

Returns
Builder<S>