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-7351: Android: ImageView.images - animated images do not start on load and animating property value incorrect #2349

Merged
merged 1 commit into from
Jun 8, 2012
Merged
Changes from all 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 @@ -69,6 +69,7 @@ public class TiUIImageView extends TiUIView implements OnLifecycleEvent, Handler
private Loader loader;
private Thread loaderThread;
private AtomicBoolean animating = new AtomicBoolean(false);
private AtomicBoolean isLoading = new AtomicBoolean(false);
private AtomicBoolean isStopping = new AtomicBoolean(false);
private boolean reverse = false;
private boolean paused = false;
Expand Down Expand Up @@ -363,7 +364,7 @@ public void run()
return;
}
repeatIndex = 0;
animating.set(true);
isLoading.set(true);
firedLoad = false;
topLoop: while (isRepeating()) {

Expand Down Expand Up @@ -397,9 +398,11 @@ public void run()
Log.w(LCAT, "Interrupted from paused state.");
}
}
if (!animating.get()) {

if (!isLoading.get() || isStopping.get()) {
break topLoop;
}

waitTime = 0;
synchronized (releasedLock) {
if (imageSources == null || j >= imageSources.size()) {
Expand Down Expand Up @@ -434,7 +437,7 @@ public void run()
}

}
animating.set(false);
isLoading.set(false);
}

public ArrayBlockingQueue<BitmapWithIndex> getBitmapQueue()
Expand Down Expand Up @@ -569,16 +572,15 @@ public void handleStart()
}
}


animator = new Animator(loader);
if (!animating.get() && !loaderThread.isAlive()) {
isStopping.set(false);
loaderThread.start();
}


int duration = (int) getDuration();

animating.set(true);
fireStart();
timer.schedule(animator, duration, duration);
} else {
Expand Down