Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11c91328 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

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
parent cb18db8e
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -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);
        }

        // 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
        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);
        }
    }
}