Back to project page adamsonelearn.
The source code is released under:
MIT License
If you think the Android project adamsonelearn listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jaselogic.adamsonelearn; // ww w . j av a 2 s .c o m import android.content.Context; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; public class NonSwipeViewPager extends ViewPager { public NonSwipeViewPager(Context context) { super(context); // TODO Auto-generated constructor stub } public NonSwipeViewPager(Context context, AttributeSet attrs) { // TODO Auto-generated constructor stub super(context,attrs); } @Override public boolean onInterceptTouchEvent(MotionEvent arg0) { if(getCurrentItem() == 0) return false; return super.onInterceptTouchEvent(arg0); } @Override public boolean onTouchEvent(MotionEvent arg0) { if(getCurrentItem() == 0) return false; return super.onTouchEvent(arg0); } }