summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-02-02 10:41:50 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-02 10:41:50 -0800
commit306eed22e58381bbd694e3a297adc2313cc50c85 (patch)
treef2526552055f585a87d3e2661f00a22e41cd37f0 /core/java
parent14e655f93f76ceb7e933aac4c1a1049ea6ac1e1c (diff)
parent8bcd54b98ad5d98d47364ff14e06910deadf9302 (diff)
downloadframeworks_base-306eed22e58381bbd694e3a297adc2313cc50c85.zip
frameworks_base-306eed22e58381bbd694e3a297adc2313cc50c85.tar.gz
frameworks_base-306eed22e58381bbd694e3a297adc2313cc50c85.tar.bz2
Merge "Use Choreographer for window manager animation timing."
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/Choreographer.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/core/java/android/view/Choreographer.java b/core/java/android/view/Choreographer.java
index 63de128..c86ea77 100644
--- a/core/java/android/view/Choreographer.java
+++ b/core/java/android/view/Choreographer.java
@@ -26,7 +26,7 @@ import android.os.SystemProperties;
import android.util.Log;
/**
- * Coodinates animations and drawing for UI on a particular thread.
+ * Coordinates animations and drawing for UI on a particular thread.
* @hide
*/
public final class Choreographer extends Handler {
@@ -94,8 +94,8 @@ public final class Choreographer extends Handler {
}
/**
- * Gets the choreographer for this thread.
- * Must be called on the UI thread.
+ * Gets the choreographer for the calling thread. Must be called from
+ * a thread that already has a {@link android.os.Looper} associated with it.
*
* @return The choreographer for this thread.
* @throws IllegalStateException if the thread does not have a looper.
@@ -163,6 +163,15 @@ public final class Choreographer extends Handler {
}
/**
+ * Return true if {@link #scheduleAnimation()} has been called but
+ * {@link OnAnimateListener#onAnimate() OnAnimateListener.onAnimate()} has
+ * not yet been called.
+ */
+ public boolean isAnimationScheduled() {
+ return mAnimationScheduled;
+ }
+
+ /**
* Schedules drawing to occur on the next frame synchronization boundary.
* Must be called on the UI thread.
*/
@@ -180,6 +189,15 @@ public final class Choreographer extends Handler {
}
}
+ /**
+ * Return true if {@link #scheduleDraw()} has been called but
+ * {@link OnDrawListener#onDraw() OnDrawListener.onDraw()} has
+ * not yet been called.
+ */
+ public boolean isDrawScheduled() {
+ return mDrawScheduled;
+ }
+
@Override
public void handleMessage(Message msg) {
switch (msg.what) {