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

Commit cbe45082 authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Implement new keyboard interaction model in TimePicker"

parents ebb173e3 b3f24639
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import com.android.internal.R;

import java.util.Locale;

import libcore.icu.LocaleData;

/**
 * A widget for selecting the time of day, in either 24-hour or AM/PM mode.
 * <p>
@@ -303,6 +305,16 @@ public class TimePicker extends FrameLayout {
        void onValidationChanged(boolean valid);
    }

    static String[] getAmPmStrings(Context context) {
        final Locale locale = context.getResources().getConfiguration().locale;
        final LocaleData d = LocaleData.get(locale);

        final String[] result = new String[2];
        result[0] = d.amPm[0].length() > 4 ? d.narrowAm : d.amPm[0];
        result[1] = d.amPm[1].length() > 4 ? d.narrowPm : d.amPm[1];
        return result;
    }

    /**
     * An abstract class which can be used as a start for TimePicker implementations
     */
Loading