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

Commit 725308d0 authored by George Mount's avatar George Mount Committed by android-build-merger
Browse files

Merge "Set the hover state to the same as focus state in RippleDrawable." into...

Merge "Set the hover state to the same as focus state in RippleDrawable." into nyc-dev am: d86d3fd7
am: f056f665

* commit 'f056f665':
  Set the hover state to the same as focus state in RippleDrawable.
parents 76ab6f97 f056f665
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -251,6 +251,7 @@ public class RippleDrawable extends LayerDrawable {
        boolean enabled = false;
        boolean enabled = false;
        boolean pressed = false;
        boolean pressed = false;
        boolean focused = false;
        boolean focused = false;
        boolean hovered = false;


        for (int state : stateSet) {
        for (int state : stateSet) {
            if (state == R.attr.state_enabled) {
            if (state == R.attr.state_enabled) {
@@ -259,11 +260,13 @@ public class RippleDrawable extends LayerDrawable {
                focused = true;
                focused = true;
            } else if (state == R.attr.state_pressed) {
            } else if (state == R.attr.state_pressed) {
                pressed = true;
                pressed = true;
            } else if (state == R.attr.state_hovered) {
                hovered = true;
            }
            }
        }
        }


        setRippleActive(enabled && pressed);
        setRippleActive(enabled && pressed);
        setBackgroundActive(focused || (enabled && pressed), focused);
        setBackgroundActive(hovered || focused || (enabled && pressed), focused || hovered);


        return changed;
        return changed;
    }
    }