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

Commit 4a0e7411 authored by Evan Laird's avatar Evan Laird Committed by android-build-merger
Browse files

Merge "Fix mobile signal colors to match wifi et al" into oc-dr1-dev am: ed4d5fc9

am: d0ee6987

Change-Id: I4e67ee75df6c53cf6a8133dc44cdb97dc9ab1a24
parents e38db1b9 d0ee6987
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -16,12 +16,14 @@ package com.android.systemui.qs;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.service.quicksettings.Tile;
import android.widget.ImageView;

import com.android.settingslib.Utils;
import com.android.systemui.R;
import com.android.systemui.plugins.qs.QSTile.Icon;
import com.android.systemui.plugins.qs.QSTile.State;
import com.android.systemui.qs.tileimpl.QSTileImpl;
import com.android.systemui.statusbar.phone.SignalDrawable;

import java.util.Objects;
@@ -35,7 +37,8 @@ public class CellTileView extends SignalTileView {
    public CellTileView(Context context) {
        super(context);
        mSignalDrawable = new SignalDrawable(mContext);
        mSignalDrawable.setDarkIntensity(isDark(mContext));
        mSignalDrawable.setColors(QSTileImpl.getColorForState(context, Tile.STATE_UNAVAILABLE),
                QSTileImpl.getColorForState(context, Tile.STATE_ACTIVE));
        mSignalDrawable.setIntrinsicSize(context.getResources().getDimensionPixelSize(
                R.dimen.qs_tile_icon_size));
    }
@@ -48,10 +51,6 @@ public class CellTileView extends SignalTileView {
        }
    }

    private static int isDark(Context context) {
        return Utils.getColorAttr(context, android.R.attr.colorForeground) == 0xff000000 ? 1 : 0;
    }

    public static class SignalIcon extends Icon {

        private final int mState;
@@ -68,7 +67,8 @@ public class CellTileView extends SignalTileView {
        public Drawable getDrawable(Context context) {
            //TODO: Not the optimal solution to create this drawable
            SignalDrawable d = new SignalDrawable(context);
            d.setDarkIntensity(isDark(context));
            d.setColors(QSTileImpl.getColorForState(context, Tile.STATE_UNAVAILABLE),
                    QSTileImpl.getColorForState(context, Tile.STATE_ACTIVE));
            d.setLevel(getState());
            return d;
        }
+5 −0
Original line number Diff line number Diff line
@@ -199,6 +199,11 @@ public class SignalDrawable extends Drawable {
        return true;
    }

    public void setColors(int background, int foreground) {
        mPaint.setColor(background);
        mForegroundPaint.setColor(foreground);
    }

    public void setDarkIntensity(float darkIntensity) {
        if (darkIntensity == mOldDarkIntensity) {
            return;