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

Commit 07add485 authored by CEnnis's avatar CEnnis Committed by Steve Kondik
Browse files

AM/PM Styles in Status Bar

Adds configurable AM/PM styles back into the status bar.
Includes Eclair's "Normal" style, Froyo's "Small" text, and Gingerbread's "None".
CMParts Portion: http://review.cyanogenmod.com/#change,4298

Relevant link: http://en.wikipedia.org/wiki/Midnight_sun

Change-Id: Ia365b5fedbc67d84e3aaed4d6ae280336d4f5bb6
parent 29446c8e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2119,6 +2119,16 @@ public final class Settings {
         */
        public static final String LOCK_MMS_IN_MEMORY = "lock_mms_in_memory";

        /**
         * Display style of AM/PM next to clock in status bar
         * 0: Normal display (Eclair stock)
         * 1: Small display (Froyo stock)
         * 2: No display (Gingerbread stock)
         * default: 2
         * @hide
         */
        public static final String STATUS_BAR_AM_PM = "status_bar_am_pm";

        /**
         * Whether to show the CM battery percentage implementation instead
         * of the stock battery icon
+16 −1
Original line number Diff line number Diff line
@@ -54,8 +54,9 @@ public class Clock extends TextView {
    private static final int AM_PM_STYLE_SMALL   = 1;
    private static final int AM_PM_STYLE_GONE    = 2;

    private static final int AM_PM_STYLE = AM_PM_STYLE_GONE;
    private static int AM_PM_STYLE = AM_PM_STYLE_GONE;

    private int mAmPmStyle;
    private boolean mShowClock;

    Handler mHandler;
@@ -67,6 +68,8 @@ public class Clock extends TextView {

        void observe() {
            ContentResolver resolver = mContext.getContentResolver();
            resolver.registerContentObserver(Settings.System.getUriFor(
                    Settings.System.STATUS_BAR_AM_PM), false, this);
            resolver.registerContentObserver(Settings.System.getUriFor(
                    Settings.System.STATUS_BAR_CLOCK), false, this);
        }
@@ -231,6 +234,18 @@ public class Clock extends TextView {
    private void updateSettings(){
        ContentResolver resolver = mContext.getContentResolver();

        mAmPmStyle = (Settings.System.getInt(resolver,
                Settings.System.STATUS_BAR_AM_PM, 2));

        if (mAmPmStyle != AM_PM_STYLE) {
            AM_PM_STYLE = mAmPmStyle;
            mClockFormatString = "";

            if (mAttached) {
                updateClock();
            }
        }

        mShowClock = (Settings.System.getInt(resolver,
                Settings.System.STATUS_BAR_CLOCK, 1) == 1);

+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public class StatusBarPolicy {
    private static final int AM_PM_STYLE_SMALL   = 1;
    private static final int AM_PM_STYLE_GONE    = 2;

    private static final int AM_PM_STYLE = AM_PM_STYLE_GONE;
    private static int AM_PM_STYLE = AM_PM_STYLE_GONE;

    private static final int INET_CONDITION_THRESHOLD = 50;