Merge "Fix transition being canceled improperly." into lmp-mr1-dev

This commit is contained in:
George Mount
2014-10-27 14:31:26 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 2 deletions

View File

@@ -1790,6 +1790,10 @@ public abstract class Transition implements Cloneable {
private static boolean isValueChanged(TransitionValues oldValues, TransitionValues newValues,
String key) {
if (oldValues.values.containsKey(key) != newValues.values.containsKey(key)) {
// The transition didn't care about this particular value, so we don't care, either.
return false;
}
Object oldValue = oldValues.values.get(key);
Object newValue = newValues.values.get(key);
boolean changed;

View File

@@ -484,12 +484,19 @@ public abstract class Visibility extends Transition {
@Override
boolean areValuesChanged(TransitionValues oldValues, TransitionValues newValues) {
VisibilityInfo changeInfo = getVisibilityChangeInfo(oldValues, newValues);
if (oldValues == null && newValues == null) {
return false;
}
if (oldValues != null && newValues != null &&
newValues.values.containsKey(PROPNAME_VISIBILITY) !=
oldValues.values.containsKey(PROPNAME_VISIBILITY)) {
// The transition wasn't targeted in either the start or end, so it couldn't
// have changed.
return false;
}
VisibilityInfo changeInfo = getVisibilityChangeInfo(oldValues, newValues);
return changeInfo.visibilityChange && (changeInfo.startVisibility == View.VISIBLE ||
changeInfo.endVisibility == View.VISIBLE);
changeInfo.endVisibility == View.VISIBLE);
}
/**