Loading core/java/android/widget/CalendarViewLegacyDelegate.java +4 −4 Original line number Diff line number Diff line Loading @@ -789,14 +789,14 @@ class CalendarViewLegacyDelegate extends CalendarView.AbstractCalendarViewDelega * @param forceScroll Whether to recenter even if the time is already * visible. * * @throws IllegalArgumentException of the provided date is before the * range start of after the range end. * @throws IllegalArgumentException if the provided date is before the * range start or after the range end. */ private void goTo(Calendar date, boolean animate, boolean setSelected, boolean forceScroll) { if (date.before(mMinDate) || date.after(mMaxDate)) { throw new IllegalArgumentException("Time not between " + mMinDate.getTime() + " and " + mMaxDate.getTime()); throw new IllegalArgumentException("timeInMillis must be between the values of " + "getMinDate() and getMaxDate()"); } // Find the first and last entirely visible weeks int firstFullyVisiblePosition = mListView.getFirstVisiblePosition(); Loading core/java/android/widget/DayPickerView.java +15 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.widget; import static android.os.Build.VERSION_CODES.N_MR1; import android.graphics.Rect; import com.android.internal.R; import com.android.internal.widget.ViewPager; Loading Loading @@ -291,8 +293,21 @@ class DayPickerView extends ViewGroup { * @param timeInMillis the target day in milliseconds * @param animate whether to smooth scroll to the new position * @param setSelected whether to set the specified day as selected * * @throws IllegalArgumentException as of {@link android.os.Build.VERSION_CODES#N_MR1} if the * provided timeInMillis is before the range start or after the range end. */ private void setDate(long timeInMillis, boolean animate, boolean setSelected) { getTempCalendarForTime(timeInMillis); final int targetSdkVersion = mContext.getApplicationInfo().targetSdkVersion; if (targetSdkVersion >= N_MR1) { if (mTempCalendar.before(mMinDate) || mTempCalendar.after(mMaxDate)) { throw new IllegalArgumentException("timeInMillis must be between the values of " + "getMinDate() and getMaxDate()"); } } if (setSelected) { mSelectedDay.setTimeInMillis(timeInMillis); } Loading @@ -302,7 +317,6 @@ class DayPickerView extends ViewGroup { mViewPager.setCurrentItem(position, animate); } mTempCalendar.setTimeInMillis(timeInMillis); mAdapter.setSelectedDay(mTempCalendar); } Loading Loading
core/java/android/widget/CalendarViewLegacyDelegate.java +4 −4 Original line number Diff line number Diff line Loading @@ -789,14 +789,14 @@ class CalendarViewLegacyDelegate extends CalendarView.AbstractCalendarViewDelega * @param forceScroll Whether to recenter even if the time is already * visible. * * @throws IllegalArgumentException of the provided date is before the * range start of after the range end. * @throws IllegalArgumentException if the provided date is before the * range start or after the range end. */ private void goTo(Calendar date, boolean animate, boolean setSelected, boolean forceScroll) { if (date.before(mMinDate) || date.after(mMaxDate)) { throw new IllegalArgumentException("Time not between " + mMinDate.getTime() + " and " + mMaxDate.getTime()); throw new IllegalArgumentException("timeInMillis must be between the values of " + "getMinDate() and getMaxDate()"); } // Find the first and last entirely visible weeks int firstFullyVisiblePosition = mListView.getFirstVisiblePosition(); Loading
core/java/android/widget/DayPickerView.java +15 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.widget; import static android.os.Build.VERSION_CODES.N_MR1; import android.graphics.Rect; import com.android.internal.R; import com.android.internal.widget.ViewPager; Loading Loading @@ -291,8 +293,21 @@ class DayPickerView extends ViewGroup { * @param timeInMillis the target day in milliseconds * @param animate whether to smooth scroll to the new position * @param setSelected whether to set the specified day as selected * * @throws IllegalArgumentException as of {@link android.os.Build.VERSION_CODES#N_MR1} if the * provided timeInMillis is before the range start or after the range end. */ private void setDate(long timeInMillis, boolean animate, boolean setSelected) { getTempCalendarForTime(timeInMillis); final int targetSdkVersion = mContext.getApplicationInfo().targetSdkVersion; if (targetSdkVersion >= N_MR1) { if (mTempCalendar.before(mMinDate) || mTempCalendar.after(mMaxDate)) { throw new IllegalArgumentException("timeInMillis must be between the values of " + "getMinDate() and getMaxDate()"); } } if (setSelected) { mSelectedDay.setTimeInMillis(timeInMillis); } Loading @@ -302,7 +317,6 @@ class DayPickerView extends ViewGroup { mViewPager.setCurrentItem(position, animate); } mTempCalendar.setTimeInMillis(timeInMillis); mAdapter.setSelectedDay(mTempCalendar); } Loading