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

Commit 04d97618 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12937884 from 8fd6862d to 25Q2-release

Change-Id: Ibee46caff9df2baf01a28e2af85597f3d6101757
parents a364be53 8fd6862d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ public class FastBitmapDrawable extends Drawable implements Drawable.Callback {

    private Drawable mBadge;

    private boolean mHoverScaleEnabledForDisplay = true;

    public FastBitmapDrawable(Bitmap b) {
        this(b, Color.TRANSPARENT);
    }
@@ -254,7 +256,9 @@ public class FastBitmapDrawable extends Drawable implements Drawable.Callback {
            if (s == android.R.attr.state_pressed) {
                isPressed = true;
                break;
            } else if (sFlagHoverEnabled && s == android.R.attr.state_hovered) {
            } else if (sFlagHoverEnabled
                    && s == android.R.attr.state_hovered
                    && mHoverScaleEnabledForDisplay) {
                isHovered = true;
                // Do not break on hovered state, as pressed state should take precedence.
            }
@@ -414,6 +418,10 @@ public class FastBitmapDrawable extends Drawable implements Drawable.Callback {
        sFlagHoverEnabled = isFlagHoverEnabled;
    }

    public void setHoverScaleEnabledForDisplay(boolean hoverScaleEnabledForDisplay) {
        mHoverScaleEnabledForDisplay = hoverScaleEnabledForDisplay;
    }

    public static class FastBitmapConstantState extends ConstantState {
        protected final Bitmap mBitmap;
        protected final int mIconColor;