Created
April 14, 2015 09:55
-
-
Save ishitcno1/294e9e51d683d133cbb2 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
Awesome.....Nice Work