@Override
 public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
   if (dayListener != null) {
     Day d = (Day) mAdapter.getItem(arg2);
     if (d.getDay() != 0) {
       dayListener.onDayClicked(arg0, arg1, arg2, arg3, d);
     }
   }
 }
  /**
   * 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);
  }
  /**
   * 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 boolean onDayClicked(int day) {
    if (!isValidDayOfMonth(day) || !isDayEnabled(day)) {
      return false;
    }

    if (mOnDayClickListener != null) {
      final Calendar date = Calendar.getInstance();
      date.set(mYear, mMonth, day);
      mOnDayClickListener.onDayClick(this, date);
    }

    // This is a no-op if accessibility is turned off.
    mTouchHelper.sendEventForVirtualView(day, AccessibilityEvent.TYPE_VIEW_CLICKED);
    return true;
  }
Ejemplo n.º 4
0
 private void onDayClick(SimpleMonthAdapter.CalendarDay calendarDay) {
   if (mOnDayClickListener != null) {
     mOnDayClickListener.onDayClick(this, calendarDay);
   }
 }