mViewPager.setOnTouchListener(new View.OnTouchListener() {
private float oldX;
public boolean onTouch(View arg0, MotionEvent arg1) {
if (arg1.getAction() == MotionEvent.ACTION_DOWN) {
oldX = arg1.getX();
}
if (arg1.getAction() == MotionEvent.ACTION_MOVE) {
return (mViewPager.getCurrentItem() == 0 || arg1.getX() <= oldX);
}
return false;
}
});