castorflex/FlipImageView

FlipImageView in ListView

vishwasdoth opened this issue · 3 comments

I am stuck with this from last 5 days please help. I have a listview and and each row has single image which is basically FlipImageView. Now, list displays properly but issues comes when I swipe list while animation is still running. Say for example I have a list view with 10 items and if click on image in item no. 2 and swipe it instantly and reaches to item no.5 then it shows me no. 8 image animating though I have clicked on row no. 2

At any given point in time my list can show only one item completely because images are little big. To experiment with it I have reduce the image size and tries to reproduce the issue it shows me no. 7 animating.

In fact, I have setonFlipListener on all these images to check whether any of flip callback twice but none of them called twice but it shows animation twice of two different FlipImageView in case of swipe-up or down. To double check, I set duration of animation to 5000ms and swipe-down slowly and I can see that 4th item's FlipAnimation is also animating and sometime it shows image of on one which I originally clicked.

To me it seems some issue with Viewholder pattern because it tries to reuse.

Please help.

Probably due to ListView recycling system. Did you try to call holder.flipimageview.clearAnimation() in the getView() method?

It worked but with little glitch. Say for example I put the duration of around 10 seconds for FlipImage animation and after once animation starts I swipe the list to move animated item out of screen and again swipe back on the same item within 10 seconds assuming that animation will be still going on. But as we already did clearAnimation in getView it stopped.

Not very critical for me but solution might help someone. Thanks for your quick support.

That's a tricky one! But I don't it's the role of the library to handle this. You can do smthing like that:

mImageView.getFlipAnimation(). setStartOffset

Never tried this though