diff options
author | Alan Viverette <alanv@google.com> | 2014-10-16 01:07:03 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-16 01:07:04 +0000 |
commit | b4a29247ffb58f44e50edad7cf56ffc2ea0d7c6b (patch) | |
tree | 53dc68bcca3d38ce4c1dc3d1f43767374928b563 /core/java | |
parent | 0511023432ff24c5ddda563e326273936b5d40f5 (diff) | |
parent | ef71947fd38f7918a628a238fee2ae000bb6bb45 (diff) | |
download | frameworks_base-b4a29247ffb58f44e50edad7cf56ffc2ea0d7c6b.zip frameworks_base-b4a29247ffb58f44e50edad7cf56ffc2ea0d7c6b.tar.gz frameworks_base-b4a29247ffb58f44e50edad7cf56ffc2ea0d7c6b.tar.bz2 |
Merge "Set content description on CalendarView day labels" into lmp-mr1-dev
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/widget/CalendarView.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/core/java/android/widget/CalendarView.java b/core/java/android/widget/CalendarView.java index ea60abb..f380d68 100644 --- a/core/java/android/widget/CalendarView.java +++ b/core/java/android/widget/CalendarView.java @@ -775,9 +775,14 @@ public class CalendarView extends FrameLayout { private ViewGroup mDayNamesHeader; /** - * Cached labels for the week names header. + * Cached abbreviations for day of week names. */ - private String[] mDayLabels; + private String[] mDayNamesShort; + + /** + * Cached full-length day of week names. + */ + private String[] mDayNamesLong; /** * The first day of the week. @@ -1306,11 +1311,14 @@ public class CalendarView extends FrameLayout { * Sets up the strings to be used by the header. */ private void setUpHeader() { - mDayLabels = new String[mDaysPerWeek]; + mDayNamesShort = new String[mDaysPerWeek]; + mDayNamesLong = new String[mDaysPerWeek]; for (int i = mFirstDayOfWeek, count = mFirstDayOfWeek + mDaysPerWeek; i < count; i++) { int calendarDay = (i > Calendar.SATURDAY) ? i - Calendar.SATURDAY : i; - mDayLabels[i - mFirstDayOfWeek] = DateUtils.getDayOfWeekString(calendarDay, + mDayNamesShort[i - mFirstDayOfWeek] = DateUtils.getDayOfWeekString(calendarDay, DateUtils.LENGTH_SHORTEST); + mDayNamesLong[i - mFirstDayOfWeek] = DateUtils.getDayOfWeekString(calendarDay, + DateUtils.LENGTH_LONG); } TextView label = (TextView) mDayNamesHeader.getChildAt(0); @@ -1325,7 +1333,8 @@ public class CalendarView extends FrameLayout { label.setTextAppearance(mContext, mWeekDayTextAppearanceResId); } if (i < mDaysPerWeek + 1) { - label.setText(mDayLabels[i - 1]); + label.setText(mDayNamesShort[i - 1]); + label.setContentDescription(mDayNamesLong[i - 1]); label.setVisibility(View.VISIBLE); } else { label.setVisibility(View.GONE); |