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

Commit 99de2459 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Respect child drawing order when dispatching touch events" into jb-mr1-dev

parents b3655894 a6478a3a
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1723,8 +1723,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            final float x = event.getX();
            final float y = event.getY();

            final boolean customOrder = isChildrenDrawingOrderEnabled();
            for (int i = childrenCount - 1; i >= 0; i--) {
                final View child = children[i];
                final int childIndex = customOrder ? getChildDrawingOrder(childrenCount, i) : i;
                final View child = children[childIndex];
                if (!canViewReceivePointerEvents(child)
                        || !isTransformedTouchPointInView(x, y, child, null)) {
                    continue;
@@ -1851,8 +1853,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                        final float x = ev.getX(actionIndex);
                        final float y = ev.getY(actionIndex);

                        final boolean customOrder = isChildrenDrawingOrderEnabled();
                        for (int i = childrenCount - 1; i >= 0; i--) {
                            final View child = children[i];
                            final int childIndex = customOrder ?
                                    getChildDrawingOrder(childrenCount, i) : i;
                            final View child = children[childIndex];
                            if (!canViewReceivePointerEvents(child)
                                    || !isTransformedTouchPointInView(x, y, child, null)) {
                                continue;
@@ -1870,7 +1875,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                            if (dispatchTransformedTouchEvent(ev, false, child, idBitsToAssign)) {
                                // Child wants to receive touch within its bounds.
                                mLastTouchDownTime = ev.getDownTime();
                                mLastTouchDownIndex = i;
                                mLastTouchDownIndex = childIndex;
                                mLastTouchDownX = ev.getX();
                                mLastTouchDownY = ev.getY();
                                newTouchTarget = addTouchTarget(child, idBitsToAssign);