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

Commit 9c9e9966 authored by mqi's avatar mqi Committed by Linux Build Service Account
Browse files

SystemUI: Fix No AM/PM showing in 12-hour-format

Change clock style to AM_PM_STYLE_NORMAL.
Change lock screen style to HH:MM AM/PM.

Change-Id: Ic4aaa77927cc5736fe566381248e4945044dc061
CRs-Fixed: 956221
parent c0bb245b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -31,4 +31,7 @@

    <!-- Guide user to wipe data after fail to unlock for the max times -->
    <integer name="config_max_unlock_countdown_times">0</integer>

    <!-- config for showing AM/PM on lock screen in 12hour format -->
    <bool name="config_showAmpm">true</bool>
</resources>
+6 −4
Original line number Diff line number Diff line
@@ -240,11 +240,13 @@ public class KeyguardStatusView extends GridLayout {
            dateView = DateFormat.getBestDateTimePattern(locale, dateViewSkel);

            clockView12 = DateFormat.getBestDateTimePattern(locale, clockView12Skel);
            if(!context.getResources().getBoolean(R.bool.config_showAmpm)){
                // CLDR insists on adding an AM/PM indicator even though it wasn't in the skeleton
                // format.  The following code removes the AM/PM indicator if we didn't want it.
                if (!clockView12Skel.contains("a")) {
                    clockView12 = clockView12.replaceAll("a", "").trim();
                }
            }

            clockView24 = DateFormat.getBestDateTimePattern(locale, clockView24Skel);

+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ public class Clock extends TextView implements DemoMode, Tunable {
                R.styleable.Clock,
                0, 0);
        try {
            mAmPmStyle = a.getInt(R.styleable.Clock_amPmStyle, AM_PM_STYLE_GONE);
            mAmPmStyle = a.getInt(R.styleable.Clock_amPmStyle, AM_PM_STYLE_NORMAL);
        } finally {
            a.recycle();
        }