Skip to content

Instantly share code, notes, and snippets.

@ishitcno1
Created April 14, 2015 09:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ishitcno1/294e9e51d683d133cbb2 to your computer and use it in GitHub Desktop.
Save ishitcno1/294e9e51d683d133cbb2 to your computer and use it in GitHub Desktop.
android non swipeable viewpager
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;
}
}
@muslimmuda15
Copy link

That's very great...

@Abhinandan-Chada
Copy link

Awesome.....Nice Work

@asifashraf270
Copy link

Excellent Work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment