Commit 993e3d2d authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review

Merge "Call OnTimeChangedListener when new TimePicker values are selected" into lmp-mr1-dev

parents 85a5f23b 73c3068b
......@@ -607,23 +607,32 @@ class TimePickerClockDelegate extends TimePicker.AbstractTimePickerDelegate impl
*/
@Override
public void onValueSelected(int pickerIndex, int newValue, boolean autoAdvance) {
if (pickerIndex == HOUR_INDEX) {
if (mAllowAutoAdvance && autoAdvance) {
updateHeaderHour(newValue, false);
setCurrentItemShowing(MINUTE_INDEX, true, false);
mDelegator.announceForAccessibility(newValue + ". " + mSelectMinutes);
} else {
updateHeaderHour(newValue, true);
}
} else if (pickerIndex == MINUTE_INDEX){
updateHeaderMinute(newValue, true);
} else if (pickerIndex == AMPM_INDEX) {
updateAmPmLabelStates(newValue);
} else if (pickerIndex == ENABLE_PICKER_INDEX) {
if (!isTypedTimeFullyLegal()) {
mTypedTimes.clear();
}
finishKbMode();
switch (pickerIndex) {
case HOUR_INDEX:
if (mAllowAutoAdvance && autoAdvance) {
updateHeaderHour(newValue, false);
setCurrentItemShowing(MINUTE_INDEX, true, false);
mDelegator.announceForAccessibility(newValue + ". " + mSelectMinutes);
} else {
updateHeaderHour(newValue, true);
}
break;
case MINUTE_INDEX:
updateHeaderMinute(newValue, true);
break;
case AMPM_INDEX:
updateAmPmLabelStates(newValue);
break;
case ENABLE_PICKER_INDEX:
if (!isTypedTimeFullyLegal()) {
mTypedTimes.clear();
}
finishKbMode();
break;
}
if (mOnTimeChangedListener != null) {
mOnTimeChangedListener.onTimeChanged(mDelegator, getCurrentHour(), getCurrentMinute());
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment