Created
August 4, 2014 02:30
-
-
Save ixiyang/46b9f6945727b108cc94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void cancelContentTouch() { | |
final long now = SystemClock.uptimeMillis(); | |
final MotionEvent cancelEvent = MotionEvent.obtain(now, now, MotionEvent.ACTION_CANCEL, 0.0f, 0.0f, 0); | |
final int childCount = getChildCount(); | |
for (int i = 0; i < childCount; i++) { | |
getChildAt(i).dispatchTouchEvent(cancelEvent); | |
} | |
mContentContainer.dispatchTouchEvent(cancelEvent); | |
cancelEvent.recycle(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment