android-listadapter

ListAdapter not refreshing RecyclerView if I submit the same list with different item order

风流意气都作罢 提交于 2019-12-22 10:32:19
问题 I am using a RecyclerView with ListAdapter (which uses AsyncListDiffer to calculate and animate changes when list is replaced). The problem is that if I submit() some list, then re-order that list, and submit() again, nothing happens. How do I force ListAdapter to evaluate this new list, even though it is "the same" (but order has changed)? New findings: I checked source code of submitList() and in the beggining there is a check: public void submitList(@Nullable final List<T> newList) { final

Items in Recyclerview + Listadapter won't redraw on update

人盡茶涼 提交于 2019-12-13 03:32:26
问题 I'm setting up a RecyclerView that uses a ListAdapter to calculate animations on changes. The RecyclerView is receiving data through a ViewModel that fetches a list via Firebase. The items shown are of the Mensa kind. A Mensa item can change its visibility, its occupancy, or the distance displayed. I want to implement two buttons that favorite/hide items, therefore changing their position in the list. Two buttons in every item allow the user to favorite or hide an item. This will move an item

ListAdapter not refreshing RecyclerView if I submit the same list with different item order

时光毁灭记忆、已成空白 提交于 2019-12-05 20:59:49
I am using a RecyclerView with ListAdapter (which uses AsyncListDiffer to calculate and animate changes when list is replaced). The problem is that if I submit() some list, then re-order that list, and submit() again, nothing happens. How do I force ListAdapter to evaluate this new list, even though it is "the same" (but order has changed)? New findings: I checked source code of submitList() and in the beggining there is a check: public void submitList(@Nullable final List<T> newList) { final int runGeneration = ++this.mMaxScheduledGeneration; if (newList != this.mList) { I think this is the