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

Commit 9aa1c016 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "DeskClock: Fix the AM/PM on time picker dialog display uncomplete"

parents 1eeeafea 449c448e
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -93,6 +93,7 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im
    private Node mLegalTimesTree;
    private Node mLegalTimesTree;
    private int mAmKeyCode;
    private int mAmKeyCode;
    private int mPmKeyCode;
    private int mPmKeyCode;
    private int mHeaderTimeTextAppearance = 0;


    // Accessibility strings.
    // Accessibility strings.
    private String mHourPickerDescription;
    private String mHourPickerDescription;
@@ -136,6 +137,7 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im
        final int headerTimeTextAppearance = a.getResourceId(
        final int headerTimeTextAppearance = a.getResourceId(
                R.styleable.TimePicker_headerTimeTextAppearance, 0);
                R.styleable.TimePicker_headerTimeTextAppearance, 0);
        if (headerTimeTextAppearance != 0) {
        if (headerTimeTextAppearance != 0) {
            mHeaderTimeTextAppearance = headerTimeTextAppearance;
            mHourView.setTextAppearance(context, headerTimeTextAppearance);
            mHourView.setTextAppearance(context, headerTimeTextAppearance);
            mSeparatorView.setTextAppearance(context, headerTimeTextAppearance);
            mSeparatorView.setTextAppearance(context, headerTimeTextAppearance);
            mMinuteView.setTextAppearance(context, headerTimeTextAppearance);
            mMinuteView.setTextAppearance(context, headerTimeTextAppearance);
@@ -234,7 +236,11 @@ class TimePickerSpinnerDelegate extends TimePicker.AbstractTimePickerDelegate im


    private int computeMaxWidthOfNumbers(int max) {
    private int computeMaxWidthOfNumbers(int max) {
        TextView tempView = new TextView(mContext);
        TextView tempView = new TextView(mContext);
        if (mHeaderTimeTextAppearance != 0) {
            tempView.setTextAppearance(mContext, mHeaderTimeTextAppearance);
        } else {
            tempView.setTextAppearance(mContext, R.style.TextAppearance_Material_TimePicker_TimeLabel);
            tempView.setTextAppearance(mContext, R.style.TextAppearance_Material_TimePicker_TimeLabel);
        }
        ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
        ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
                ViewGroup.LayoutParams.WRAP_CONTENT);
        tempView.setLayoutParams(lp);
        tempView.setLayoutParams(lp);