Open aleksandra-majchrzak opened 6 years ago
Similar situation here, the "View v = recycler.getViewForPosition(adapterPosition);" triggers a crash in recyclerView at "mChildHelper.unhide(view);". And saying "view is not a child, cannot hide". This crash happens randomly after scroll and refrsh the list.
Is there a way to remove removal animation from this?
Haha! I found a paliative fix! I know that if you call mAdapter.notifyDataSetChanged while there is an animation ongoing, the animation will stop. So, I did:
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if(actionMode != null) { // If it is in selection mode
adapter.notifyDataSetChanged();
}
}
});
This is only a PALIATIVE FIX. A better solution must be found!
@chennanoka @aleksandra-majchrzak
Currently I just turned off the scroll for this short time when removal animation is ongoing. Not the best solution, but for me it's enough.
any proper solution for this?
hello @aleksandra-majchrzak could you please share how'd you turn off the scroll in your case? thank you
Hi. I don't have the access to that code anymore, but most probably I just created my own LayoutManager like in there: https://stackoverflow.com/questions/30531091/how-to-disable-recyclerview-scrolling and just dynamically change scrolling flag.
In my RecyclerView row I have a button that removes row with default recyclerView slide animation. When I remove a row and during the removal animation I try to swipe the list I get one of below errors (I was not able to determine exactly what action causes which error):
Everything works fine when I wait for the removal animation to end. I use 0.7.6 lib version and I tested it on Xiaomi and Samsung devices. Any hints?