diff --git a/src/api-impl/android/view/View.java b/src/api-impl/android/view/View.java index 90f611dc..c44e0103 100644 --- a/src/api-impl/android/view/View.java +++ b/src/api-impl/android/view/View.java @@ -1732,7 +1732,15 @@ public class View implements Drawable.Callback { public void setOnCreateContextMenuListener (View.OnCreateContextMenuListener l) {} - public void startAnimation(Animation animation) {} + protected void onAnimationStart() {} + + protected void onAnimationEnd() {} + + public void startAnimation(Animation animation) { + onAnimationStart(); + animation.start(); + onAnimationEnd(); + } public void getDrawingRect(Rect rect) { rect.left = getScrollX(); diff --git a/src/api-impl/android/view/animation/Animation.java b/src/api-impl/android/view/animation/Animation.java index a68029d7..2d8e4f7a 100644 --- a/src/api-impl/android/view/animation/Animation.java +++ b/src/api-impl/android/view/animation/Animation.java @@ -1,8 +1,5 @@ package android.view.animation; -import android.os.Handler; -import android.os.Looper; - public class Animation { public interface AnimationListener { @@ -11,6 +8,8 @@ public class Animation { public void onAnimationStart(Animation animation); } + private AnimationListener listener; + public void setDuration(long durationMillis) {} public void setInterpolator(Interpolator i) {} @@ -23,12 +22,7 @@ public class Animation { public void setStartOffset(long offset) {} public void setAnimationListener(AnimationListener l) { - new Handler(Looper.getMainLooper()).post(new Runnable() { - @Override - public void run() { - l.onAnimationEnd(Animation.this); // FIXME - } - }); + this.listener = l; } public void setRepeatCount(int count) {} @@ -37,5 +31,14 @@ public class Animation { public void reset() {} - public void start() {} + public void start() { + if (listener != null) { + listener.onAnimationStart(this); + listener.onAnimationEnd(this); + } + } + + public boolean hasStarted() { + return false; + } }