baoyongzhang / android-PullRefreshLayout

This component like SwipeRefreshLayout, it is more beautiful than SwipeRefreshLayout.
MIT License
2.07k stars 517 forks source link

Refreshing in RecyclerView inside ViewPager #8

Open magnevox opened 9 years ago

magnevox commented 9 years ago

Hi, I got wrapped ViewPager by your pull refresh which inside generate RecyclerView

<pl.rlesniak.ptr.widget.PullRefreshLayout
       android:id="@+id/refresh_layout"
       android:layout_width="match_parent"
       android:layout_height="wrap_content">

              <android.support.v4.view.ViewPager
                  android:id="@+id/content_container"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"/>

</pl.rlesniak.ptr.widget.PullRefreshLayout>

and I have a problem, when I scroll down everthing is fine, but when I want to get back the pull refresh is appearing. Do you have any solution? Except method mRecyclerView.setOnScrollListener()

onewilk commented 9 years ago

make a class extends viewpager,then override the onInterceptTouchEvent() method... the key point is getParent().requestDisallowInterceptTouchEvent(true) to disallow parentview(pullrefreshlayout)'s touch event... sorry for my poor english...