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

Commit b9a12d7b authored by Joe Onorato's avatar Joe Onorato Committed by Android (Google) Code Review
Browse files

Merge changes Ib809d4c5,I05d69da4 into honeycomb

* changes:
  This makes the events at the edge of the screen find the button.
  some touch event debugging
parents e861d00f 641bad44
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
+2 −0
Original line number Diff line number Diff line
@@ -78,6 +78,8 @@ public class KeyButtonView extends ImageView {

        mWindowManager = IWindowManager.Stub.asInterface(
                ServiceManager.getService(Context.WINDOW_SERVICE));

        setClickable(true);
    }

    public boolean onTouchEvent(MotionEvent ev) {