diff options
author | Paul Sliwowski <psliwowski@google.com> | 2013-06-24 20:16:31 -0700 |
---|---|---|
committer | Paul Sliwowski <psliwowski@google.com> | 2013-06-25 23:44:35 +0000 |
commit | a954f39d3415af70ee44d93cacf4e29d2c52054c (patch) | |
tree | 48049ccfde369f2dcc604767e274e7e583f6a825 /src/com/android | |
parent | 2994491d65ecb60debc2671535516d3225261049 (diff) | |
download | datetimepicker-a954f39d3415af70ee44d93cacf4e29d2c52054c.tar.gz |
Fixed issue with Accessibility talkback in time picker.
Bug: 8856042
Change-Id: Id7788f0e1f5d9d6cc9d23712bb3b9ecb5cffa341
(cherry picked from commit 8d7fc6da408116fc1fdff329e1ae1da8b79b0904)
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/datetimepicker/time/TimePickerDialog.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/datetimepicker/time/TimePickerDialog.java b/src/com/android/datetimepicker/time/TimePickerDialog.java index d5db83b..4b67629 100644 --- a/src/com/android/datetimepicker/time/TimePickerDialog.java +++ b/src/com/android/datetimepicker/time/TimePickerDialog.java @@ -330,10 +330,14 @@ public class TimePickerDialog extends DialogFragment implements OnValueSelectedL if (mAllowAutoAdvance && autoAdvance) { setCurrentItemShowing(MINUTE_INDEX, true, true, false); announcement += ". " + mSelectMinutes; + } else { + mTimePicker.setContentDescription(mHourPickerDescription + ": " + newValue); } + Utils.tryAccessibilityAnnounce(mTimePicker, announcement); } else if (pickerIndex == MINUTE_INDEX){ setMinute(newValue); + mTimePicker.setContentDescription(mMinutePickerDescription + ": " + newValue); } else if (pickerIndex == AMPM_INDEX) { updateAmPmDisplay(newValue); } else if (pickerIndex == ENABLE_PICKER_INDEX) { @@ -385,14 +389,14 @@ public class TimePickerDialog extends DialogFragment implements OnValueSelectedL if (!mIs24HourMode) { hours = hours % 12; } - mTimePicker.setContentDescription(mHourPickerDescription+": "+hours); + mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours); if (announce) { Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours); } labelToAnimate = mHourView; } else { int minutes = mTimePicker.getMinutes(); - mTimePicker.setContentDescription(mMinutePickerDescription+": "+minutes); + mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes); if (announce) { Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes); } |