net.simonvt.calendarview
Class CalendarView

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by android.widget.FrameLayout
              extended by net.simonvt.calendarview.CalendarView
All Implemented Interfaces:
android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, android.view.ViewManager, android.view.ViewParent

public class CalendarView
extends android.widget.FrameLayout

This class is a calendar widget for displaying and selecting dates. The range of dates supported by this calendar is configurable. A user can select a date by taping on it and can scroll and fling the calendar to a desired date.


Nested Class Summary
static interface CalendarView.OnDateChangeListener
          The callback used to indicate the user changes the date.
 
Nested classes/interfaces inherited from class android.widget.FrameLayout
android.widget.FrameLayout.LayoutParams
 
Nested classes/interfaces inherited from class android.view.ViewGroup
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
 
Nested classes/interfaces inherited from class android.view.View
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
 
Field Summary
 
Fields inherited from class android.view.ViewGroup
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
 
Fields inherited from class android.view.View
ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_RESOLVED_DEFAULT, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y
 
Constructor Summary
CalendarView(android.content.Context context)
           
CalendarView(android.content.Context context, android.util.AttributeSet attrs)
           
CalendarView(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
           
 
Method Summary
 long getDate()
          Gets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.
 int getDateTextAppearance()
          Gets the text appearance for the calendar dates.
 int getFirstDayOfWeek()
          Gets the first day of week.
 int getFocusedMonthDateColor()
          Gets the color for the dates in the focused month.
 long getMaxDate()
          Gets the maximal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.
 long getMinDate()
          Gets the minimal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.
 android.graphics.drawable.Drawable getSelectedDateVerticalBar()
          Gets the drawable for the vertical bar shown at the beginning and at the end of the selected date.
 int getSelectedWeekBackgroundColor()
          Gets the background color for the selected week.
 int getShownWeekCount()
          Gets the number of weeks to be shown.
 boolean getShowWeekNumber()
          Gets whether to show the week number.
 int getUnfocusedMonthDateColor()
          Gets the color for the dates in a not focused month.
 int getWeekDayTextAppearance()
          Gets the text appearance for the week day abbreviation of the calendar header.
 int getWeekNumberColor()
          Gets the color for the week numbers.
 int getWeekSeparatorLineColor()
          Gets the color for the separator line between weeks.
 boolean isEnabled()
           
protected  void onConfigurationChanged(android.content.res.Configuration newConfig)
           
 void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
           
 void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)
           
 void setDate(long date)
          Sets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.
 void setDate(long date, boolean animate, boolean center)
          Sets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.
 void setDateTextAppearance(int resourceId)
          Sets the text appearance for the calendar dates.
 void setEnabled(boolean enabled)
           
 void setFirstDayOfWeek(int firstDayOfWeek)
          Sets the first day of week.
 void setFocusedMonthDateColor(int color)
          Sets the color for the dates of the focused month.
 void setMaxDate(long maxDate)
          Sets the maximal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.
 void setMinDate(long minDate)
          Sets the minimal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.
 void setOnDateChangeListener(CalendarView.OnDateChangeListener listener)
          Sets the listener to be notified upon selected date change.
 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.
 void setSelectedDateVerticalBar(int resourceId)
          Sets the drawable for the vertical bar shown at the beginning and at the end of the selected date.
 void setSelectedWeekBackgroundColor(int color)
          Sets the background color for the selected week.
 void setShownWeekCount(int count)
          Sets the number of weeks to be shown.
 void setShowWeekNumber(boolean showWeekNumber)
          Sets whether to show the week number.
 void setUnfocusedMonthDateColor(int color)
          Sets the color for the dates of a not focused month.
 void setWeekDayTextAppearance(int resourceId)
          Sets the text appearance for the week day abbreviation of the calendar header.
 void setWeekNumberColor(int color)
          Sets the color for the week numbers.
 void setWeekSeparatorLineColor(int color)
          Sets the color for the separator line between weeks.
 
Methods inherited from class android.widget.FrameLayout
checkLayoutParams, draw, drawableStateChanged, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getConsiderGoneChildrenWhenMeasuring, getForeground, getForegroundGravity, getMeasureAllChildren, jumpDrawablesToCurrentState, onLayout, onMeasure, onSizeChanged, setForeground, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState, verifyDrawable
 
Methods inherited from class android.view.ViewGroup
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawChild, endViewTransition, findFocus, findViewsWithText, fitSystemWindows, focusableViewAvailable, focusSearch, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutTransition, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, layout, measureChild, measureChildren, measureChildWithMargins, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onCreateDrawableState, onInterceptHoverEvent, onInterceptTouchEvent, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, setStaticTransformationsEnabled, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
 
Methods inherited from class android.view.View
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, findViewById, findViewWithTag, focusSearch, forceLayout, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasOnClickListeners, hasOverlappingRendering, hasTransientState, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAttachedToWindow, onCheckIsTextEditor, onCreateContextMenu, onCreateInputConnection, onDetachedFromWindow, onDisplayHint, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.view.ViewParent
createContextMenu, getParent, getParentForAccessibility, isLayoutRequested, requestFitSystemWindows, requestLayout
 

Constructor Detail

CalendarView

public CalendarView(android.content.Context context)

CalendarView

public CalendarView(android.content.Context context,
                    android.util.AttributeSet attrs)

CalendarView

public CalendarView(android.content.Context context,
                    android.util.AttributeSet attrs,
                    int defStyle)
Method Detail

setShownWeekCount

public void setShownWeekCount(int count)
Sets the number of weeks to be shown.

Parameters:
count - The shown week count.

getShownWeekCount

public int getShownWeekCount()
Gets the number of weeks to be shown.

Returns:
The shown week count.

setSelectedWeekBackgroundColor

public void setSelectedWeekBackgroundColor(int color)
Sets the background color for the selected week.

Parameters:
color - The week background color.

getSelectedWeekBackgroundColor

public int getSelectedWeekBackgroundColor()
Gets the background color for the selected week.

Returns:
The week background color.

setFocusedMonthDateColor

public void setFocusedMonthDateColor(int color)
Sets the color for the dates of the focused month.

Parameters:
color - The focused month date color.

getFocusedMonthDateColor

public int getFocusedMonthDateColor()
Gets the color for the dates in the focused month.

Returns:
The focused month date color.

setUnfocusedMonthDateColor

public void setUnfocusedMonthDateColor(int color)
Sets the color for the dates of a not focused month.

Parameters:
color - A not focused month date color.

getUnfocusedMonthDateColor

public int getUnfocusedMonthDateColor()
Gets the color for the dates in a not focused month.

Returns:
A not focused month date color.

setWeekNumberColor

public void setWeekNumberColor(int color)
Sets the color for the week numbers.

Parameters:
color - The week number color.

getWeekNumberColor

public int getWeekNumberColor()
Gets the color for the week numbers.

Returns:
The week number color.

setWeekSeparatorLineColor

public void setWeekSeparatorLineColor(int color)
Sets the color for the separator line between weeks.

Parameters:
color - The week separator color.

getWeekSeparatorLineColor

public int getWeekSeparatorLineColor()
Gets the color for the separator line between weeks.

Returns:
The week separator color.

setSelectedDateVerticalBar

public void setSelectedDateVerticalBar(int resourceId)
Sets the drawable for the vertical bar shown at the beginning and at the end of the selected date.

Parameters:
resourceId - The vertical bar drawable resource id.

setSelectedDateVerticalBar

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.

Parameters:
drawable - The vertical bar drawable.

getSelectedDateVerticalBar

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.

Returns:
The vertical bar drawable.

setWeekDayTextAppearance

public void setWeekDayTextAppearance(int resourceId)
Sets the text appearance for the week day abbreviation of the calendar header.

Parameters:
resourceId - The text appearance resource id.

getWeekDayTextAppearance

public int getWeekDayTextAppearance()
Gets the text appearance for the week day abbreviation of the calendar header.

Returns:
The text appearance resource id.

setDateTextAppearance

public void setDateTextAppearance(int resourceId)
Sets the text appearance for the calendar dates.

Parameters:
resourceId - The text appearance resource id.

getDateTextAppearance

public int getDateTextAppearance()
Gets the text appearance for the calendar dates.

Returns:
The text appearance resource id.

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class android.view.View

isEnabled

public boolean isEnabled()
Overrides:
isEnabled in class android.view.View

onConfigurationChanged

protected void onConfigurationChanged(android.content.res.Configuration newConfig)
Overrides:
onConfigurationChanged in class android.view.View

onInitializeAccessibilityEvent

public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
Overrides:
onInitializeAccessibilityEvent in class android.widget.FrameLayout

onInitializeAccessibilityNodeInfo

public void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo info)
Overrides:
onInitializeAccessibilityNodeInfo in class android.widget.FrameLayout

getMinDate

public long getMinDate()
Gets the minimal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.

Note: The default minimal date is 01/01/1900.

Returns:
The minimal supported date.

setMinDate

public void setMinDate(long minDate)
Sets the minimal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.

Parameters:
minDate - The minimal supported date.

getMaxDate

public long getMaxDate()
Gets the maximal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.

Note: The default maximal date is 01/01/2100.

Returns:
The maximal supported date.

setMaxDate

public void setMaxDate(long maxDate)
Sets the maximal date supported by this CalendarView in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.

Parameters:
maxDate - The maximal supported date.

setShowWeekNumber

public void setShowWeekNumber(boolean showWeekNumber)
Sets whether to show the week number.

Parameters:
showWeekNumber - True to show the week number.

getShowWeekNumber

public boolean getShowWeekNumber()
Gets whether to show the week number.

Returns:
True if showing the week number.

getFirstDayOfWeek

public int getFirstDayOfWeek()
Gets the first day of week.

Returns:
The first day of the week conforming to the CalendarView APIs.
See Also:
Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY, Calendar.FRIDAY, Calendar.SATURDAY, Calendar.SUNDAY

setFirstDayOfWeek

public void setFirstDayOfWeek(int firstDayOfWeek)
Sets the first day of week.

Parameters:
firstDayOfWeek - The first day of the week conforming to the CalendarView APIs.
See Also:
Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY, Calendar.FRIDAY, Calendar.SATURDAY, Calendar.SUNDAY

setOnDateChangeListener

public void setOnDateChangeListener(CalendarView.OnDateChangeListener listener)
Sets the listener to be notified upon selected date change.

Parameters:
listener - The listener to be notified.

getDate

public long getDate()
Gets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.

Returns:
The selected date.

setDate

public void setDate(long date)
Sets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.

Parameters:
date - The selected date.
Throws:
IllegalArgumentException - of the provided date is before the minimal or after the maximal date.
See Also:
setDate(long, boolean, boolean), setMinDate(long), setMaxDate(long)

setDate

public void setDate(long date,
                    boolean animate,
                    boolean center)
Sets the selected date in milliseconds since January 1, 1970 00:00:00 in TimeZone.getDefault() time zone.

Parameters:
date - The date.
animate - Whether to animate the scroll to the current date.
center - Whether to center the current date even if it is already visible.
Throws:
IllegalArgumentException - of the provided date is before the minimal or after the maximal date.
See Also:
setMinDate(long), setMaxDate(long)


Copyright © 2012-2013. All Rights Reserved.