JakeWharton / ViewPagerIndicator

Paging indicator widgets compatible with the ViewPager from the Android Support Library and ActionBarSherlock.
http://viewpagerindicator.com
10.14k stars 4.01k forks source link

Issue with ScrollView #190

Closed juliocbcotta closed 11 years ago

juliocbcotta commented 11 years ago

Hi, I think I found an issue while using the ViewPager and CirclePageIndicator inside a ScrollView. The ScrollView and the ViewPager fight by the control of the Gesture and the result is the ViewPager does not work properly. After some research I found that adding the line " mViewPager.getParent().requestDisallowInterceptTouchEvent(true);" to

@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
    mCurrentPage = position;
    mPageOffset = positionOffset;
    mViewPager.getParent().requestDisallowInterceptTouchEvent(true);
    invalidate();

    if (mListener != null) {
        mListener.onPageScrolled(position, positionOffset, positionOffsetPixels);
    }
}

make the CirclePageIndicator (probable in the others PageIndicators) make it work nicely. However I don't know how it affects the ScrollView behavior. Thanks for your attention.

juliocbcotta commented 11 years ago

The solution above disables the vertical scroll the in the ViewPager, a better solution isshown here http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling

Please close this issue.