diff options
author | Alan Viverette <alanv@google.com> | 2014-09-10 17:09:13 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-09-10 17:09:13 -0700 |
commit | 5878076456a2eb510c03b6160a0cfb99a54e0cfd (patch) | |
tree | 42ec0f89749d56e2311d9180786ca10aebec69ad /core/java/android/widget/SimpleMonthView.java | |
parent | 3ab7bf1a3d1383190a8c3a84f1216227529fdcec (diff) | |
download | frameworks_base-5878076456a2eb510c03b6160a0cfb99a54e0cfd.zip frameworks_base-5878076456a2eb510c03b6160a0cfb99a54e0cfd.tar.gz frameworks_base-5878076456a2eb510c03b6160a0cfb99a54e0cfd.tar.bz2 |
Use Calendar day of week rather than Time in SimpleMonthView
BUG: 17377360
Change-Id: I685f35b760c049edaa8934eccaf5ce1bbf326cf2
Diffstat (limited to 'core/java/android/widget/SimpleMonthView.java')
-rw-r--r-- | core/java/android/widget/SimpleMonthView.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/java/android/widget/SimpleMonthView.java b/core/java/android/widget/SimpleMonthView.java index 27763eb..a76241e 100644 --- a/core/java/android/widget/SimpleMonthView.java +++ b/core/java/android/widget/SimpleMonthView.java @@ -31,6 +31,7 @@ import android.text.format.DateFormat; import android.text.format.DateUtils; import android.text.format.Time; import android.util.AttributeSet; +import android.util.MathUtils; import android.view.MotionEvent; import android.view.View; import android.view.accessibility.AccessibilityEvent; @@ -300,7 +301,11 @@ class SimpleMonthView extends View { } private static boolean isValidDayOfWeek(int day) { - return (day >= Time.SUNDAY && day <= Time.SATURDAY); + return day >= Calendar.SUNDAY && day <= Calendar.SATURDAY; + } + + private static boolean isValidMonth(int month) { + return month >= Calendar.JANUARY && month <= Calendar.DECEMBER; } /** @@ -312,8 +317,8 @@ class SimpleMonthView extends View { * @param selectedDay the selected day of the month, or -1 for no selection. * @param month the month. * @param year the year. - * @param weekStart which day the week should start on. {@link Time#SUNDAY} through - * {@link Time#SATURDAY}. + * @param weekStart which day the week should start on. {@link Calendar#SUNDAY} through + * {@link Calendar#SATURDAY}. * @param enabledDayStart the first enabled day. * @param enabledDayEnd the last enabled day. */ @@ -325,7 +330,7 @@ class SimpleMonthView extends View { mSelectedDay = selectedDay; - if (month >= Calendar.JANUARY && month <= Calendar.DECEMBER) { + if (isValidMonth(month)) { mMonth = month; } mYear = year; |