diff options
| author | Alan Viverette <alanv@google.com> | 2014-10-24 12:06:11 -0700 |
|---|---|---|
| committer | Alan Viverette <alanv@google.com> | 2014-10-24 12:06:11 -0700 |
| commit | ffb46bf2956d89e3190007ccf2ef3ce3eed005fe (patch) | |
| tree | 06c3158e38a66bc1490607ee81e25ac1529f6d3e /core/java/android/widget/TimePickerClockDelegate.java | |
| parent | fa9ed8ca0a08be0b32b2ccc33563a47df1f6d3da (diff) | |
Add support for Explore by Touch to RadialTimePickerView
Also adds IntArray, which is like LongArray for integers, and prevents
the AM/PM label text in the time picker header from wrapping.
BUG: 17468036
Change-Id: I7120089885709f23e20368927e4b3ed9db2e5393
Diffstat (limited to 'core/java/android/widget/TimePickerClockDelegate.java')
| -rw-r--r-- | core/java/android/widget/TimePickerClockDelegate.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/core/java/android/widget/TimePickerClockDelegate.java b/core/java/android/widget/TimePickerClockDelegate.java index eca304800cb8..78ee2471dcb1 100644 --- a/core/java/android/widget/TimePickerClockDelegate.java +++ b/core/java/android/widget/TimePickerClockDelegate.java @@ -611,15 +611,12 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl if (mAllowAutoAdvance && autoAdvance) { updateHeaderHour(newValue, false); setCurrentItemShowing(MINUTE_INDEX, true, false); - mRadialTimePickerView.announceForAccessibility(newValue + ". " + mSelectMinutes); + mDelegator.announceForAccessibility(newValue + ". " + mSelectMinutes); } else { updateHeaderHour(newValue, true); - mRadialTimePickerView.setContentDescription( - mHourPickerDescription + ": " + newValue); } } else if (pickerIndex == MINUTE_INDEX){ updateHeaderMinute(newValue, true); - mRadialTimePickerView.setContentDescription(mMinutePickerDescription + ": " + newValue); } else if (pickerIndex == AMPM_INDEX) { updateAmPmLabelStates(newValue); } else if (pickerIndex == ENABLE_PICKER_INDEX) { @@ -744,19 +741,12 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl mRadialTimePickerView.setCurrentItemShowing(index, animateCircle); if (index == HOUR_INDEX) { - int hours = mRadialTimePickerView.getCurrentHour(); - if (!mIs24HourView) { - hours = hours % 12; - } - mRadialTimePickerView.setContentDescription(mHourPickerDescription + ": " + hours); if (announce) { - mRadialTimePickerView.announceForAccessibility(mSelectHours); + mDelegator.announceForAccessibility(mSelectHours); } } else { - int minutes = mRadialTimePickerView.getCurrentMinute(); - mRadialTimePickerView.setContentDescription(mMinutePickerDescription + ": " + minutes); if (announce) { - mRadialTimePickerView.announceForAccessibility(mSelectMinutes); + mDelegator.announceForAccessibility(mSelectMinutes); } } @@ -789,7 +779,7 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl } else { deletedKeyStr = String.format("%d", getValFromKeyCode(deleted)); } - mRadialTimePickerView.announceForAccessibility( + mDelegator.announceForAccessibility( String.format(mDeletedKeyFormat, deletedKeyStr)); updateDisplay(true); } @@ -851,7 +841,7 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl } int val = getValFromKeyCode(keyCode); - mRadialTimePickerView.announceForAccessibility(String.format("%d", val)); + mDelegator.announceForAccessibility(String.format("%d", val)); // Automatically fill in 0's if AM or PM was legally entered. if (isTypedTimeFullyLegal()) { if (!mIs24HourView && mTypedTimes.size() <= 3) { |
