diff options
author | Alan Viverette <alanv@google.com> | 2014-11-07 15:39:24 -0800 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-11-07 15:39:24 -0800 |
commit | 73c3068b0ef9c14bfbe7b056905621cc147b9c38 (patch) | |
tree | 976986399a26e97ea607b803965a02315095b4c4 | |
parent | 872d4e00ed1715d76dc8e97853a4e3e9542ca8d0 (diff) | |
download | frameworks_base-73c3068b0ef9c14bfbe7b056905621cc147b9c38.zip frameworks_base-73c3068b0ef9c14bfbe7b056905621cc147b9c38.tar.gz frameworks_base-73c3068b0ef9c14bfbe7b056905621cc147b9c38.tar.bz2 |
Call OnTimeChangedListener when new TimePicker values are selected
BUG: 18295303
Change-Id: Ib5922db3a16c1975554072e2af241bbd6cf807c4
-rw-r--r-- | core/java/android/widget/TimePickerClockDelegate.java | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/core/java/android/widget/TimePickerClockDelegate.java b/core/java/android/widget/TimePickerClockDelegate.java index 78ee247..7d01321 100644 --- a/core/java/android/widget/TimePickerClockDelegate.java +++ b/core/java/android/widget/TimePickerClockDelegate.java @@ -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()); } } |