diff options
author | 2013-06-21 17:49:36 -0700 | |
---|---|---|
committer | 2013-06-21 17:49:36 -0700 | |
commit | e4a2d7c48e17dd1c2f59dd18e91997029a6d0bdb (patch) | |
tree | 36028fca6f0f94d5bb783fe274850cae43ed449e | |
parent | 00c5620acf92d0755f897ea8e76e810b658ac5a7 (diff) |
Fix ViewGroupOverlay's handling of invalidating viewgroups
Invalidating a view property (alpha, rotation, etc.) causes an
invalidation process that does not work correctly when the view is
in a ViewOverlay. Specifically, if the view is not directly in the
overlay, but is instead inside a hierarchy which is within the overlay,
then the invalidation process stops at the ViewOverlay itself, because
the ViewOverlay has no "parent" view.
The fix is to override the invalidateChildInParentFast() method, just
like we override invalidateChildInParent(), to forward the invalidation
to the host view.
Issue #9389230 Animations not running for nested views under ViewGroupOverlay
Change-Id: I03fcef10ed1c8a91cb26d5d9d6945634b0b695b5
-rw-r--r-- | core/java/android/view/ViewGroup.java | 4 | ||||
-rw-r--r-- | core/java/android/view/ViewOverlay.java | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index d3f9174b3c5b..a40582b746fc 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -4426,8 +4426,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager /** * Quick invalidation method that simply transforms the dirty rect into the parent's * coordinate system, pruning the invalidation if the parent has already been invalidated. + * + * @hide */ - private ViewParent invalidateChildInParentFast(int left, int top, final Rect dirty) { + protected ViewParent invalidateChildInParentFast(int left, int top, final Rect dirty) { if ((mPrivateFlags & PFLAG_DRAWN) == PFLAG_DRAWN || (mPrivateFlags & PFLAG_DRAWING_CACHE_VALID) == PFLAG_DRAWING_CACHE_VALID) { dirty.offset(left - mScrollX, top - mScrollY); diff --git a/core/java/android/view/ViewOverlay.java b/core/java/android/view/ViewOverlay.java index 2d86bfe6b4f3..975931ae859c 100644 --- a/core/java/android/view/ViewOverlay.java +++ b/core/java/android/view/ViewOverlay.java @@ -300,6 +300,17 @@ public class ViewOverlay { } } + /** + * @hide + */ + @Override + protected ViewParent invalidateChildInParentFast(int left, int top, Rect dirty) { + if (mHostView instanceof ViewGroup) { + return ((ViewGroup) mHostView).invalidateChildInParentFast(left, top, dirty); + } + return null; + } + @Override public ViewParent invalidateChildInParent(int[] location, Rect dirty) { if (mHostView != null) { |