You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 2 recyclerview adapters that are of same class, for example:
val firstAdapter: SomeAdapter
val secondAdapter: SomeAdapter
Lets take, that firstAdapter have 100 values, and secondAdapter has 0 values. Lets also take that first adapter is visible. To produce a bug:
Remove element from firstAdapter and add to secondAdapter.
Make secondAdapter visible via recyclerView.swapAdapter(secondAdapter) or recyclerView.setAdapter(secondAdapter)
An Exception is thrown:
ava.lang.IllegalArgumentException: you can't move above of maxItemCount
at com.beloo.widget.chipslayoutmanager.layouter.AbstractPositionIterator.move(AbstractPositionIterator.java:17)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.fillWithLayouter(ChipsLayoutManager.java:852)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.fill(ChipsLayoutManager.java:815)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.onLayoutChildren(ChipsLayoutManager.java:719)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3693)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3410)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3962)
However, if you use recyclerView.scrollToPosition(0) and then swapAdapters - everything works fine.
The text was updated successfully, but these errors were encountered:
Greetings,
I have 2 recyclerview adapters that are of same class, for example:
val firstAdapter: SomeAdapter
val secondAdapter: SomeAdapter
Lets take, that firstAdapter have 100 values, and secondAdapter has 0 values. Lets also take that first adapter is visible. To produce a bug:
ava.lang.IllegalArgumentException: you can't move above of maxItemCount
at com.beloo.widget.chipslayoutmanager.layouter.AbstractPositionIterator.move(AbstractPositionIterator.java:17)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.fillWithLayouter(ChipsLayoutManager.java:852)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.fill(ChipsLayoutManager.java:815)
at com.beloo.widget.chipslayoutmanager.ChipsLayoutManager.onLayoutChildren(ChipsLayoutManager.java:719)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3693)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3410)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3962)
However, if you use recyclerView.scrollToPosition(0) and then swapAdapters - everything works fine.
The text was updated successfully, but these errors were encountered: