Skip to content
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

ShimmerRecyclerView does not support setReverseLayout and stackFromEnd appropriately #39

Open
Cylix opened this issue Jul 20, 2018 · 2 comments

Comments

@Cylix
Copy link

Cylix commented Jul 20, 2018

Thanks a lot for the hard work and the great library and sorry for the 2 issues opened in a short time!

Another thing I noticed is some incorrect scrolling behavior when using setReverseLayout and stackFromEnd.

One of the major places we tried to use ShimmerRecyclerView is inside a chat fragment.
The logic in this part is particularly complex concerning the scrolling part and we have to combine several settings of a RecyclerView, as well as doing some additional handling on top of it, to have an appropriate scrolling experience.

One of the things we have done is to combine setReverseLayout and stackFromEnd settings on a RecyclerView for some complex reasons.
However, when switching to ShimmerRecyclerView and keeping the exact same logic, the scrolling behavior is broken and I could not make it work accordingly.
One of the major issue is that it seems to always scroll to the top after loading items, even when forcing some scroll to the bottom.

Both this issue and #38 are not so critical for our project, to be honest.
Our alternative is to have both a RecyclerView and a ShimmerRecyclerView in our layout and to display the ShimmerRecyclerView with the shimmer effect enabled during loading, and to hide it in profit of the RecyclerView when items are loaded (the recyclerview being in charge of displaying the items, thus avoiding these issues).
However, would definitely be a nice to have to simply have the ShimmerRecyclerView and toggle the effect when necessary, rather than using both ShimmerRecyclerView and RecyclerView and switching between and the other.

@veghtomi
Copy link
Collaborator

@Cylix thanks for reporting the issue, we will check it soon!

sharish added a commit that referenced this issue Aug 7, 2018
- Made demo app to open LIST only page
- Made main page to have two buttons to show normal and shimmer recycler view
- Made changes to support stackEnd and reverseLayout on shimmer view
@sharish
Copy link
Owner

sharish commented Aug 7, 2018

@Cylix Thanks for raising the issue. Not an expert with both fromStackEnd and setReverseLayout but tried setting up the project as per your mentioned scenarios but to get no luck.

Here is my set up

  • Made two activities - one with normal RecyclerView and other with ShimmerRecyclerView
  • Both are LinearLayoutManager type
  • Enabled reverseLayout and fromStackEnd for the views
  • Made only one element to appear to check fromStackEnd
  • Fixed the card size to check reverseLayout

Both the activities showing the element from the top and from the left and I'm unable to infer how fromStackEnd and reverseLayout works

All my changes are in bug_39_no_rev_support and I would be glad if you set up the project to reproduce the issue. You can send PRs to the same branch.

Thanks,
Harish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants