コード例 #1
0
  /**
   * Sets the minimal date supported by this DatePicker. Dates after (but not including) the
   * specified date will be disallowed from being selected.
   *
   * @param calendar a Calendar object set to the year, month, day desired as the maxdate.
   */
  @SuppressWarnings("unused")
  public void setMaxDate(Calendar calendar) {
    mMaxDate = calendar;

    if (mDayPickerView != null && mDayPickerViewEnd != null) {
      mDayPickerView.onChange();
      mDayPickerViewEnd.onChange();
    }
  }
コード例 #2
0
  @SuppressWarnings("unused")
  public void setYearRange(int startYear, int endYear) {
    if (endYear < startYear) {
      throw new IllegalArgumentException("Year end must be larger than or equal to year start");
    }

    mMinYear = startYear;
    mMaxYear = endYear;
    if (mDayPickerView != null && mDayPickerViewEnd != null) {
      mDayPickerView.onChange();
      mDayPickerViewEnd.onChange();
    }
  }
コード例 #3
0
  @SuppressWarnings("unused")
  public void setFirstDayOfWeek(int startOfWeek, int startWeekEnd) {
    if (startOfWeek < Calendar.SUNDAY || startOfWeek > Calendar.SATURDAY) {
      throw new IllegalArgumentException(
          "Value must be between Calendar.SUNDAY and " + "Calendar.SATURDAY");
    }
    mWeekStart = startOfWeek;
    mWeekStartEnd = startWeekEnd;

    if (mDayPickerView != null) {
      mDayPickerView.onChange();
    }

    if (mDayPickerViewEnd != null) {
      mDayPickerViewEnd.onChange();
    }
  }