summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/transition/Transition.java4
-rw-r--r--core/java/android/transition/Visibility.java11
2 files changed, 13 insertions, 2 deletions
diff --git a/core/java/android/transition/Transition.java b/core/java/android/transition/Transition.java
index 6dede46..e99c2cf 100644
--- a/core/java/android/transition/Transition.java
+++ b/core/java/android/transition/Transition.java
@@ -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;
diff --git a/core/java/android/transition/Visibility.java b/core/java/android/transition/Visibility.java
index f58291f..36bac31 100644
--- a/core/java/android/transition/Visibility.java
+++ b/core/java/android/transition/Visibility.java
@@ -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);
}
/**