/** * Called by the picker for updating the header display. */ @Override public void onValueSelected(int pickerIndex, int newValue, boolean autoAdvance) { if (pickerIndex == HOUR_INDEX) { setHour(newValue, false); String announcement = String.format("%d", newValue); 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) { if (!isTypedTimeFullyLegal()) { mTypedTimes.clear(); } finishKbMode(true); } }
hours = hours % 12; mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours); if (announce) { Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours); } else { int minutes = mTimePicker.getMinutes(); mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes); if (announce) { Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
hours = hours % 12; mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours); if (announce) { Utils.tryAccessibilityAnnounce(mTimePicker, mSelectHours); } else { int minutes = mTimePicker.getMinutes(); mTimePicker.setContentDescription(mMinutePickerDescription + ": " + minutes); if (announce) { Utils.tryAccessibilityAnnounce(mTimePicker, mSelectMinutes);
announcement += ". " + mSelectMinutes; } else { mTimePicker.setContentDescription(mHourPickerDescription + ": " + newValue); if (valueRespectsMinutesConstraint(newValue)) { setMinute(newValue); mTimePicker.setContentDescription(mMinutePickerDescription + ": " + newValue);