-
-
Save trfiladelfo/f76e73ac5ada0b5118b1c0549f5581a4 to your computer and use it in GitHub Desktop.
android non swipeable viewpager
This file contains hidden or 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
public class NonSwipeableViewPager extends ViewPager { | |
public NonSwipeableViewPager(Context context) { | |
super(context); | |
} | |
public NonSwipeableViewPager(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
@Override | |
public boolean onInterceptTouchEvent(MotionEvent event) { | |
// Never allow swiping to switch between pages | |
return false; | |
} | |
@Override | |
public boolean onTouchEvent(MotionEvent event) { | |
// Never allow swiping to switch between pages | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment