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

Commit c6c9d405 authored by Winson Chung's avatar Winson Chung
Browse files

Fix regression in swiping over rotation button.

- Only send the hit target for visible buttons, otherwise we will defer
  starting the recents animation when swiping over them even if they are
  invisible.

Bug: 80320221
Test: Swipe up over hidden rotation button, ensure we don't defer the
      animation start

Change-Id: Ie6126eb25ca6cdda1dce2dccec92d83b8aca0563
parent 3d70d20c
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -114,6 +114,10 @@ public class ButtonDispatcher {
        return mVisibility != null ? mVisibility : View.VISIBLE;
        return mVisibility != null ? mVisibility : View.VISIBLE;
    }
    }


    public boolean isVisible() {
        return getVisibility() == View.VISIBLE;
    }

    public float getAlpha() {
    public float getAlpha() {
        return mAlpha != null ? mAlpha : 1;
        return mAlpha != null ? mAlpha : 1;
    }
    }
+5 −4
Original line number Original line Diff line number Diff line
@@ -336,13 +336,14 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
                int x = (int) event.getX();
                int x = (int) event.getX();
                int y = (int) event.getY();
                int y = (int) event.getY();
                mDownHitTarget = HIT_TARGET_NONE;
                mDownHitTarget = HIT_TARGET_NONE;
                if (mBackButtonBounds.contains(x, y)) {
                if (getBackButton().isVisible() && mBackButtonBounds.contains(x, y)) {
                    mDownHitTarget = HIT_TARGET_BACK;
                    mDownHitTarget = HIT_TARGET_BACK;
                } else if (mHomeButtonBounds.contains(x, y)) {
                } else if (getHomeButton().isVisible() && mHomeButtonBounds.contains(x, y)) {
                    mDownHitTarget = HIT_TARGET_HOME;
                    mDownHitTarget = HIT_TARGET_HOME;
                } else if (mRecentsButtonBounds.contains(x, y)) {
                } else if (getRecentsButton().isVisible() && mRecentsButtonBounds.contains(x, y)) {
                    mDownHitTarget = HIT_TARGET_OVERVIEW;
                    mDownHitTarget = HIT_TARGET_OVERVIEW;
                } else if (mRotationButtonBounds.contains(x, y)) {
                } else if (getRotateSuggestionButton().isVisible()
                        && mRotationButtonBounds.contains(x, y)) {
                    mDownHitTarget = HIT_TARGET_ROTATION;
                    mDownHitTarget = HIT_TARGET_ROTATION;
                }
                }
                break;
                break;