Skip to content

Instantly share code, notes, and snippets.

@jongha
Created May 23, 2019 08:11
Show Gist options
  • Save jongha/d8c410e8908414120a87289d46929763 to your computer and use it in GitHub Desktop.
Save jongha/d8c410e8908414120a87289d46929763 to your computer and use it in GitHub Desktop.
Non Swipeable ViewPager in Android
class NonSwipeableViewPager : ViewPager {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
return false
}
override fun onTouchEvent(event: MotionEvent): Boolean {
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment