Fields Summary |
---|
private static final boolean | DEFAULT_SHOW_WEEK_NUMBERDefault value whether to show week number. |
private static final long | MILLIS_IN_DAYThe number of milliseconds in a day.e |
private static final int | DAYS_PER_WEEKThe number of day in a week. |
private static final long | MILLIS_IN_WEEKThe number of milliseconds in a week. |
private static final int | SCROLL_HYST_WEEKSAffects when the month selection will change while scrolling upe |
private static final int | GOTO_SCROLL_DURATIONHow long the GoTo fling animation should last. |
private static final int | ADJUSTMENT_SCROLL_DURATIONThe duration of the adjustment upon a user scroll in milliseconds. |
private static final int | SCROLL_CHANGE_DELAYHow long to wait after receiving an onScrollStateChanged notification
before acting on it. |
private static final int | DEFAULT_SHOWN_WEEK_COUNT |
private static final int | DEFAULT_DATE_TEXT_SIZE |
private static final int | UNSCALED_SELECTED_DATE_VERTICAL_BAR_WIDTH |
private static final int | UNSCALED_WEEK_MIN_VISIBLE_HEIGHT |
private static final int | UNSCALED_LIST_SCROLL_TOP_OFFSET |
private static final int | UNSCALED_BOTTOM_BUFFER |
private static final int | UNSCALED_WEEK_SEPARATOR_LINE_WIDTH |
private static final int | DEFAULT_WEEK_DAY_TEXT_APPEARANCE_RES_ID |
private final int | mWeekSeperatorLineWidth |
private int | mDateTextSize |
private android.graphics.drawable.Drawable | mSelectedDateVerticalBar |
private final int | mSelectedDateVerticalBarWidth |
private int | mSelectedWeekBackgroundColor |
private int | mFocusedMonthDateColor |
private int | mUnfocusedMonthDateColor |
private int | mWeekSeparatorLineColor |
private int | mWeekNumberColor |
private int | mWeekDayTextAppearanceResId |
private int | mDateTextAppearanceResId |
private int | mListScrollTopOffsetThe top offset of the weeks list. |
private int | mWeekMinVisibleHeightThe visible height of a week view. |
private int | mBottomBufferThe visible height of a week view. |
private int | mShownWeekCountThe number of shown weeks. |
private boolean | mShowWeekNumberFlag whether to show the week number. |
private int | mDaysPerWeekThe number of day per week to be shown. |
private float | mFrictionThe friction of the week list while flinging. |
private float | mVelocityScaleScale for adjusting velocity of the week list while flinging. |
private WeeksAdapter | mAdapterThe adapter for the weeks list. |
private ListView | mListViewThe weeks list. |
private TextView | mMonthNameThe name of the month to display. |
private android.view.ViewGroup | mDayNamesHeaderThe header with week day names. |
private String[] | mDayNamesShortCached abbreviations for day of week names. |
private String[] | mDayNamesLongCached full-length day of week names. |
private int | mFirstDayOfWeekThe first day of the week. |
private int | mCurrentMonthDisplayedWhich month should be displayed/highlighted [0-11]. |
private long | mPreviousScrollPositionUsed for tracking during a scroll. |
private boolean | mIsScrollingUpUsed for tracking which direction the view is scrolling. |
private int | mPreviousScrollStateThe previous scroll state of the weeks ListView. |
private int | mCurrentScrollStateThe current scroll state of the weeks ListView. |
private CalendarView.OnDateChangeListener | mOnDateChangeListenerListener for changes in the selected day. |
private ScrollStateRunnable | mScrollStateChangedRunnableCommand for adjusting the position after a scroll/fling. |
private Calendar | mTempDateTemporary instance to avoid multiple instantiations. |
private Calendar | mFirstDayOfMonthThe first day of the focused month. |
private Calendar | mMinDateThe start date of the range supported by this picker. |
private Calendar | mMaxDateThe end date of the range supported by this picker. |
Constructors Summary |
---|
CalendarViewLegacyDelegate(CalendarView delegator, android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)
super(delegator, context);
final TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.CalendarView, defStyleAttr, defStyleRes);
mShowWeekNumber = a.getBoolean(R.styleable.CalendarView_showWeekNumber,
DEFAULT_SHOW_WEEK_NUMBER);
mFirstDayOfWeek = a.getInt(R.styleable.CalendarView_firstDayOfWeek,
LocaleData.get(Locale.getDefault()).firstDayOfWeek);
final String minDate = a.getString(R.styleable.CalendarView_minDate);
if (TextUtils.isEmpty(minDate) || !parseDate(minDate, mMinDate)) {
parseDate(DEFAULT_MIN_DATE, mMinDate);
}
final String maxDate = a.getString(R.styleable.CalendarView_maxDate);
if (TextUtils.isEmpty(maxDate) || !parseDate(maxDate, mMaxDate)) {
parseDate(DEFAULT_MAX_DATE, mMaxDate);
}
if (mMaxDate.before(mMinDate)) {
throw new IllegalArgumentException("Max date cannot be before min date.");
}
mShownWeekCount = a.getInt(R.styleable.CalendarView_shownWeekCount,
DEFAULT_SHOWN_WEEK_COUNT);
mSelectedWeekBackgroundColor = a.getColor(
R.styleable.CalendarView_selectedWeekBackgroundColor, 0);
mFocusedMonthDateColor = a.getColor(
R.styleable.CalendarView_focusedMonthDateColor, 0);
mUnfocusedMonthDateColor = a.getColor(
R.styleable.CalendarView_unfocusedMonthDateColor, 0);
mWeekSeparatorLineColor = a.getColor(
R.styleable.CalendarView_weekSeparatorLineColor, 0);
mWeekNumberColor = a.getColor(R.styleable.CalendarView_weekNumberColor, 0);
mSelectedDateVerticalBar = a.getDrawable(
R.styleable.CalendarView_selectedDateVerticalBar);
mDateTextAppearanceResId = a.getResourceId(
R.styleable.CalendarView_dateTextAppearance, R.style.TextAppearance_Small);
updateDateTextSize();
mWeekDayTextAppearanceResId = a.getResourceId(
R.styleable.CalendarView_weekDayTextAppearance,
DEFAULT_WEEK_DAY_TEXT_APPEARANCE_RES_ID);
a.recycle();
DisplayMetrics displayMetrics = mDelegator.getResources().getDisplayMetrics();
mWeekMinVisibleHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
UNSCALED_WEEK_MIN_VISIBLE_HEIGHT, displayMetrics);
mListScrollTopOffset = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
UNSCALED_LIST_SCROLL_TOP_OFFSET, displayMetrics);
mBottomBuffer = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
UNSCALED_BOTTOM_BUFFER, displayMetrics);
mSelectedDateVerticalBarWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
UNSCALED_SELECTED_DATE_VERTICAL_BAR_WIDTH, displayMetrics);
mWeekSeperatorLineWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
UNSCALED_WEEK_SEPARATOR_LINE_WIDTH, displayMetrics);
LayoutInflater layoutInflater = (LayoutInflater) mContext
.getSystemService(Service.LAYOUT_INFLATER_SERVICE);
View content = layoutInflater.inflate(R.layout.calendar_view, null, false);
mDelegator.addView(content);
mListView = (ListView) mDelegator.findViewById(R.id.list);
mDayNamesHeader = (ViewGroup) content.findViewById(R.id.day_names);
mMonthName = (TextView) content.findViewById(R.id.month_name);
setUpHeader();
setUpListView();
setUpAdapter();
// go to today or whichever is close to today min or max date
mTempDate.setTimeInMillis(System.currentTimeMillis());
if (mTempDate.before(mMinDate)) {
goTo(mMinDate, false, true, true);
} else if (mMaxDate.before(mTempDate)) {
goTo(mMaxDate, false, true, true);
} else {
goTo(mTempDate, false, true, true);
}
mDelegator.invalidate();
|
Methods Summary |
---|
private static java.util.Calendar | getCalendarForLocale(java.util.Calendar oldCalendar, java.util.Locale locale)Gets a calendar for locale bootstrapped with the value of a given calendar.
if (oldCalendar == null) {
return Calendar.getInstance(locale);
} else {
final long currentTimeMillis = oldCalendar.getTimeInMillis();
Calendar newCalendar = Calendar.getInstance(locale);
newCalendar.setTimeInMillis(currentTimeMillis);
return newCalendar;
}
|
public long | getDate()
return mAdapter.mSelectedDate.getTimeInMillis();
|
public int | getDateTextAppearance()
return mDateTextAppearanceResId;
|
public int | getFirstDayOfWeek()
return mFirstDayOfWeek;
|
public int | getFocusedMonthDateColor()
return mFocusedMonthDateColor;
|
public long | getMaxDate()
return mMaxDate.getTimeInMillis();
|
public long | getMinDate()
return mMinDate.getTimeInMillis();
|
public android.graphics.drawable.Drawable | getSelectedDateVerticalBar()
return mSelectedDateVerticalBar;
|
public int | getSelectedWeekBackgroundColor()
return mSelectedWeekBackgroundColor;
|
public boolean | getShowWeekNumber()
return mShowWeekNumber;
|
public int | getShownWeekCount()
return mShownWeekCount;
|
public int | getUnfocusedMonthDateColor()
return mFocusedMonthDateColor;
|
public int | getWeekDayTextAppearance()
return mWeekDayTextAppearanceResId;
|
public int | getWeekNumberColor()
return mWeekNumberColor;
|
public int | getWeekSeparatorLineColor()
return mWeekSeparatorLineColor;
|
private int | getWeeksSinceMinDate(java.util.Calendar date)
if (date.before(mMinDate)) {
throw new IllegalArgumentException("fromDate: " + mMinDate.getTime()
+ " does not precede toDate: " + date.getTime());
}
long endTimeMillis = date.getTimeInMillis()
+ date.getTimeZone().getOffset(date.getTimeInMillis());
long startTimeMillis = mMinDate.getTimeInMillis()
+ mMinDate.getTimeZone().getOffset(mMinDate.getTimeInMillis());
long dayOffsetMillis = (mMinDate.get(Calendar.DAY_OF_WEEK) - mFirstDayOfWeek)
* MILLIS_IN_DAY;
return (int) ((endTimeMillis - startTimeMillis + dayOffsetMillis) / MILLIS_IN_WEEK);
|
private void | goTo(java.util.Calendar date, boolean animate, boolean setSelected, boolean forceScroll)This moves to the specified time in the view. If the time is not already
in range it will move the list so that the first of the month containing
the time is at the top of the view. If the new time is already in view
the list will not be scrolled unless forceScroll is true. This time may
optionally be highlighted as selected as well.
if (date.before(mMinDate) || date.after(mMaxDate)) {
throw new IllegalArgumentException("Time not between " + mMinDate.getTime()
+ " and " + mMaxDate.getTime());
}
// Find the first and last entirely visible weeks
int firstFullyVisiblePosition = mListView.getFirstVisiblePosition();
View firstChild = mListView.getChildAt(0);
if (firstChild != null && firstChild.getTop() < 0) {
firstFullyVisiblePosition++;
}
int lastFullyVisiblePosition = firstFullyVisiblePosition + mShownWeekCount - 1;
if (firstChild != null && firstChild.getTop() > mBottomBuffer) {
lastFullyVisiblePosition--;
}
if (setSelected) {
mAdapter.setSelectedDay(date);
}
// Get the week we're going to
int position = getWeeksSinceMinDate(date);
// Check if the selected day is now outside of our visible range
// and if so scroll to the month that contains it
if (position < firstFullyVisiblePosition || position > lastFullyVisiblePosition
|| forceScroll) {
mFirstDayOfMonth.setTimeInMillis(date.getTimeInMillis());
mFirstDayOfMonth.set(Calendar.DAY_OF_MONTH, 1);
setMonthDisplayed(mFirstDayOfMonth);
// the earliest time we can scroll to is the min date
if (mFirstDayOfMonth.before(mMinDate)) {
position = 0;
} else {
position = getWeeksSinceMinDate(mFirstDayOfMonth);
}
mPreviousScrollState = AbsListView.OnScrollListener.SCROLL_STATE_FLING;
if (animate) {
mListView.smoothScrollToPositionFromTop(position, mListScrollTopOffset,
GOTO_SCROLL_DURATION);
} else {
mListView.setSelectionFromTop(position, mListScrollTopOffset);
// Perform any after scroll operations that are needed
onScrollStateChanged(mListView, AbsListView.OnScrollListener.SCROLL_STATE_IDLE);
}
} else if (setSelected) {
// Otherwise just set the selection
setMonthDisplayed(date);
}
|
private void | invalidateAllWeekViews()Invalidates all week views.
final int childCount = mListView.getChildCount();
for (int i = 0; i < childCount; i++) {
View view = mListView.getChildAt(i);
view.invalidate();
}
|
private static boolean | isSameDate(java.util.Calendar firstDate, java.util.Calendar secondDate)
return (firstDate.get(Calendar.DAY_OF_YEAR) == secondDate.get(Calendar.DAY_OF_YEAR)
&& firstDate.get(Calendar.YEAR) == secondDate.get(Calendar.YEAR));
|
public void | onConfigurationChanged(android.content.res.Configuration newConfig)
setCurrentLocale(newConfig.locale);
|
private void | onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)Updates the title and selected month if the view has moved to a new
month.
WeekView child = (WeekView) view.getChildAt(0);
if (child == null) {
return;
}
// Figure out where we are
long currScroll =
view.getFirstVisiblePosition() * child.getHeight() - child.getBottom();
// If we have moved since our last call update the direction
if (currScroll < mPreviousScrollPosition) {
mIsScrollingUp = true;
} else if (currScroll > mPreviousScrollPosition) {
mIsScrollingUp = false;
} else {
return;
}
// Use some hysteresis for checking which month to highlight. This
// causes the month to transition when two full weeks of a month are
// visible when scrolling up, and when the first day in a month reaches
// the top of the screen when scrolling down.
int offset = child.getBottom() < mWeekMinVisibleHeight ? 1 : 0;
if (mIsScrollingUp) {
child = (WeekView) view.getChildAt(SCROLL_HYST_WEEKS + offset);
} else if (offset != 0) {
child = (WeekView) view.getChildAt(offset);
}
if (child != null) {
// Find out which month we're moving into
int month;
if (mIsScrollingUp) {
month = child.getMonthOfFirstWeekDay();
} else {
month = child.getMonthOfLastWeekDay();
}
// And how it relates to our current highlighted month
int monthDiff;
if (mCurrentMonthDisplayed == 11 && month == 0) {
monthDiff = 1;
} else if (mCurrentMonthDisplayed == 0 && month == 11) {
monthDiff = -1;
} else {
monthDiff = month - mCurrentMonthDisplayed;
}
// Only switch months if we're scrolling away from the currently
// selected month
if ((!mIsScrollingUp && monthDiff > 0) || (mIsScrollingUp && monthDiff < 0)) {
Calendar firstDay = child.getFirstDay();
if (mIsScrollingUp) {
firstDay.add(Calendar.DAY_OF_MONTH, -DAYS_PER_WEEK);
} else {
firstDay.add(Calendar.DAY_OF_MONTH, DAYS_PER_WEEK);
}
setMonthDisplayed(firstDay);
}
}
mPreviousScrollPosition = currScroll;
mPreviousScrollState = mCurrentScrollState;
|
private void | onScrollStateChanged(AbsListView view, int scrollState)Called when a view transitions to a new scrollState
.
mScrollStateChangedRunnable.doScrollStateChange(view, scrollState);
|
protected void | setCurrentLocale(java.util.Locale locale)Sets the current locale.
super.setCurrentLocale(locale);
mTempDate = getCalendarForLocale(mTempDate, locale);
mFirstDayOfMonth = getCalendarForLocale(mFirstDayOfMonth, locale);
mMinDate = getCalendarForLocale(mMinDate, locale);
mMaxDate = getCalendarForLocale(mMaxDate, locale);
|
public void | setDate(long date)
setDate(date, false, false);
|
public void | setDate(long date, boolean animate, boolean center)
mTempDate.setTimeInMillis(date);
if (isSameDate(mTempDate, mAdapter.mSelectedDate)) {
return;
}
goTo(mTempDate, animate, true, center);
|
public void | setDateTextAppearance(int resourceId)
if (mDateTextAppearanceResId != resourceId) {
mDateTextAppearanceResId = resourceId;
updateDateTextSize();
invalidateAllWeekViews();
}
|
public void | setFirstDayOfWeek(int firstDayOfWeek)
if (mFirstDayOfWeek == firstDayOfWeek) {
return;
}
mFirstDayOfWeek = firstDayOfWeek;
mAdapter.init();
mAdapter.notifyDataSetChanged();
setUpHeader();
|
public void | setFocusedMonthDateColor(int color)
if (mFocusedMonthDateColor != color) {
mFocusedMonthDateColor = color;
final int childCount = mListView.getChildCount();
for (int i = 0; i < childCount; i++) {
WeekView weekView = (WeekView) mListView.getChildAt(i);
if (weekView.mHasFocusedDay) {
weekView.invalidate();
}
}
}
|
public void | setMaxDate(long maxDate)
mTempDate.setTimeInMillis(maxDate);
if (isSameDate(mTempDate, mMaxDate)) {
return;
}
mMaxDate.setTimeInMillis(maxDate);
// reinitialize the adapter since its range depends on max date
mAdapter.init();
Calendar date = mAdapter.mSelectedDate;
if (date.after(mMaxDate)) {
setDate(mMaxDate.getTimeInMillis());
} else {
// we go to the current date to force the ListView to query its
// adapter for the shown views since we have changed the adapter
// range and the base from which the later calculates item indices
// note that calling setDate will not work since the date is the same
goTo(date, false, true, false);
}
|
public void | setMinDate(long minDate)
mTempDate.setTimeInMillis(minDate);
if (isSameDate(mTempDate, mMinDate)) {
return;
}
mMinDate.setTimeInMillis(minDate);
// make sure the current date is not earlier than
// the new min date since the latter is used for
// calculating the indices in the adapter thus
// avoiding out of bounds error
Calendar date = mAdapter.mSelectedDate;
if (date.before(mMinDate)) {
mAdapter.setSelectedDay(mMinDate);
}
// reinitialize the adapter since its range depends on min date
mAdapter.init();
if (date.before(mMinDate)) {
setDate(mTempDate.getTimeInMillis());
} else {
// we go to the current date to force the ListView to query its
// adapter for the shown views since we have changed the adapter
// range and the base from which the later calculates item indices
// note that calling setDate will not work since the date is the same
goTo(date, false, true, false);
}
|
private void | setMonthDisplayed(java.util.Calendar calendar)Sets the month displayed at the top of this view based on time. Override
to add custom events when the title is changed.
mCurrentMonthDisplayed = calendar.get(Calendar.MONTH);
mAdapter.setFocusMonth(mCurrentMonthDisplayed);
final int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NO_MONTH_DAY
| DateUtils.FORMAT_SHOW_YEAR;
final long millis = calendar.getTimeInMillis();
String newMonthName = DateUtils.formatDateRange(mContext, millis, millis, flags);
mMonthName.setText(newMonthName);
mMonthName.invalidate();
|
public void | setOnDateChangeListener(CalendarView.OnDateChangeListener listener)
mOnDateChangeListener = listener;
|
public void | setSelectedDateVerticalBar(int resourceId)
Drawable drawable = mDelegator.getContext().getDrawable(resourceId);
setSelectedDateVerticalBar(drawable);
|
public void | setSelectedDateVerticalBar(android.graphics.drawable.Drawable drawable)
if (mSelectedDateVerticalBar != drawable) {
mSelectedDateVerticalBar = drawable;
final int childCount = mListView.getChildCount();
for (int i = 0; i < childCount; i++) {
WeekView weekView = (WeekView) mListView.getChildAt(i);
if (weekView.mHasSelectedDay) {
weekView.invalidate();
}
}
}
|
public void | setSelectedWeekBackgroundColor(int color)
if (mSelectedWeekBackgroundColor != color) {
mSelectedWeekBackgroundColor = color;
final int childCount = mListView.getChildCount();
for (int i = 0; i < childCount; i++) {
WeekView weekView = (WeekView) mListView.getChildAt(i);
if (weekView.mHasSelectedDay) {
weekView.invalidate();
}
}
}
|
public void | setShowWeekNumber(boolean showWeekNumber)
if (mShowWeekNumber == showWeekNumber) {
return;
}
mShowWeekNumber = showWeekNumber;
mAdapter.notifyDataSetChanged();
setUpHeader();
|
public void | setShownWeekCount(int count)
if (mShownWeekCount != count) {
mShownWeekCount = count;
mDelegator.invalidate();
}
|
public void | setUnfocusedMonthDateColor(int color)
if (mUnfocusedMonthDateColor != color) {
mUnfocusedMonthDateColor = color;
final int childCount = mListView.getChildCount();
for (int i = 0; i < childCount; i++) {
WeekView weekView = (WeekView) mListView.getChildAt(i);
if (weekView.mHasUnfocusedDay) {
weekView.invalidate();
}
}
}
|
private void | setUpAdapter()Creates a new adapter if necessary and sets up its parameters.
if (mAdapter == null) {
mAdapter = new WeeksAdapter(mContext);
mAdapter.registerDataSetObserver(new DataSetObserver() {
@Override
public void onChanged() {
if (mOnDateChangeListener != null) {
Calendar selectedDay = mAdapter.getSelectedDay();
mOnDateChangeListener.onSelectedDayChange(mDelegator,
selectedDay.get(Calendar.YEAR),
selectedDay.get(Calendar.MONTH),
selectedDay.get(Calendar.DAY_OF_MONTH));
}
}
});
mListView.setAdapter(mAdapter);
}
// refresh the view with the new parameters
mAdapter.notifyDataSetChanged();
|
private void | setUpHeader()Sets up the strings to be used by the header.
mDayNamesShort = new String[mDaysPerWeek];
mDayNamesLong = new String[mDaysPerWeek];
for (int i = mFirstDayOfWeek, count = mFirstDayOfWeek + mDaysPerWeek; i < count; i++) {
int calendarDay = (i > Calendar.SATURDAY) ? i - Calendar.SATURDAY : i;
mDayNamesShort[i - mFirstDayOfWeek] = DateUtils.getDayOfWeekString(calendarDay,
DateUtils.LENGTH_SHORTEST);
mDayNamesLong[i - mFirstDayOfWeek] = DateUtils.getDayOfWeekString(calendarDay,
DateUtils.LENGTH_LONG);
}
TextView label = (TextView) mDayNamesHeader.getChildAt(0);
if (mShowWeekNumber) {
label.setVisibility(View.VISIBLE);
} else {
label.setVisibility(View.GONE);
}
for (int i = 1, count = mDayNamesHeader.getChildCount(); i < count; i++) {
label = (TextView) mDayNamesHeader.getChildAt(i);
if (mWeekDayTextAppearanceResId > -1) {
label.setTextAppearance(mContext, mWeekDayTextAppearanceResId);
}
if (i < mDaysPerWeek + 1) {
label.setText(mDayNamesShort[i - 1]);
label.setContentDescription(mDayNamesLong[i - 1]);
label.setVisibility(View.VISIBLE);
} else {
label.setVisibility(View.GONE);
}
}
mDayNamesHeader.invalidate();
|
private void | setUpListView()Sets all the required fields for the list view.
// Configure the listview
mListView.setDivider(null);
mListView.setItemsCanFocus(true);
mListView.setVerticalScrollBarEnabled(false);
mListView.setOnScrollListener(new AbsListView.OnScrollListener() {
public void onScrollStateChanged(AbsListView view, int scrollState) {
CalendarViewLegacyDelegate.this.onScrollStateChanged(view, scrollState);
}
public void onScroll(
AbsListView view, int firstVisibleItem, int visibleItemCount,
int totalItemCount) {
CalendarViewLegacyDelegate.this.onScroll(view, firstVisibleItem,
visibleItemCount, totalItemCount);
}
});
// Make the scrolling behavior nicer
mListView.setFriction(mFriction);
mListView.setVelocityScale(mVelocityScale);
|
public void | setWeekDayTextAppearance(int resourceId)
if (mWeekDayTextAppearanceResId != resourceId) {
mWeekDayTextAppearanceResId = resourceId;
setUpHeader();
}
|
public void | setWeekNumberColor(int color)
if (mWeekNumberColor != color) {
mWeekNumberColor = color;
if (mShowWeekNumber) {
invalidateAllWeekViews();
}
}
|
public void | setWeekSeparatorLineColor(int color)
if (mWeekSeparatorLineColor != color) {
mWeekSeparatorLineColor = color;
invalidateAllWeekViews();
}
|
private void | updateDateTextSize()
TypedArray dateTextAppearance = mDelegator.getContext().obtainStyledAttributes(
mDateTextAppearanceResId, R.styleable.TextAppearance);
mDateTextSize = dateTextAppearance.getDimensionPixelSize(
R.styleable.TextAppearance_textSize, DEFAULT_DATE_TEXT_SIZE);
dateTextAppearance.recycle();
|