question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why refresh the data when RecyclerView slides into the middle

See original GitHub issue

mDatas.clear(); mDatas.addAll(photoList); mController.setData(mDatas);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
e-haicommented, May 9, 2017

Thanks for the answer.Because i do not need animation,so add code:

   recyclerView.setItemAnimator(null);

Solved my question! 👍

1reaction
fobidlimcommented, Dec 21, 2018

I had same issue on 2.16.3

recyclerView.setItemAnimator(null);

Above codes not working on me.

But I resolve issue with this code:

epoxy_recycler_view.post { epoxy_recycler_view.scrollToPosition(position) }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Refreshing data in RecyclerView and keeping its scroll position
RecyclerView always holds the last position scrolled, therefore you don't have to store last position, just call notifydatasetchanged, recycler view always ...
Read more >
Update recycler view content without refreshing the data.
Sometimes we need to update the content of the RecyclerView cells, the ViewHolders, but we don't want to add more information to our...
Read more >
Pull to Refresh with RecyclerView in Android with Example
Whenever onRefresh() method is called the ArrayList data gets rearranged. A sample GIF is given below to get an idea about what we...
Read more >
RecyclerView.Adapter - Android Developers
Called by RecyclerView to display the data at the specified position. This method should update the contents of the itemView to reflect the...
Read more >
Intermediate RecyclerView Tutorial with Kotlin
That method will allow animations to occur for the rows around the deleted row because it tells RecyclerView exactly how the data in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found