yuyakaido / CardStackView

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

onBindViewHolder invoked frequently when drag the card #176

Closed IsnoneTy closed 5 years ago

IsnoneTy commented 5 years ago

CardStackLayoutManager use removeAndRecycleAllViews(recycler) in update(RecyclerView.Recycler recycler)

vphuong1205 commented 5 years ago

I think avoid nested layouts in your item_spot.xml then this issue will be gone :)

rossica commented 5 years ago

I have this same issue. The problem arises because onBindViewHolder invokes Glide to load the image on each call, and that makes the drag animation lag significantly. No nested layout in the card layout. I'll have to roll back to 1.x for the time being.

Pirksy commented 5 years ago

I have the same issue

Pirksy commented 5 years ago

Downgraded to 2.0.0 version and problem gone

chrisrohitbrendan commented 5 years ago

@Pirksy 2.2.0 also works

KuroXII commented 5 years ago

Is there any other way to solve nested layout issue? I downgraded to 2.0.0 but the issue still remain

panekzogen commented 5 years ago

@yuyakaido please review merge #171. removeAndRecycleAllViews(recycler) causes instantiating all views again. Consider to replace it with detachAndScrapAttachedViews(recycler)

yuyakaido commented 5 years ago

@IsnoneTy @vphuong1205 @rossica @Pirksy @chrisrohitbrendan @hockleongloh @taomWTP Sorry for late reply. This issue has been fixed in ver. 2.2.4.

@taomWTP Thank you so much for your helpful advice!