Android Open Source - PECSMobile Enableable View Pager






From Project

Back to project page PECSMobile.

License

The source code is released under:

GNU General Public License

If you think the Android project PECSMobile listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.jjoseba.pecsmobile.ui;
/*from ww w . ja  va2 s.  c  o m*/
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * Created by Joseba on 28/12/2014.
 */
public class EnableableViewPager extends ViewPager {

    private boolean pagingEnabled;

    public EnableableViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.pagingEnabled = true;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (this.pagingEnabled) {
            return super.onTouchEvent(event);
        }

        return false;
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (this.pagingEnabled) {
            return super.onInterceptTouchEvent(event);
        }

        return false;
    }

    public void setPagingEnabled(boolean enabled) {
        this.pagingEnabled = enabled;
    }

    public boolean isPagingEnabled(){
        return this.pagingEnabled;
    }
}




Java Source Code List

com.jjoseba.pecsmobile.ApplicationTest.java
com.jjoseba.pecsmobile.CardsPage.java
com.jjoseba.pecsmobile.activity.CardsActivity.java
com.jjoseba.pecsmobile.adapter.CardGridAdapter.java
com.jjoseba.pecsmobile.model.CardPECS.java
com.jjoseba.pecsmobile.ui.EnableableViewPager.java
com.jjoseba.pecsmobile.ui.GridItemClickedListener.java
com.jjoseba.pecsmobile.ui.SmoothScrollerViewPager.java
com.jjoseba.pecsmobile.ui.ZoomOutPageTransformer.java
com.jjoseba.pecsmobile.util.SystemUiHiderBase.java
com.jjoseba.pecsmobile.util.SystemUiHiderHoneycomb.java
com.jjoseba.pecsmobile.util.SystemUiHider.java