-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PagingLibrary and NestedScrollView problem. #215
Comments
sadly I didn't find soultion when I was delevoping this case. |
Hi there! But in case you have 2 RecyclerViews in your layout you may want to scroll entire page (containing 2 recycler views). And don't forget to add android:fillViewport="true" to scrollable container |
@danaimset it works like magic! But, for those who will use this trick, don't forget to set |
Thanks @edwardstock , recyclerview.setNestedScrollingEnabled(true) is worked for me. You save my time. |
Hi there, |
@nerrydanna Did you find any solution for the problem. I am having the same problem every view in the layout sits at the same position and only a small portion of recycler view which is visible on the screen is getting scrolled. If you have found any solution for this issue please help me. |
@abhishekhugetech I couldn’t find a solution for it but i’ve used another way. I’ve used CoordinatorLayout with CollapsingToolBar containing the views you want to scroll and set collapsing mode to “none” to get scrolling behavior |
@abhishekhugetech @nerrydanna I am facing the same issue. If you found any solution, that will be helpful |
my solution is NestedScrollView -> CoordinatorLayout it's work!! |
If you're using collapsing toolbar then if you're scrolling with high velocity you'll probably notice the paged list scrolled under collapsing toolbar. |
@danaimset nice workaround but then you can't setup scrollbar :( + sometimes on fast scroll the Appbar recyclerview gets stuck |
@iAmMONK there are still a lot of issues.... I've just finished another sample based on PagedListEpoxyController. It looks very promising |
@danaimset Oh wow, If you could share a sample that would be great ! |
I have also created another issue for RV already. If the Paging Team says it's not their problem, then maybe RV team can fix it ? https://issuetracker.google.com/issues/145110710 Note: If you star the issues, they might move faster ;) |
Unfortunately I didn't have a chance to prepare my own sample but I'm pleased to share with you a good article how to setup epoxy paged list controller: You can override addModels if you want to add any blocks you need. For ex.:
|
This issue isn't related to these samples. Feel free to read through the issue on the issue tracker. |
Based on Android documentation:
The best new way is to use MergeAdapter. It added to Recyclerview v1.2.0alpha. So add this dependency:
If you want to put two Adapters in one recyclerView, follow this Guide:then make an instance of MakeAdapter and pass your adapters on it then set it as RecyclerViewAdapter:
If you have a layout and Pagedlist, follow this guide:Then Make and Simple ViewHolder and put the first layout on it. Then make MergeAdapter then add your layout's adapter and then PagedList's adapter, then add adapter of PagedList:
then set this mergeAdapter to recyclerView's adapter;
|
Same problem here, someone solution to use recyclerview +NestedScrollView + Pagin Library ? |
please don't do it. |
@allefsousa Why do you still need NestedScrollView if you're using single RecyclerView with MergeAdapter? I guess that you don't need outer NestedScrollView If you're using MergeAdapter. |
Today I have a structure like this:
I will evaluate using the merge adapter. |
@allefsousa So from the answer #215 (comment) You will have single RecyclerView with MergeAdapter MergeAdapter should contain the following adapters:
Seems that it should work |
@danaimset Problem solved using merge adapter and only a recyclerview. However, I did not use the paging library because there was the same error reported by @Smatek94. |
Okey I found a solution for this, different from all of the above, it's a little bit odd but it's worked perfectly. |
No working for me |
On replacing NestedScrollView with SmartNestedScrollView |
What exactly does not working?
|
@edwardstock let me show you my code |
@edwardstock
</androidx.constraintlayout.widget.ConstraintLayout>` |
@edwardstock I just replace NestedScrollView with SmartNestedScrollView |
Try to add to the |
@sagarkhurana00786 In case it's not working make sure you have only one recycler view under SmartNestedScrollView. It wraps only single recycler view (first available). |
@danaimset oh! now I know why it is not working and it is working for only one recyclerview and even second one is also now showing all data |
Well, cause you have recycler views with different layout managers using MergeAdapter may be a problem. If you want to use Epoxy do the following with your top recycler view: |
|
If you want to have the entire page scroll, check this approach: |
@smartsatu I think that's now a good solution |
Still no solutions? |
When developing my application I was using PagingLibrary. It was working perfect.
However at some point I decided to wrap my RecyclerView into NestedScrollView. Problem is that when I have done it, function that was responsible for loading data (loadIinitial from KeyedDataSource class) was being called till it loaded all data instead of only one page. Without NestedScrollView it is loading pages well. I tried using setNestedScrollingEnabled(false) or with true but it didn't helped.
The text was updated successfully, but these errors were encountered: