diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/ViewGroup.java | 8 | ||||
-rw-r--r-- | core/java/android/view/ViewRoot.java | 5 | ||||
-rw-r--r-- | core/java/android/view/animation/TranslateAnimation.java | 1 |
3 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index dc7b299..39aecfd 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -2327,8 +2327,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final boolean drawAnimation = (child.mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION; do { - if (drawAnimation && parent instanceof View) { - ((View) parent).mPrivateFlags |= DRAW_ANIMATION; + if (drawAnimation) { + if (parent instanceof View) { + ((View) parent).mPrivateFlags |= DRAW_ANIMATION; + } else if (parent instanceof ViewRoot) { + ((ViewRoot) parent).mIsAnimating = true; + } } parent = parent.invalidateChildInParent(location, dirty); } while (parent != null); diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index fbb4d42..18ee9ae 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -33,7 +33,6 @@ import android.util.Config; import android.util.Log; import android.util.EventLog; import android.util.SparseArray; -import android.util.DisplayMetrics; import android.view.View.MeasureSpec; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; @@ -128,6 +127,7 @@ public final class ViewRoot extends Handler implements ViewParent, int mWidth; int mHeight; Rect mDirty; // will be a graphics.Region soon + boolean mIsAnimating; final View.AttachInfo mAttachInfo; @@ -1183,7 +1183,7 @@ public final class ViewRoot extends Handler implements ViewParent, } try { - if (!dirty.isEmpty()) { + if (!dirty.isEmpty() || mIsAnimating) { long startTime; if (DEBUG_ORIENTATION || DEBUG_DRAW) { @@ -1210,6 +1210,7 @@ public final class ViewRoot extends Handler implements ViewParent, } dirty.setEmpty(); + mIsAnimating = false; mAttachInfo.mDrawingTime = SystemClock.uptimeMillis(); canvas.translate(0, -yoff); mView.mPrivateFlags |= View.DRAWN; diff --git a/core/java/android/view/animation/TranslateAnimation.java b/core/java/android/view/animation/TranslateAnimation.java index a785d43..d2ff754 100644 --- a/core/java/android/view/animation/TranslateAnimation.java +++ b/core/java/android/view/animation/TranslateAnimation.java @@ -156,7 +156,6 @@ public class TranslateAnimation extends Animation { if (mFromYDelta != mToYDelta) { dy = mFromYDelta + ((mToYDelta - mFromYDelta) * interpolatedTime); } - t.getMatrix().setTranslate(dx, dy); } |