-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Difficulty controlling position/state #195
Comments
It looks like both scenarios are caused by the same bug - when |
I rethought relationship between [Drawable#setVisible()](https://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html#setVisible%28boolean, boolean%29) (behavior of
So to sum up PS gd.stop();
gd.seekToFrameAndGet(gd.getNumberOfFrames() - 1);
gifImageView.setImageDrawable(gd); or even this: GifDrawable gd = new GifDrawable(mContext.getAssets(), file);
gd.stop();
imageView.setImageBitmap(gd.seekToFrameAndGet(gd.getNumberOfFrames() - 1));
|
I'm finding it impossible to control the position (frame) and state (running/stopped) of a gif animation in a listview item. I have multiple states depending on whether an item is sending, sent, or static (for a chat application).
For sending state, I just want to show frame 0 and stop:
but instead it plays despite my calling gd.stop() and/or gd.pause(). perhaps an invalidate causes the animation to continue even though I've set it to stop?
Sent state works and plays fine (I wish there was a completion callback).
For static state, it should show final frame, but I get a blip until the final frame, as though it's playing a few frames prior, then stops or plays the whole animation uber quick and stops. I can't be sure.
Can you offer any advice or is this a possible bug I've discovered? Thanks.
The text was updated successfully, but these errors were encountered: