diff options
| author | George Mount <mount@google.com> | 2015-06-26 21:18:37 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-26 21:18:39 +0000 |
| commit | 7a0f54b1400c9ca0cb32819dd3a3784f9aa7c351 (patch) | |
| tree | 16e08c7c59e12faf8bd2fa236191dceeec250dd2 | |
| parent | 1c3b7a6de6593c8a1c01ce48e04dda7e11471288 (diff) | |
| parent | e3a4cb5b3818918e6552ac52026490809b37fe6d (diff) | |
| download | frameworks_base-7a0f54b1400c9ca0cb32819dd3a3784f9aa7c351.zip frameworks_base-7a0f54b1400c9ca0cb32819dd3a3784f9aa7c351.tar.gz frameworks_base-7a0f54b1400c9ca0cb32819dd3a3784f9aa7c351.tar.bz2 | |
Merge "Fix addTarget not limiting to the given views." into mnc-dev
| -rw-r--r-- | core/java/android/transition/Transition.java | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/core/java/android/transition/Transition.java b/core/java/android/transition/Transition.java index 868b262..e958058 100644 --- a/core/java/android/transition/Transition.java +++ b/core/java/android/transition/Transition.java @@ -528,11 +528,13 @@ public abstract class Transition implements Cloneable { ArrayMap<View, TransitionValues> unmatchedEnd) { for (int i = unmatchedStart.size() - 1; i >= 0; i--) { View view = unmatchedStart.keyAt(i); - TransitionValues end = unmatchedEnd.remove(view); - if (end != null) { - TransitionValues start = unmatchedStart.removeAt(i); - mStartValuesList.add(start); - mEndValuesList.add(end); + if (view != null && isValidTarget(view)) { + TransitionValues end = unmatchedEnd.remove(view); + if (end != null && end.view != null && isValidTarget(end.view)) { + TransitionValues start = unmatchedStart.removeAt(i); + mStartValuesList.add(start); + mEndValuesList.add(end); + } } } } @@ -548,9 +550,9 @@ public abstract class Transition implements Cloneable { int numStartIds = startItemIds.size(); for (int i = 0; i < numStartIds; i++) { View startView = startItemIds.valueAt(i); - if (startView != null) { + if (startView != null && isValidTarget(startView)) { View endView = endItemIds.get(startItemIds.keyAt(i)); - if (endView != null) { + if (endView != null && isValidTarget(endView)) { TransitionValues startValues = unmatchedStart.get(startView); TransitionValues endValues = unmatchedEnd.get(endView); if (startValues != null && endValues != null) { @@ -626,14 +628,20 @@ public abstract class Transition implements Cloneable { ArrayMap<View, TransitionValues> unmatchedEnd) { // Views that only exist in the start Scene for (int i = 0; i < unmatchedStart.size(); i++) { - mStartValuesList.add(unmatchedStart.valueAt(i)); - mEndValuesList.add(null); + final TransitionValues start = unmatchedStart.valueAt(i); + if (isValidTarget(start.view)) { + mStartValuesList.add(start); + mEndValuesList.add(null); + } } // Views that only exist in the end Scene for (int i = 0; i < unmatchedEnd.size(); i++) { - mEndValuesList.add(unmatchedEnd.valueAt(i)); - mStartValuesList.add(null); + final TransitionValues end = unmatchedEnd.valueAt(i); + if (isValidTarget(end.view)) { + mEndValuesList.add(end); + mStartValuesList.add(null); + } } } |
