diff options
author | Todd Volkert <tvolkert@google.com> | 2015-02-12 13:34:29 -0800 |
---|---|---|
committer | Todd Volkert <tvolkert@google.com> | 2015-02-12 14:47:20 -0800 |
commit | d23391eafe9f46ff01d5dc936126a4d6ae1c53d3 (patch) | |
tree | 30b01db6628244f3ddf4dc18bf3df1492e2668b0 /core | |
parent | 346066ef90c6b0af50ba0187338de7e8c8c2f8aa (diff) | |
download | frameworks_base-d23391eafe9f46ff01d5dc936126a4d6ae1c53d3.zip frameworks_base-d23391eafe9f46ff01d5dc936126a4d6ae1c53d3.tar.gz frameworks_base-d23391eafe9f46ff01d5dc936126a4d6ae1c53d3.tar.bz2 |
Increase visibility of Transition.areValuesChanged() to protected to allow
subclasses outside the android.transition package to override it.
Change-Id: Ife5de79b339b6d7598411ad851858f4c52a89f5c
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/transition/Transition.java | 12 | ||||
-rw-r--r-- | core/java/android/transition/Visibility.java | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/core/java/android/transition/Transition.java b/core/java/android/transition/Transition.java index 2705bcf..c942042 100644 --- a/core/java/android/transition/Transition.java +++ b/core/java/android/transition/Transition.java @@ -1762,7 +1762,17 @@ public abstract class Transition implements Cloneable { runAnimators(); } - boolean areValuesChanged(TransitionValues oldValues, TransitionValues newValues) { + /** + * Returns whether transition values have changed between the start scene and the end scene + * (thus determining whether animation is required). The default implementation compares the + * property values returned from {@link #getTransitionProperties()}, or all property values if + * {@code getTransitionProperties()} returns null. Subclasses may override this method to + * provide logic more specific to their transition implementation. + * + * @param oldValues the first set of values, may be {@code null} + * @param newValues the second set of values, may be {@code null} + */ + protected boolean areValuesChanged(TransitionValues oldValues, TransitionValues newValues) { boolean valuesChanged = false; // if oldValues null, then transition didn't care to stash values, // and won't get canceled diff --git a/core/java/android/transition/Visibility.java b/core/java/android/transition/Visibility.java index 8779229..26dca43 100644 --- a/core/java/android/transition/Visibility.java +++ b/core/java/android/transition/Visibility.java @@ -182,7 +182,7 @@ public abstract class Visibility extends Transition { return visibility == View.VISIBLE && parent != null; } - private VisibilityInfo getVisibilityChangeInfo(TransitionValues startValues, + private static VisibilityInfo getVisibilityChangeInfo(TransitionValues startValues, TransitionValues endValues) { final VisibilityInfo visInfo = new VisibilityInfo(); visInfo.visibilityChange = false; @@ -484,7 +484,7 @@ public abstract class Visibility extends Transition { } @Override - boolean areValuesChanged(TransitionValues oldValues, TransitionValues newValues) { + protected boolean areValuesChanged(TransitionValues oldValues, TransitionValues newValues) { if (oldValues == null && newValues == null) { return false; } |