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

Commit 03dfbc97 authored by mtwebster's avatar mtwebster
Browse files

This change is a component of CMParts theme load/save changes:

Removed a couple color setting that shouldn't be "backed up" here (use xml files instead like everything else)
Added an HDPI-only setting to aid theme builders with battery alignment issues.  This will be settable ONLY in xml files.
parent f401c65a
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -2191,6 +2191,13 @@ public final class Settings {
         */
        public static final String LOCK_HOME_IN_MEMORY = "lock_home_in_memory";

        /**
         * HDPI Devices only:  Align battery percentage text in status bar icon  right (0), left (1), center (2)
         * right (0) is default
         * @hide
         */
        public static final String HDPI_BATTERY_ALIGNMENT = "hdpi_battery_alignment";

        /**
         * Settings to backup. This is here so that it's in the same place as the settings
         * keys and easy to update.
@@ -2261,11 +2268,7 @@ public final class Settings {
            HAPTIC_UP_ARRAY_DEFAULT,
            HAPTIC_LONG_ARRAY_DEFAULT,
            HAPTIC_TAP_ARRAY,
            HAPTIC_TAP_ARRAY_DEFAULT,
            NOTIF_BAR_COLOR,
            NOTIF_BAR_CUSTOM,
            NOTIF_EXPANDED_BAR_COLOR,
            NOTIF_EXPANDED_BAR_CUSTOM
            HAPTIC_TAP_ARRAY_DEFAULT
        };

        // Settings moved to Settings.Secure
+25 −6
Original line number Diff line number Diff line
@@ -137,12 +137,31 @@ class StatusBarIcon {
                ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(dm);
        
                if (DisplayMetrics.DENSITY_HIGH == dm.densityDpi) {               
                    switch (Settings.System.getInt(mContext.getContentResolver(),
                           Settings.System.HDPI_BATTERY_ALIGNMENT, 0))
                    {
                        case 0:
                            mNumberView.setLayoutParams(
                            new FrameLayout.LayoutParams(
                                FrameLayout.LayoutParams.WRAP_CONTENT,
                                FrameLayout.LayoutParams.WRAP_CONTENT,
                                Gravity.RIGHT | Gravity.CENTER_VERTICAL));

                            break;
                        case 1:
                            mNumberView.setLayoutParams(
                            new FrameLayout.LayoutParams(
                                FrameLayout.LayoutParams.WRAP_CONTENT,
                                FrameLayout.LayoutParams.WRAP_CONTENT,
                                Gravity.LEFT | Gravity.CENTER_VERTICAL));
                            break;
                        case 2:
                            mNumberView.setLayoutParams(
                            new FrameLayout.LayoutParams(
                                FrameLayout.LayoutParams.WRAP_CONTENT,
                                FrameLayout.LayoutParams.WRAP_CONTENT,
                                Gravity.CENTER | Gravity.CENTER_VERTICAL));
                            break;
                    }
                    mNumberView.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
                }
                else {