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

Commit ed4d5fc9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents cf70671a 5e43f2dd
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;