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

Commit 876e359b authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Make QS battery composite color match others."

parents 27bfb245 29786fc7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
-->
<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="top"
@@ -27,6 +28,7 @@
            android:layout_height="32dp"
            android:padding="3dp"
            android:layout_gravity="top|center_horizontal"
            systemui:frameColor="@color/qs_batterymeter_frame_color"
            />
    <TextView
            style="@style/TextAppearance.QuickSettings.TileView"
+3 −1
Original line number Diff line number Diff line
@@ -42,7 +42,9 @@
        <attr name="decayTime" format="integer" />
        <attr name="orientation" />
    </declare-styleable>

    <declare-styleable name="BatteryMeterView">
        <attr name="frameColor" format="color" />
    </declare-styleable>
    <attr name="orientation">
        <enum name="horizontal" value="0" />
        <enum name="vertical" value="1" />
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
    <color name="batterymeter_frame_color">#66FFFFFF</color><!-- 40% white -->
    <color name="batterymeter_charge_color">#FFFFFFFF</color>
    <color name="batterymeter_bolt_color">#FFFFFFFF</color>
    <color name="qs_batterymeter_frame_color">#FF404040</color>
    <color name="status_bar_clock_color">#FFFFFFFF</color>
    <drawable name="notification_item_background_color">#ff111111</drawable>
    <drawable name="notification_item_background_color_pressed">#ff454545</drawable>
+6 −1
Original line number Diff line number Diff line
@@ -178,6 +178,10 @@ public class BatteryMeterView extends View implements DemoMode {
        super(context, attrs, defStyle);

        final Resources res = context.getResources();
        TypedArray atts = context.obtainStyledAttributes(attrs, R.styleable.BatteryMeterView,
                defStyle, 0);
        final int frameColor = atts.getColor(R.styleable.BatteryMeterView_frameColor,
                res.getColor(R.color.batterymeter_frame_color));
        TypedArray levels = res.obtainTypedArray(R.array.batterymeter_color_levels);
        TypedArray colors = res.obtainTypedArray(R.array.batterymeter_color_values);

@@ -189,12 +193,13 @@ public class BatteryMeterView extends View implements DemoMode {
        }
        levels.recycle();
        colors.recycle();
        atts.recycle();
        mShowPercent = ENABLE_PERCENT && 0 != Settings.System.getInt(
                context.getContentResolver(), "status_bar_show_battery_percent", 0);
        mWarningString = context.getString(R.string.battery_meter_very_low_overlay_symbol);

        mFramePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mFramePaint.setColor(res.getColor(R.color.batterymeter_frame_color));
        mFramePaint.setColor(frameColor);
        mFramePaint.setDither(true);
        mFramePaint.setStrokeWidth(0);
        mFramePaint.setStyle(Paint.Style.FILL_AND_STROKE);