public class CalendarPickerView
extends RecyclerView
| Modifier and Type | Class and Description |
|---|---|
static interface |
CalendarPickerView.CellClickInterceptor
Interface to be notified when a cell is clicked and possibly intercept the click.
|
static interface |
CalendarPickerView.DateSelectableFilter
Interface used for determining the selectability of a date cell when it is configured for
display on the calendar.
|
class |
CalendarPickerView.FluentInitializer |
static interface |
CalendarPickerView.OnDateSelectedListener
Interface to be notified when a new date is selected or unselected.
|
static interface |
CalendarPickerView.OnInvalidDateSelectedListener
Interface to be notified when an invalid date is selected by the user.
|
static class |
CalendarPickerView.SelectionMode |
| Constructor and Description |
|---|
CalendarPickerView(android.content.Context context,
android.util.AttributeSet attrs) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearHighlightedDates() |
void |
clearSelectedDates() |
void |
deactivateDates(java.util.ArrayList<java.lang.Integer> deactivatedDates) |
void |
fixDialogDimens()
This method should only be called if the calendar is contained in a dialog, and it should only
be called once, right after the dialog is shown (using
DialogInterface.OnShowListener or
DialogFragment.onStart()). |
java.util.List<CalendarCellDecorator> |
getDecorators() |
java.util.Date |
getSelectedDate() |
java.util.List<java.util.Date> |
getSelectedDates() |
void |
highlightDates(java.util.Collection<java.util.Date> dates) |
CalendarPickerView.FluentInitializer |
init(java.util.Date minDate,
java.util.Date maxDate) |
CalendarPickerView.FluentInitializer |
init(java.util.Date minDate,
java.util.Date maxDate,
java.text.DateFormat monthNameFormat) |
CalendarPickerView.FluentInitializer |
init(java.util.Date minDate,
java.util.Date maxDate,
java.util.Locale locale) |
CalendarPickerView.FluentInitializer |
init(java.util.Date minDate,
java.util.Date maxDate,
java.util.TimeZone timeZone) |
CalendarPickerView.FluentInitializer |
init(java.util.Date minDate,
java.util.Date maxDate,
java.util.TimeZone timeZone,
java.util.Locale locale,
java.text.DateFormat monthNameFormat)
Both date parameters must be non-null and their
Date.getTime() must not return 0. |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
boolean |
scrollToDate(java.util.Date date) |
boolean |
selectDate(java.util.Date date) |
boolean |
selectDate(java.util.Date date,
boolean smoothScroll) |
void |
setCellClickInterceptor(CalendarPickerView.CellClickInterceptor listener)
Set a listener to intercept clicks on calendar cells.
|
void |
setCustomDayView(DayViewAdapter dayViewAdapter)
Set an adapter used to initialize
CalendarCellView with custom layout. |
void |
setDateSelectableFilter(CalendarPickerView.DateSelectableFilter listener)
Set a listener used to discriminate between selectable and unselectable dates.
|
void |
setDateTypeface(android.graphics.Typeface dateTypeface)
Sets the typeface to be used within the date grid.
|
void |
setDecorators(java.util.List<CalendarCellDecorator> decorators) |
void |
setOnDateSelectedListener(CalendarPickerView.OnDateSelectedListener listener) |
void |
setOnInvalidDateSelectedListener(CalendarPickerView.OnInvalidDateSelectedListener listener)
Set a listener to react to user selection of a disabled date.
|
void |
setTitleTypeface(android.graphics.Typeface titleTypeface)
Set the typeface to be used for month titles.
|
void |
setTypeface(android.graphics.Typeface typeface)
Sets the typeface to be used for all text within this calendar.
|
void |
unfixDialogDimens()
This method should only be called if the calendar is contained in a dialog, and it should only
be called when the screen has been rotated and the dialog should be re-measured.
|
public CalendarPickerView(android.content.Context context,
android.util.AttributeSet attrs)
public void setDecorators(java.util.List<CalendarCellDecorator> decorators)
public java.util.List<CalendarCellDecorator> getDecorators()
public CalendarPickerView.FluentInitializer init(java.util.Date minDate, java.util.Date maxDate, java.util.TimeZone timeZone, java.util.Locale locale, java.text.DateFormat monthNameFormat)
Date.getTime() must not return 0. Time
of day will be ignored. For instance, if you pass in minDate as 11/16/2012 5:15pm and
maxDate as 11/16/2013 4:30am, 11/16/2012 will be the first selectable date and
11/15/2013 will be the last selectable date (maxDate is exclusive).
This will implicitly set the CalendarPickerView.SelectionMode to CalendarPickerView.SelectionMode.SINGLE. If you
want a different selection mode, use FluentInitializer#inMode(SelectionMode) on the
CalendarPickerView.FluentInitializer this method returns.
The calendar will be constructed using the given time zone and the given locale. This means that all dates will be in given time zone, all names (months, days) will be in the language of the locale and the weeks start with the day specified by the locale.
minDate - Earliest selectable date, inclusive. Must be earlier than maxDate.maxDate - Latest selectable date, exclusive. Must be later than minDate.public CalendarPickerView.FluentInitializer init(java.util.Date minDate, java.util.Date maxDate)
public CalendarPickerView.FluentInitializer init(java.util.Date minDate, java.util.Date maxDate, java.util.TimeZone timeZone)
public CalendarPickerView.FluentInitializer init(java.util.Date minDate, java.util.Date maxDate, java.text.DateFormat monthNameFormat)
public CalendarPickerView.FluentInitializer init(java.util.Date minDate, java.util.Date maxDate, java.util.Locale locale)
public boolean scrollToDate(java.util.Date date)
public void fixDialogDimens()
DialogInterface.OnShowListener or
DialogFragment.onStart()).public void setTitleTypeface(android.graphics.Typeface titleTypeface)
public void setDateTypeface(android.graphics.Typeface dateTypeface)
public void setTypeface(android.graphics.Typeface typeface)
public void unfixDialogDimens()
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
public java.util.Date getSelectedDate()
public java.util.List<java.util.Date> getSelectedDates()
public boolean selectDate(java.util.Date date)
public boolean selectDate(java.util.Date date,
boolean smoothScroll)
public void highlightDates(java.util.Collection<java.util.Date> dates)
public void deactivateDates(java.util.ArrayList<java.lang.Integer> deactivatedDates)
public void clearSelectedDates()
public void clearHighlightedDates()
public void setOnDateSelectedListener(CalendarPickerView.OnDateSelectedListener listener)
public void setOnInvalidDateSelectedListener(CalendarPickerView.OnInvalidDateSelectedListener listener)
listener - the listener to set, or null for no reactionpublic void setDateSelectableFilter(CalendarPickerView.DateSelectableFilter listener)
Important: set this before you call init(Date, Date) methods. If called afterwards,
it will not be consistently applied.
public void setCustomDayView(DayViewAdapter dayViewAdapter)
CalendarCellView with custom layout.
Important: set this before you call init(Date, Date) methods. If called afterwards,
it will not be consistently applied.
public void setCellClickInterceptor(CalendarPickerView.CellClickInterceptor listener)