yuyakaido / CardStackView

📱Tinder like swipeable card view for Android
Apache License 2.0
2.37k stars 448 forks source link

View of card steck breaks after unlocking #238

Closed P1NG2WIN closed 5 years ago

P1NG2WIN commented 5 years ago

After unlocking, the visible cards are superimposed on each other and this disappears after any movement. Does anyone know how to fix this? thank image image

yuyakaido commented 5 years ago

@P1NG2WIN I can't reproduce this issue in my environment. Can you send a sample project that we can reproduce this issue?

P1NG2WIN commented 5 years ago

@yuyakaido

It so happened that I had to roll back my project a few versions back and there is no this bug on the current one, but if it reappears, I will necessarily write

yuyakaido commented 5 years ago

@P1NG2WIN OK, Can you provide the following information when you write another issue?

P1NG2WIN commented 5 years ago

@yuyakaido Ok, I was able to repeat it. For example, this code breaks the cards display.

testCardList.remove(testCard); adapter.notifyItemRemoved(position); adapter.notifyItemRangeChanged(position,adapter.getItemCount()-position);

Xiaomi Redmi Note 4x MIUI Global 10.2 (Android 7.0) Library version 2.3.2 with bug

P1NG2WIN commented 5 years ago

So, this bug is caused by default animations RecyclerView's ItemAnimator so, to fix it, you need to disable it cardStackView.setItemAnimator(null);

This bug is caused every time when standard RecyclerView animations are triggered, for example notifyItemRemoved, notifyItemAdded etc