Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlipImageView in ListView #6

Closed
vishwasdoth opened this issue Oct 7, 2013 · 3 comments
Closed

FlipImageView in ListView #6

vishwasdoth opened this issue Oct 7, 2013 · 3 comments

Comments

@vishwasdoth
Copy link

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.

@castorflex
Copy link
Owner

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

@vishwasdoth
Copy link
Author

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.

@castorflex
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants