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

Timob 10207: Kitchensink: ImageViews - Animation gets paused after 4-5 frames and resume occurs leaving 1 frame in between #2697

Merged
merged 4 commits into from
Aug 10, 2012
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,13 @@ public Animator(Loader loader)

public void run()
{
boolean isWakingFromPause = false;
try {

if (paused) {
synchronized (this) {
KrollDict data = new KrollDict();
proxy.fireEvent(TiC.EVENT_PAUSE, data);
isWakingFromPause = true;
wait();
}
}
Expand All @@ -540,6 +541,11 @@ public void run()
Log.d(TAG, "set image: " + b.index, Log.DEBUG_MODE);
setImage(b.bitmap);
fireChange(b.index);

if (isWakingFromPause) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would name this to something less confusing like 'waitExtraFrameOnResume', and also leave a comment on what you are doing here.

Thread.sleep((int) getDuration());
isWakingFromPause = false;
}
} catch (InterruptedException e) {
Log.e(TAG, "Loader interrupted");
}
Expand Down