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

Commit f056f665 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 nyc-dev

am: d86d3fd7

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

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

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

        return changed;
    }