Prevent Swiping of ViewPager2 when onTouch of inner view
问题 I have a ViewPager2 with a fragment inside, in the fragment, I have a custom view with certain touch logic that involves moving the finger. how do I prevent the ViewPager from swiping while the inner view intercepts the touch event? override fun onTouchEvent(event: MotionEvent?): Boolean { if (event?.action == MotionEvent.ACTION_DOWN || event?.action == MotionEvent.ACTION_MOVE) { //Do some stuff here } return true } while swiping this view the view pager still swipes to other pages. 回答1: Set