diff options
author | George Mount <mount@google.com> | 2014-09-07 15:04:03 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2014-09-07 15:04:03 -0700 |
commit | 9f1ac3976ea3aa08c20c06fa6678e367e1ed424d (patch) | |
tree | f7121a73bf1ebdda8ee33ee98a3fe0eb63dbfd30 /core/java/android/transition | |
parent | fdd04d42d2a0fe71236ba0a611ab550f52d8dd35 (diff) | |
download | frameworks_base-9f1ac3976ea3aa08c20c06fa6678e367e1ed424d.zip frameworks_base-9f1ac3976ea3aa08c20c06fa6678e367e1ed424d.tar.gz frameworks_base-9f1ac3976ea3aa08c20c06fa6678e367e1ed424d.tar.bz2 |
Improve Visibility parent value check.
Bug 17412818
Bug 16398271
The Visibility Transition must not run against children that
are already disappearing or there will be, for example, a double
fade-out effect. Before this change, if a parent matched another
view, it would prevent its child from disappearing.
This change also removes using the overlay for children that have
been removed from the view hierarchy indirectly. This prevents
ListView and RecyclerView children from being added to the overlay.
Change-Id: Iac0610f0939da8643b98812ee1ec1c8d1d70a215
Diffstat (limited to 'core/java/android/transition')
-rw-r--r-- | core/java/android/transition/Visibility.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/java/android/transition/Visibility.java b/core/java/android/transition/Visibility.java index 0b02552..d648ca6 100644 --- a/core/java/android/transition/Visibility.java +++ b/core/java/android/transition/Visibility.java @@ -358,12 +358,16 @@ public abstract class Visibility extends Transition { overlayView = startView; } else if (startView.getParent() instanceof View) { View startParent = (View) startView.getParent(); - if (!isValidTarget(startParent)) { - if (startView.isAttachedToWindow()) { - overlayView = copyViewImage(startView); - } else { - overlayView = startView; - } + VisibilityInfo parentVisibilityInfo = null; + TransitionValues endParentValues = getMatchedTransitionValues(startParent, + true); + if (endParentValues != null) { + TransitionValues startParentValues = getTransitionValues(startParent, true); + parentVisibilityInfo = + getVisibilityChangeInfo(startParentValues, endParentValues); + } + if (parentVisibilityInfo == null || !parentVisibilityInfo.visibilityChange) { + overlayView = copyViewImage(startView); } else if (startParent.getParent() == null) { int id = startParent.getId(); if (id != View.NO_ID && sceneRoot.findViewById(id) != null |