Loading core/java/android/view/ViewGroup.java +55 −55 Original line number Diff line number Diff line Loading @@ -3093,30 +3093,26 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager */ private boolean dispatchTransformedTouchEvent(MotionEvent event, boolean cancel, View child, int desiredPointerIdBits) { final boolean handled; // Canceling motions is a special case. We don't need to perform any transformations // or filtering. The important part is the action, not the contents. final int oldAction = event.getAction(); if (cancel || oldAction == MotionEvent.ACTION_CANCEL) { try { final boolean handled; if (cancel) { event.setAction(MotionEvent.ACTION_CANCEL); if (child == null) { handled = super.dispatchTouchEvent(event); } else { handled = child.dispatchTouchEvent(event); } event.setAction(oldAction); return handled; } // Calculate the number of pointers to deliver. final int oldPointerIdBits = event.getPointerIdBits(); final int newPointerIdBits = oldPointerIdBits & desiredPointerIdBits; int newPointerIdBits = oldPointerIdBits & desiredPointerIdBits; // If for some reason we ended up in an inconsistent state where it looks like we // might produce a motion event with no pointers in it, then drop the event. // might produce a non-cancel motion event with no pointers in it, then drop the event. // Make sure that we don't drop any cancel events. if (newPointerIdBits == 0) { if (event.getAction() != MotionEvent.ACTION_CANCEL) { return false; } else { newPointerIdBits = oldPointerIdBits; } } // If the number of pointers is the same and we don't need to perform any fancy Loading Loading @@ -3161,6 +3157,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // Done. transformedEvent.recycle(); return handled; } finally { event.setAction(oldAction); } } /** Loading Loading
core/java/android/view/ViewGroup.java +55 −55 Original line number Diff line number Diff line Loading @@ -3093,30 +3093,26 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager */ private boolean dispatchTransformedTouchEvent(MotionEvent event, boolean cancel, View child, int desiredPointerIdBits) { final boolean handled; // Canceling motions is a special case. We don't need to perform any transformations // or filtering. The important part is the action, not the contents. final int oldAction = event.getAction(); if (cancel || oldAction == MotionEvent.ACTION_CANCEL) { try { final boolean handled; if (cancel) { event.setAction(MotionEvent.ACTION_CANCEL); if (child == null) { handled = super.dispatchTouchEvent(event); } else { handled = child.dispatchTouchEvent(event); } event.setAction(oldAction); return handled; } // Calculate the number of pointers to deliver. final int oldPointerIdBits = event.getPointerIdBits(); final int newPointerIdBits = oldPointerIdBits & desiredPointerIdBits; int newPointerIdBits = oldPointerIdBits & desiredPointerIdBits; // If for some reason we ended up in an inconsistent state where it looks like we // might produce a motion event with no pointers in it, then drop the event. // might produce a non-cancel motion event with no pointers in it, then drop the event. // Make sure that we don't drop any cancel events. if (newPointerIdBits == 0) { if (event.getAction() != MotionEvent.ACTION_CANCEL) { return false; } else { newPointerIdBits = oldPointerIdBits; } } // If the number of pointers is the same and we don't need to perform any fancy Loading Loading @@ -3161,6 +3157,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // Done. transformedEvent.recycle(); return handled; } finally { event.setAction(oldAction); } } /** Loading