Created
October 23, 2018 00:55
-
-
Save worker8/95a5f1133eb6dbc3ba67b2a2f563542b 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
override fun onTouchEvent(event: MotionEvent): Boolean { | |
// swapping the motionEvent's x and y, so that when finger moves right, it becomes moving down | |
// for VerticalViewPager effect | |
event.swapXY() | |
// this portion is used for injection ACTION_DOWN | |
if (firstTime && event.actionMasked == MotionEvent.ACTION_MOVE) { | |
injectActionDown(event) | |
firstTime = false | |
} | |
if (event.actionMasked == MotionEvent.ACTION_UP) { | |
firstTime = true | |
} | |
super.onTouchEvent(event) | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment