Back to project page ScienceQuiz.
The source code is released under:
GNU General Public License
If you think the Android project ScienceQuiz 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.finger.sciencequiz; // w w w . j a v a 2 s . co m import android.content.Context; import android.content.res.TypedArray; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.view.MotionEvent; public class GalleryViewPager extends ViewPager { public boolean swipeable; public GalleryViewPager (Context context, AttributeSet attrs) { super (context, attrs); TypedArray a = context.obtainStyledAttributes (attrs, R.styleable.GalleryViewPager); try { swipeable = a.getBoolean (R.styleable.GalleryViewPager_swipeable, true); } finally { a.recycle (); } } @Override public boolean onInterceptTouchEvent (MotionEvent event) { return swipeable ? super.onInterceptTouchEvent (event) : false; } @Override public boolean onTouchEvent (MotionEvent event) { return swipeable ? super.onTouchEvent (event) : false; } }