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

Commit ec9c30fd authored by John Spurlock's avatar John Spurlock Committed by Android Git Automerger
Browse files

am 4f111f98: Merge "Revert "Support lights-out + bar icon dimming on low-end devices.""

* commit '4f111f98':
  Revert "Support lights-out + bar icon dimming on low-end devices."
parents 3d47609f 4f111f98
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -37,8 +37,6 @@ public class BarTransitions {
    private static final boolean DEBUG = false;
    private static final boolean DEBUG_COLORS = false;

    public static final boolean HIGH_END = ActivityManager.isHighEndGfx();

    public static final int MODE_OPAQUE = 0;
    public static final int MODE_SEMI_TRANSPARENT = 1;
    public static final int MODE_TRANSLUCENT = 2;
@@ -50,6 +48,7 @@ public class BarTransitions {

    private final String mTag;
    private final View mView;
    private final boolean mSupportsTransitions = ActivityManager.isHighEndGfx();
    private final BarBackgroundDrawable mBarBackground;

    private int mMode;
@@ -58,7 +57,7 @@ public class BarTransitions {
        mTag = "BarTransitions." + view.getClass().getSimpleName();
        mView = view;
        mBarBackground = new BarBackgroundDrawable(mView.getContext(), gradientResourceId);
        if (HIGH_END) {
        if (mSupportsTransitions) {
            mView.setBackground(mBarBackground);
        }
    }
@@ -73,14 +72,14 @@ public class BarTransitions {
        mMode = mode;
        if (DEBUG) Log.d(mTag, String.format("%s -> %s animate=%s",
                modeToString(oldMode), modeToString(mode),  animate));
        if (mSupportsTransitions) {
            onTransition(oldMode, mMode, animate);
        }
    }

    protected void onTransition(int oldMode, int newMode, boolean animate) {
        if (HIGH_END) {
        applyModeBackground(oldMode, newMode, animate);
    }
    }

    protected void applyModeBackground(int oldMode, int newMode, boolean animate) {
        if (DEBUG) Log.d(mTag, String.format("applyModeBackground oldMode=%s newMode=%s animate=%s",
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ public final class NavigationBarTransitions extends BarTransitions {
    }

    private float alphaForMode(int mode) {
        final boolean isOpaque = mode == MODE_OPAQUE || mode == MODE_LIGHTS_OUT || !HIGH_END;
        final boolean isOpaque = mode == MODE_OPAQUE || mode == MODE_LIGHTS_OUT;
        return isOpaque ? KeyButtonView.DEFAULT_QUIESCENT_ALPHA : 1f;
    }

+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
    }

    private boolean isOpaque(int mode) {
        return !(mode == MODE_SEMI_TRANSPARENT || mode == MODE_TRANSLUCENT) || !HIGH_END;
        return !(mode == MODE_SEMI_TRANSPARENT || mode == MODE_TRANSLUCENT);
    }

    @Override