Merge "Fix addTarget not limiting to the given views." into mnc-dev

This commit is contained in:
George Mount
2015-06-26 21:18:37 +00:00
committed by Android (Google) Code Review

View File

@@ -528,11 +528,13 @@ public abstract class Transition implements Cloneable {
ArrayMap<View, TransitionValues> unmatchedEnd) { ArrayMap<View, TransitionValues> unmatchedEnd) {
for (int i = unmatchedStart.size() - 1; i >= 0; i--) { for (int i = unmatchedStart.size() - 1; i >= 0; i--) {
View view = unmatchedStart.keyAt(i); View view = unmatchedStart.keyAt(i);
TransitionValues end = unmatchedEnd.remove(view); if (view != null && isValidTarget(view)) {
if (end != null) { TransitionValues end = unmatchedEnd.remove(view);
TransitionValues start = unmatchedStart.removeAt(i); if (end != null && end.view != null && isValidTarget(end.view)) {
mStartValuesList.add(start); TransitionValues start = unmatchedStart.removeAt(i);
mEndValuesList.add(end); mStartValuesList.add(start);
mEndValuesList.add(end);
}
} }
} }
} }
@@ -548,9 +550,9 @@ public abstract class Transition implements Cloneable {
int numStartIds = startItemIds.size(); int numStartIds = startItemIds.size();
for (int i = 0; i < numStartIds; i++) { for (int i = 0; i < numStartIds; i++) {
View startView = startItemIds.valueAt(i); View startView = startItemIds.valueAt(i);
if (startView != null) { if (startView != null && isValidTarget(startView)) {
View endView = endItemIds.get(startItemIds.keyAt(i)); View endView = endItemIds.get(startItemIds.keyAt(i));
if (endView != null) { if (endView != null && isValidTarget(endView)) {
TransitionValues startValues = unmatchedStart.get(startView); TransitionValues startValues = unmatchedStart.get(startView);
TransitionValues endValues = unmatchedEnd.get(endView); TransitionValues endValues = unmatchedEnd.get(endView);
if (startValues != null && endValues != null) { if (startValues != null && endValues != null) {
@@ -626,14 +628,20 @@ public abstract class Transition implements Cloneable {
ArrayMap<View, TransitionValues> unmatchedEnd) { ArrayMap<View, TransitionValues> unmatchedEnd) {
// Views that only exist in the start Scene // Views that only exist in the start Scene
for (int i = 0; i < unmatchedStart.size(); i++) { for (int i = 0; i < unmatchedStart.size(); i++) {
mStartValuesList.add(unmatchedStart.valueAt(i)); final TransitionValues start = unmatchedStart.valueAt(i);
mEndValuesList.add(null); if (isValidTarget(start.view)) {
mStartValuesList.add(start);
mEndValuesList.add(null);
}
} }
// Views that only exist in the end Scene // Views that only exist in the end Scene
for (int i = 0; i < unmatchedEnd.size(); i++) { for (int i = 0; i < unmatchedEnd.size(); i++) {
mEndValuesList.add(unmatchedEnd.valueAt(i)); final TransitionValues end = unmatchedEnd.valueAt(i);
mStartValuesList.add(null); if (isValidTarget(end.view)) {
mEndValuesList.add(end);
mStartValuesList.add(null);
}
} }
} }