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

Commit 6d66ad20 authored by Xiaowen Lei's avatar Xiaowen Lei
Browse files

Fix issue in RTL where swipes on Launcher Smartspace are intercepted.

The `+ getScrollX()` translation is a duplicate, because
`mapCoordInSelfToDescendant` also does it internally. Same for the `+
getScrollY()`.

This wasn't an issue in LTR because the top left corner of the root view
is the same as the top left corner of the first page.  `getScrollX()`
returns 0 in that case.

In RTL, the second page is to the left of the first page. If the touch
is on the first page, `+ getScrollX()` translates it outside of the
first page. This incorrectly sets mIsEventOverFirstPagePinnedItem to
false, leading to the swipe being intercepted.

Bug: 240380590
Fix: 240380590
Test: manual
Change-Id: I51f534695401ce527da8d2158130a4d54b086f3d
parent 793c3715
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -1074,13 +1074,14 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
        mXDown = ev.getX();
        mYDown = ev.getY();
        if (mFirstPagePinnedItem != null) {
            mTempFXY[0] = mXDown + getScrollX();
            mTempFXY[1] = mYDown + getScrollY();
            Utilities.mapCoordInSelfToDescendant(mFirstPagePinnedItem, this, mTempFXY);
            mIsEventOverFirstPagePinnedItem = mFirstPagePinnedItem.getLeft() <= mTempFXY[0]
                    && mFirstPagePinnedItem.getRight() >= mTempFXY[0]
                    && mFirstPagePinnedItem.getTop() <= mTempFXY[1]
                    && mFirstPagePinnedItem.getBottom() >= mTempFXY[1];
            final float[] tempFXY = new float[2];
            tempFXY[0] = mXDown;
            tempFXY[1] = mYDown;
            Utilities.mapCoordInSelfToDescendant(mFirstPagePinnedItem, this, tempFXY);
            mIsEventOverFirstPagePinnedItem = mFirstPagePinnedItem.getLeft() <= tempFXY[0]
                    && mFirstPagePinnedItem.getRight() >= tempFXY[0]
                    && mFirstPagePinnedItem.getTop() <= tempFXY[1]
                    && mFirstPagePinnedItem.getBottom() >= tempFXY[1];
        } else {
            mIsEventOverFirstPagePinnedItem = false;
        }