/** * Set up the gesture detector and selected time */ protected void init() { mSelectedDay = new CalendarDay(System.currentTimeMillis()); }
int month = firstVisiblePosition % 12; int year = firstVisiblePosition / 12 + mController.getMinYear(); CalendarDay day = new CalendarDay(year, month, 1);
/** * Set up the gesture detector and selected time */ protected void init() { mSelectedDay = new CalendarDay(System.currentTimeMillis()); }
int month = firstVisiblePosition % 12; int year = firstVisiblePosition / 12 + mController.getMinYear(); CalendarDay day = new CalendarDay(year, month, 1);
/** * Called when the user clicks on a day. Handles callbacks to the * {@link OnDayClickListener} if one is set. * <p/> * If the day is out of the range set by minDate and/or maxDate, this is a no-op. * * @param day The day that was clicked */ private void onDayClick(int day) { // If the min / max date are set, only process the click if it's a valid selection. if (isOutOfRange(mYear, mMonth, day)) { return; } if (mOnDayClickListener != null) { mOnDayClickListener.onDayClick(this, new CalendarDay(mYear, mMonth, day)); } // This is a no-op if accessibility is turned off. mTouchHelper.sendEventForVirtualView(day, AccessibilityEvent.TYPE_VIEW_CLICKED); }
/** * @return The date that has accessibility focus, or {@code null} if no date * has focus */ public CalendarDay getAccessibilityFocus() { final int day = mTouchHelper.getFocusedVirtualView(); if (day >= 0) { return new CalendarDay(mYear, mMonth, day); } return null; }
@Override public CalendarDay getSelectedDay() { return new CalendarDay(mCalendar); }
/** * Called when the user clicks on a day. Handles callbacks to the * {@link OnDayClickListener} if one is set. * * @param day The day that was clicked */ private void onDayClick(int day) { if (mOnDayClickListener != null) { mOnDayClickListener.onDayClick(this, new CalendarDay(mYear, mMonth, day)); } // This is a no-op if accessibility is turned off. mTouchHelper.sendEventForVirtualView(day, AccessibilityEvent.TYPE_VIEW_CLICKED); }
@Override public CalendarDay getSelectedDay() { return new CalendarDay(mCalendar); }
/** * @return The date that has accessibility focus, or {@code null} if no date * has focus */ public CalendarDay getAccessibilityFocus() { final int day = mTouchHelper.getFocusedVirtualView(); if (day >= 0) { return new CalendarDay(mYear, mMonth, day); } return null; }