Example usage for android.support.v4.view ViewPager SCROLL_STATE_SETTLING

List of usage examples for android.support.v4.view ViewPager SCROLL_STATE_SETTLING

Introduction

In this page you can find the example usage for android.support.v4.view ViewPager SCROLL_STATE_SETTLING.

Prototype

int SCROLL_STATE_SETTLING

To view the source code for android.support.v4.view ViewPager SCROLL_STATE_SETTLING.

Click Source Link

Document

Indicates that the pager is in the process of settling to a final position.

Usage

From source file:com.shopify.buy.ui.ProductDetailsFragmentView.java

@Override
public void onPageScrollStateChanged(int state) {
    // Guard against image resizing (fling up/down effect) while the user is scrolling horizontally between images
    if (state == ViewPager.SCROLL_STATE_DRAGGING && !isViewPagerBeingDragged) {
        isViewPagerBeingDragged = true;//from w ww.j a v a2  s . c om
        imagePager.setOnTouchListener(null);
    }
    if ((state == ViewPager.SCROLL_STATE_SETTLING || state == ViewPager.SCROLL_STATE_IDLE)
            && isViewPagerBeingDragged) {
        isViewPagerBeingDragged = false;
        imagePager.setOnTouchListener(imageAreaTouchHandler);
    }
}