SolvedPaginate Paginate with Nested Scroll View?
✔️Accepted Answer
I had the same problem and found the solution.
Replace your NestedScrollView with LinearLayout like that:
<LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recycler_view"/>
</LinearLayout>
Don't forget to add app:layout_behavior="@string/appbar_scrolling_view_behavior"
and android:layout_height="wrap_content"
to attributes!
If you use RecyclerView inside NestedScrollView, layout manager can't measure it's height and set it infinite. So paginate will load data until all will be loaded even if you won't scroll the list.
With linear layout the height is measured and paginate will load data only if you scroll to the bottom of list.
Other Answers:
Is this issue solved?? I am also facing problems using pagination in NestedScrollView.
Any solution for this issue yet ?
@MarkoMilos do you have any progress on this?
@4lfant one might need a NestedScrollView if you have more than a RecyclerView on a Layout and you want them to scroll simultaneously.
In such scenario, how does one fix the pagination issue?
Hello, Marko. Thank you very much for the great lib. It's working great for me and you save me a lot of time and effort. I have two fragments. In the first one I have a recycle view only and I use Paginate and it works just great. In the second fragment I have a Nested scroll view like this:
I also tried without:
but the result is the same. I use the same logic in the two places but when it's in the nested scroll view scrolling becomes really slow and finally app just stop working. Without the Paginate it's work fine. Do you have any suggestions for this bug? Thank you very much!
Update: I set a break point and found that with NestedScrollView it enters in the callback infinity times even without scrolling. I hope this can help you finding the problem.
Update 2: The same problem when embedded in a CordinatorLayout.