diff --git a/api/current.xml b/api/current.xml
index 619b2573d5235..ebb8b3e19f6f8 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -19870,6 +19870,17 @@
visibility="public"
>
+
+
+
+
extends Animatable {
@Override
public void end() {
+ if (!sAnimations.contains(this) &&
+ (Thread.currentThread() == Looper.getMainLooper().getThread())) {
+ // Special case if the animation has not yet started. Set the end value.
+ long endTime = mDuration;
+ if (mRepeatCount > 0) {
+ endTime += mRepeatCount * mDuration;
+ }
+ setCurrentPlayTime(endTime);
+ }
// Just set the ENDED flag - this causes the animation to end the next time a frame
// is processed.
mPlayingState = ENDED;
}
- /**
- * Returns whether this Animator is currently running (having been started and not yet ended).
- * @return Wehther the Animator is running.
- */
+ @Override
public boolean isRunning() {
return mPlayingState == RUNNING;
}
@@ -737,6 +743,7 @@ public class Animator extends Animatable {
*/
private void endAnimation() {
sAnimations.remove(this);
+ mPlayingState = STOPPED;
if (mListeners != null) {
ArrayList tmpListeners =
(ArrayList) mListeners.clone();
@@ -744,7 +751,6 @@ public class Animator extends Animatable {
listener.onAnimationEnd(this);
}
}
- mPlayingState = STOPPED;
}
/**
diff --git a/core/java/android/animation/Sequencer.java b/core/java/android/animation/Sequencer.java
index 77494290f9e4b..a9e4e3bbf7ddd 100644
--- a/core/java/android/animation/Sequencer.java
+++ b/core/java/android/animation/Sequencer.java
@@ -240,6 +240,21 @@ public final class Sequencer extends Animatable {
}
}
+ /**
+ * Returns true if any of the child animations of this Sequencer have been started and have not
+ * yet ended.
+ * @return Whether this Sequencer has been started and has not yet ended.
+ */
+ @Override
+ public boolean isRunning() {
+ for (Node node : mNodes) {
+ if (node.animation.isRunning()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* {@inheritDoc}
*
@@ -467,14 +482,10 @@ public final class Sequencer extends Animatable {
public void onAnimationEnd(Animatable animation) {
animation.removeListener(this);
mPlayingSet.remove(animation);
- Node animNode = mSequencer.mNodeMap.get(animation);
- animNode.done = true;
ArrayList sortedNodes = mSequencer.mSortedNodes;
- int numNodes = sortedNodes.size();
- int nodeIndex = sortedNodes.indexOf(animNode);
boolean allDone = true;
- for (int i = nodeIndex + 1; i < numNodes; ++i) {
- if (!sortedNodes.get(i).done) {
+ for (Node node : sortedNodes) {
+ if (node.animation.isRunning()) {
allDone = false;
break;
}
@@ -558,7 +569,6 @@ public final class Sequencer extends Animatable {
}
}
}
- node.done = false; // also reset done flag
}
}
}
@@ -625,13 +635,6 @@ public final class Sequencer extends Animatable {
*/
public ArrayList nodeDependents = null;
- /**
- * Flag indicating whether the animation in this node is finished. This flag
- * is used by Sequencer to check, as each animation ends, whether all child animations
- * are done and it's time to send out an end event for the entire Sequencer.
- */
- public boolean done = false;
-
/**
* Constructs the Node with the animation that it encapsulates. A Node has no
* dependencies by default; dependencies are added via the addDependency()
diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java
index 0e3522e7a0d64..2f7482c2f15d4 100644
--- a/core/java/android/text/TextLine.java
+++ b/core/java/android/text/TextLine.java
@@ -75,7 +75,7 @@ class TextLine {
}
}
tl = new TextLine();
- Log.e("TLINE", "new: " + tl);
+ Log.v("TLINE", "new: " + tl);
return tl;
}