Constructors Summary |
---|
public CalendarView(android.content.Context context)
this(context, null);
|
public CalendarView(android.content.Context context, android.util.AttributeSet attrs)
this(context, attrs, R.attr.calendarViewStyle);
|
public CalendarView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)
this(context, attrs, defStyleAttr, 0);
|
public CalendarView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)
super(context, attrs, defStyleAttr, defStyleRes);
final TypedArray a = context.obtainStyledAttributes(
attrs, R.styleable.CalendarView, defStyleAttr, defStyleRes);
final int mode = a.getInt(R.styleable.CalendarView_calendarViewMode, MODE_HOLO);
a.recycle();
switch (mode) {
case MODE_HOLO:
mDelegate = new CalendarViewLegacyDelegate(
this, context, attrs, defStyleAttr, defStyleRes);
break;
case MODE_MATERIAL:
mDelegate = new CalendarViewMaterialDelegate(
this, context, attrs, defStyleAttr, defStyleRes);
break;
default:
throw new IllegalArgumentException("invalid calendarViewMode attribute");
}
|
Methods Summary |
---|
public long | getDate()Gets the selected date in milliseconds since January 1, 1970 00:00:00 in
{@link TimeZone#getDefault()} time zone.
return mDelegate.getDate();
|
public int | getDateTextAppearance()Gets the text appearance for the calendar dates.
return mDelegate.getDateTextAppearance();
|
public int | getFirstDayOfWeek()Gets the first day of week.
return mDelegate.getFirstDayOfWeek();
|
public int | getFocusedMonthDateColor()Gets the color for the dates in the focused month.
return mDelegate.getFocusedMonthDateColor();
|
public long | getMaxDate()Gets the maximal date supported by this {@link CalendarView} in milliseconds
since January 1, 1970 00:00:00 in {@link TimeZone#getDefault()} time
zone.
Note: The default maximal date is 01/01/2100.
return mDelegate.getMaxDate();
|
public long | getMinDate()Gets the minimal date supported by this {@link CalendarView} in milliseconds
since January 1, 1970 00:00:00 in {@link TimeZone#getDefault()} time
zone.
Note: The default minimal date is 01/01/1900.
return mDelegate.getMinDate();
|
public android.graphics.drawable.Drawable | getSelectedDateVerticalBar()Gets the drawable for the vertical bar shown at the beginning and at
the end of the selected date.
return mDelegate.getSelectedDateVerticalBar();
|
public int | getSelectedWeekBackgroundColor()Gets the background color for the selected week.
return mDelegate.getSelectedWeekBackgroundColor();
|
public boolean | getShowWeekNumber()Gets whether to show the week number.
return mDelegate.getShowWeekNumber();
|
public int | getShownWeekCount()Gets the number of weeks to be shown.
return mDelegate.getShownWeekCount();
|
public int | getUnfocusedMonthDateColor()Gets the color for the dates in a not focused month.
return mDelegate.getUnfocusedMonthDateColor();
|
public int | getWeekDayTextAppearance()Gets the text appearance for the week day abbreviation of the calendar header.
return mDelegate.getWeekDayTextAppearance();
|
public int | getWeekNumberColor()Gets the color for the week numbers.
return mDelegate.getWeekNumberColor();
|
public int | getWeekSeparatorLineColor()Gets the color for the separator line between weeks.
return mDelegate.getWeekSeparatorLineColor();
|
protected void | onConfigurationChanged(android.content.res.Configuration newConfig)
super.onConfigurationChanged(newConfig);
mDelegate.onConfigurationChanged(newConfig);
|
public void | onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
event.setClassName(CalendarView.class.getName());
|
public void | onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)
info.setClassName(CalendarView.class.getName());
|
public void | setDate(long date)Sets the selected date in milliseconds since January 1, 1970 00:00:00 in
{@link TimeZone#getDefault()} time zone.
mDelegate.setDate(date);
|
public void | setDate(long date, boolean animate, boolean center)Sets the selected date in milliseconds since January 1, 1970 00:00:00 in
{@link TimeZone#getDefault()} time zone.
mDelegate.setDate(date, animate, center);
|
public void | setDateTextAppearance(int resourceId)Sets the text appearance for the calendar dates.
mDelegate.setDateTextAppearance(resourceId);
|
public void | setFirstDayOfWeek(int firstDayOfWeek)Sets the first day of week.
mDelegate.setFirstDayOfWeek(firstDayOfWeek);
|
public void | setFocusedMonthDateColor(int color)Sets the color for the dates of the focused month.
mDelegate.setFocusedMonthDateColor(color);
|
public void | setMaxDate(long maxDate)Sets the maximal date supported by this {@link CalendarView} in milliseconds
since January 1, 1970 00:00:00 in {@link TimeZone#getDefault()} time
zone.
mDelegate.setMaxDate(maxDate);
|
public void | setMinDate(long minDate)Sets the minimal date supported by this {@link CalendarView} in milliseconds
since January 1, 1970 00:00:00 in {@link TimeZone#getDefault()} time
zone.
mDelegate.setMinDate(minDate);
|
public void | setOnDateChangeListener(android.widget.CalendarView$OnDateChangeListener listener)Sets the listener to be notified upon selected date change.
mDelegate.setOnDateChangeListener(listener);
|
public void | setSelectedDateVerticalBar(int resourceId)Sets the drawable for the vertical bar shown at the beginning and at
the end of the selected date.
mDelegate.setSelectedDateVerticalBar(resourceId);
|
public void | setSelectedDateVerticalBar(android.graphics.drawable.Drawable drawable)Sets the drawable for the vertical bar shown at the beginning and at
the end of the selected date.
mDelegate.setSelectedDateVerticalBar(drawable);
|
public void | setSelectedWeekBackgroundColor(int color)Sets the background color for the selected week.
mDelegate.setSelectedWeekBackgroundColor(color);
|
public void | setShowWeekNumber(boolean showWeekNumber)Sets whether to show the week number.
mDelegate.setShowWeekNumber(showWeekNumber);
|
public void | setShownWeekCount(int count)Sets the number of weeks to be shown.
mDelegate.setShownWeekCount(count);
|
public void | setUnfocusedMonthDateColor(int color)Sets the color for the dates of a not focused month.
mDelegate.setUnfocusedMonthDateColor(color);
|
public void | setWeekDayTextAppearance(int resourceId)Sets the text appearance for the week day abbreviation of the calendar header.
mDelegate.setWeekDayTextAppearance(resourceId);
|
public void | setWeekNumberColor(int color)Sets the color for the week numbers.
mDelegate.setWeekNumberColor(color);
|
public void | setWeekSeparatorLineColor(int color)Sets the color for the separator line between weeks.
mDelegate.setWeekSeparatorLineColor(color);
|