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

Commit 93ac6d01 authored by David Ogutu's avatar David Ogutu
Browse files

Fix TimePicker keyboard UI num digits for min

Force the minutes to always format to 2 digits. This is a temporary fix
that's not quite fully Locale aware but fixes UI issue. Will need to
refactor code to seperate Locale info, share code with non-keyboard UI
and use more native Locale functions to determine number of digits.

Test: Manual https://drive.google.com/file/d/1iabh2Zzl0YRhj17gbVKr8GvVDXEHUnWI/view?usp=sharing
Bug: 72041032
Change-Id: I0eb479b9aece4726db7bf7fba04dc50ad0f175c5
parent 348f19e6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -174,7 +174,8 @@ public class TextInputTimePickerView extends RelativeLayout {
     */
    void updateTextInputValues(int localizedHour, int minute, int amOrPm, boolean is24Hour,
            boolean hourFormatStartsAtZero) {
        final String format = "%d";
        final String hourFormat = "%d";
        final String minuteFormat = "%02d";

        mIs24Hour = is24Hour;
        mHourFormatStartsAtZero = hourFormatStartsAtZero;
@@ -187,8 +188,8 @@ public class TextInputTimePickerView extends RelativeLayout {
            mAmPmSpinner.setSelection(1);
        }

        mHourEditText.setText(String.format(format, localizedHour));
        mMinuteEditText.setText(String.format(format, minute));
        mHourEditText.setText(String.format(hourFormat, localizedHour));
        mMinuteEditText.setText(String.format(minuteFormat, minute));

        if (mErrorShowing) {
            validateInput();