diff options
| author | Svetoslav Ganov <svetoslavganov@google.com> | 2011-09-14 18:35:44 -0700 |
|---|---|---|
| committer | Svetoslav Ganov <svetoslavganov@google.com> | 2011-09-14 18:35:48 -0700 |
| commit | 11c91328185c017e65930f137e69191ddef7e111 (patch) | |
| tree | 15b875bf6cb22cb0441b42f8449e90ff466d8201 /core/java/android/widget/TimePicker.java | |
| parent | cb18db8e7e43c4aa15aeb82dbab41ee3ee95f0b4 (diff) | |
TimePicker CTS test failing.
TimePicker code for setting the IME options was not taking into
account the old style of the UI where the AmPm spinner can be
null.
bug:5318844
Change-Id: I58b1781ef95398d11ecf0ca5bb49817cbba97b54
Diffstat (limited to 'core/java/android/widget/TimePicker.java')
| -rw-r--r-- | core/java/android/widget/TimePicker.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java index 7865d5008f04..7444d46178a6 100644 --- a/core/java/android/widget/TimePicker.java +++ b/core/java/android/widget/TimePicker.java @@ -218,9 +218,9 @@ public class TimePicker extends FrameLayout { updateAmPmControl(); } }); + EditText amPmInput = (EditText) mAmPmSpinner.findViewById(R.id.numberpicker_input); + amPmInput.setImeOptions(EditorInfo.IME_ACTION_DONE); } - EditText amPmInput = (EditText) mAmPmSpinner.findViewById(R.id.numberpicker_input); - amPmInput.setImeOptions(EditorInfo.IME_ACTION_DONE); // update controls to initial state updateHourControl(); @@ -519,9 +519,11 @@ public class TimePicker extends FrameLayout { text = mContext.getString(R.string.time_picker_decrement_hour_button); mHourSpinner.findViewById(R.id.decrement).setContentDescription(text); // AM/PM - text = mContext.getString(R.string.time_picker_increment_set_pm_button); - mAmPmSpinner.findViewById(R.id.increment).setContentDescription(text); - text = mContext.getString(R.string.time_picker_decrement_set_am_button); - mAmPmSpinner.findViewById(R.id.decrement).setContentDescription(text); + if (mAmPmSpinner != null) { + text = mContext.getString(R.string.time_picker_increment_set_pm_button); + mAmPmSpinner.findViewById(R.id.increment).setContentDescription(text); + text = mContext.getString(R.string.time_picker_decrement_set_am_button); + mAmPmSpinner.findViewById(R.id.decrement).setContentDescription(text); + } } } |
