diff options
author | Alan Viverette <alanv@google.com> | 2015-04-10 15:41:10 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2015-04-10 15:41:10 -0700 |
commit | 816aa142023c75cf427401c21831193998bdf233 (patch) | |
tree | 63ca807a90b45cc520f9867be6bce021feab69df /core/java/android/widget/SimpleMonthView.java | |
parent | a323e3f3366321ce63d1f465d7dfe8bdc0e95679 (diff) | |
download | frameworks_base-816aa142023c75cf427401c21831193998bdf233.zip frameworks_base-816aa142023c75cf427401c21831193998bdf233.tar.gz frameworks_base-816aa142023c75cf427401c21831193998bdf233.tar.bz2 |
Fix date picker dialog size
Also fixes date picker instance state restore and cleans up the fade
animations.
Bug: 20110268
Change-Id: I503e2f81253077f22f1619834dc2f2634138ae4e
Diffstat (limited to 'core/java/android/widget/SimpleMonthView.java')
-rw-r--r-- | core/java/android/widget/SimpleMonthView.java | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/core/java/android/widget/SimpleMonthView.java b/core/java/android/widget/SimpleMonthView.java index d9f1f0e..aa7f0b6 100644 --- a/core/java/android/widget/SimpleMonthView.java +++ b/core/java/android/widget/SimpleMonthView.java @@ -585,7 +585,6 @@ class SimpleMonthView extends View { mToday = day; } } - mNumWeeks = calculateNumRows(); // Invalidate the old title. mTitle = null; @@ -616,18 +615,6 @@ class SimpleMonthView extends View { } } - public void reuse() { - mNumWeeks = MAX_WEEKS_IN_MONTH; - requestLayout(); - } - - private int calculateNumRows() { - final int offset = findDayOffset(); - final int dividend = (offset + mDaysInMonth) / DAYS_IN_WEEK; - final int remainder = (offset + mDaysInMonth) % DAYS_IN_WEEK; - return dividend + (remainder > 0 ? 1 : 0); - } - private boolean sameDay(int day, Calendar today) { return mYear == today.get(Calendar.YEAR) && mMonth == today.get(Calendar.MONTH) && day == today.get(Calendar.DAY_OF_MONTH); @@ -635,8 +622,9 @@ class SimpleMonthView extends View { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - final int preferredHeight = mDesiredDayHeight * mNumWeeks + mDesiredDayOfWeekHeight - + mDesiredMonthHeight + getPaddingTop() + getPaddingBottom(); + final int preferredHeight = mDesiredDayHeight * MAX_WEEKS_IN_MONTH + + mDesiredDayOfWeekHeight + mDesiredMonthHeight + + getPaddingTop() + getPaddingBottom(); final int preferredWidth = mDesiredCellWidth * DAYS_IN_WEEK + getPaddingStart() + getPaddingEnd(); final int resolvedWidth = resolveSize(preferredWidth, widthMeasureSpec); |