diff --git a/src/org/ntlab/animations/MagnetRONAnimation.java b/src/org/ntlab/animations/MagnetRONAnimation.java index 151fea1..42379dd 100644 --- a/src/org/ntlab/animations/MagnetRONAnimation.java +++ b/src/org/ntlab/animations/MagnetRONAnimation.java @@ -179,6 +179,8 @@ STOPPED } +// private static int animationCount = 0; + /** * The constructor of {@code MagnetRONAnimation}. * @@ -362,12 +364,16 @@ updateCurrentCycle(getCurrentCycleCount()); jumpTo(getCurrentCycleCount()); } else if(Math.abs(getCurrentCycleCount()) >= Math.abs(getTotalCycleCount())){ +// animationCount = 0; +// System.out.println(TAG + ": animationCount=" + animationCount); onFinished(); } } }, getInitialDelay(), getDelay(), TimeUnit.MILLISECONDS); setScheduledFuture(scheduledFuture); setCurrentStatus(Status.RUNNING); +// animationCount = 1; +// System.out.println(TAG + ": animationCount=" + animationCount); }; break; case PAUSED: @@ -382,6 +388,22 @@ }; } +// public static void waitAnimationEnd() { +// while (animationCount > 0) { +// try { +// Thread.sleep(1L); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// } +// // Buffer for another waiting animation. +// try { +// Thread.sleep(30L); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// } + public void syncPlay() { if (getCurrentStatus() == Status.STOPPED) { try {