Skip to content

Commit de16e00

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "TimePicker CTS test failing."
2 parents b07f6e0 + 11c9132 commit de16e00

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

core/java/android/widget/TimePicker.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
218218
updateAmPmControl();
219219
}
220220
});
221+
EditText amPmInput = (EditText) mAmPmSpinner.findViewById(R.id.numberpicker_input);
222+
amPmInput.setImeOptions(EditorInfo.IME_ACTION_DONE);
221223
}
222-
EditText amPmInput = (EditText) mAmPmSpinner.findViewById(R.id.numberpicker_input);
223-
amPmInput.setImeOptions(EditorInfo.IME_ACTION_DONE);
224224

225225
// update controls to initial state
226226
updateHourControl();
@@ -519,9 +519,11 @@ private void setContentDescriptions() {
519519
text = mContext.getString(R.string.time_picker_decrement_hour_button);
520520
mHourSpinner.findViewById(R.id.decrement).setContentDescription(text);
521521
// AM/PM
522-
text = mContext.getString(R.string.time_picker_increment_set_pm_button);
523-
mAmPmSpinner.findViewById(R.id.increment).setContentDescription(text);
524-
text = mContext.getString(R.string.time_picker_decrement_set_am_button);
525-
mAmPmSpinner.findViewById(R.id.decrement).setContentDescription(text);
522+
if (mAmPmSpinner != null) {
523+
text = mContext.getString(R.string.time_picker_increment_set_pm_button);
524+
mAmPmSpinner.findViewById(R.id.increment).setContentDescription(text);
525+
text = mContext.getString(R.string.time_picker_decrement_set_am_button);
526+
mAmPmSpinner.findViewById(R.id.decrement).setContentDescription(text);
527+
}
526528
}
527529
}

0 commit comments

Comments
 (0)