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

Commit 03ab0c72 authored by Joe Onorato's avatar Joe Onorato
Browse files

some touch event debugging

Change-Id: I05d69da4db8c03f9c5131cd271bd9ee1b4996ca9
parent 67ba204a
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -129,6 +129,16 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
    private int[] mTmpPointerIds;
    private MotionEvent.PointerCoords[] mTmpPointerCoords;

    // For debugging only.  You can see these in hierarchyviewer.
    @ViewDebug.ExportedProperty(category = "events")
    private long mLastTouchDownTime;
    @ViewDebug.ExportedProperty(category = "events")
    private int mLastTouchDownIndex = -1;
    @ViewDebug.ExportedProperty(category = "events")
    private float mLastTouchDownX;
    @ViewDebug.ExportedProperty(category = "events")
    private float mLastTouchDownY;

    /**
     * Internal flags.
     *
@@ -1157,6 +1167,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                        resetCancelNextUpFlag(child);
                        if (dispatchTransformedTouchEvent(ev, false, child, idBitsToAssign)) {
                            // Child wants to receive touch within its bounds.
                            mLastTouchDownTime = ev.getDownTime();
                            mLastTouchDownIndex = i;
                            mLastTouchDownX = ev.getX();
                            mLastTouchDownY = ev.getY();
                            newTouchTarget = addTouchTarget(child, idBitsToAssign);
                            alreadyDispatchedToNewTouchTarget = true;
                            break;
@@ -2805,6 +2819,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            }
            children[index] = child;
            mChildrenCount++;
            if (mLastTouchDownIndex >= index) {
                mLastTouchDownIndex++;
            }
        } else {
            throw new IndexOutOfBoundsException("index=" + index + " count=" + count);
        }
@@ -2825,6 +2842,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        } else {
            throw new IndexOutOfBoundsException();
        }
        if (mLastTouchDownIndex == index) {
            mLastTouchDownTime = 0;
            mLastTouchDownIndex = -1;
        } else if (mLastTouchDownIndex > index) {
            mLastTouchDownIndex--;
        }
    }

    // This method also sets the children's mParent to null