summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2015-06-04 12:51:55 -0700
committerGeorge Mount <mount@google.com>2015-06-05 14:23:47 -0700
commitaef1ae33915471983f10342dfbf6e37cb6f8c7a5 (patch)
treece572423be904b92935e5ebb768a19ef110068ad
parent44fdcf26421c4c2a59888739fa003a14e09e8391 (diff)
downloadframeworks_base-aef1ae33915471983f10342dfbf6e37cb6f8c7a5.zip
frameworks_base-aef1ae33915471983f10342dfbf6e37cb6f8c7a5.tar.gz
frameworks_base-aef1ae33915471983f10342dfbf6e37cb6f8c7a5.tar.bz2
API Council changes.
Bug 21571897 Change-Id: I681096c50a6f4a448e399b482742efc06229fab1
-rw-r--r--api/current.txt4
-rw-r--r--api/system-current.txt4
-rw-r--r--core/java/android/transition/Transition.java31
-rw-r--r--core/java/android/transition/Visibility.java10
4 files changed, 27 insertions, 22 deletions
diff --git a/api/current.txt b/api/current.txt
index 51a1e79..97a8d59 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -24476,10 +24476,10 @@ package android.provider {
public final class AlarmClock {
ctor public AlarmClock();
+ field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
field public static final java.lang.String ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
field public static final java.lang.String ACTION_SET_TIMER = "android.intent.action.SET_TIMER";
field public static final java.lang.String ACTION_SHOW_ALARMS = "android.intent.action.SHOW_ALARMS";
- field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
field public static final java.lang.String ACTION_SNOOZE_ALARM = "android.intent.action.SNOOZE_ALARM";
field public static final java.lang.String ALARM_SEARCH_MODE_ALL = "android.all";
field public static final java.lang.String ALARM_SEARCH_MODE_LABEL = "android.label";
@@ -33746,7 +33746,6 @@ package android.transition {
method public android.transition.Transition addTarget(java.lang.String);
method public android.transition.Transition addTarget(java.lang.Class);
method public android.transition.Transition addTarget(android.view.View);
- method protected boolean areValuesChanged(android.transition.TransitionValues, android.transition.TransitionValues);
method public boolean canRemoveViews();
method public abstract void captureEndValues(android.transition.TransitionValues);
method public abstract void captureStartValues(android.transition.TransitionValues);
@@ -33773,6 +33772,7 @@ package android.transition {
method public java.util.List<android.view.View> getTargets();
method public java.lang.String[] getTransitionProperties();
method public android.transition.TransitionValues getTransitionValues(android.view.View, boolean);
+ method public boolean isTransitionRequired(android.transition.TransitionValues, android.transition.TransitionValues);
method public android.transition.Transition removeListener(android.transition.Transition.TransitionListener);
method public android.transition.Transition removeTarget(int);
method public android.transition.Transition removeTarget(java.lang.String);
diff --git a/api/system-current.txt b/api/system-current.txt
index 7ce111c..c96d89c 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -26406,10 +26406,10 @@ package android.provider {
public final class AlarmClock {
ctor public AlarmClock();
+ field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
field public static final java.lang.String ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
field public static final java.lang.String ACTION_SET_TIMER = "android.intent.action.SET_TIMER";
field public static final java.lang.String ACTION_SHOW_ALARMS = "android.intent.action.SHOW_ALARMS";
- field public static final java.lang.String ACTION_DISMISS_ALARM = "android.intent.action.DISMISS_ALARM";
field public static final java.lang.String ACTION_SNOOZE_ALARM = "android.intent.action.SNOOZE_ALARM";
field public static final java.lang.String ALARM_SEARCH_MODE_ALL = "android.all";
field public static final java.lang.String ALARM_SEARCH_MODE_LABEL = "android.label";
@@ -36011,7 +36011,6 @@ package android.transition {
method public android.transition.Transition addTarget(java.lang.String);
method public android.transition.Transition addTarget(java.lang.Class);
method public android.transition.Transition addTarget(android.view.View);
- method protected boolean areValuesChanged(android.transition.TransitionValues, android.transition.TransitionValues);
method public boolean canRemoveViews();
method public abstract void captureEndValues(android.transition.TransitionValues);
method public abstract void captureStartValues(android.transition.TransitionValues);
@@ -36038,6 +36037,7 @@ package android.transition {
method public java.util.List<android.view.View> getTargets();
method public java.lang.String[] getTransitionProperties();
method public android.transition.TransitionValues getTransitionValues(android.view.View, boolean);
+ method public boolean isTransitionRequired(android.transition.TransitionValues, android.transition.TransitionValues);
method public android.transition.Transition removeListener(android.transition.Transition.TransitionListener);
method public android.transition.Transition removeTarget(int);
method public android.transition.Transition removeTarget(java.lang.String);
diff --git a/core/java/android/transition/Transition.java b/core/java/android/transition/Transition.java
index 1b25505..c61ca4e 100644
--- a/core/java/android/transition/Transition.java
+++ b/core/java/android/transition/Transition.java
@@ -19,6 +19,7 @@ package android.transition;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.TimeInterpolator;
+import android.annotation.Nullable;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Path;
@@ -700,7 +701,7 @@ public abstract class Transition implements Cloneable {
continue;
}
// Only bother trying to animate with values that differ between start/end
- boolean isChanged = start == null || end == null || areValuesChanged(start, end);
+ boolean isChanged = start == null || end == null || isTransitionRequired(start, end);
if (isChanged) {
if (DBG) {
View view = (end != null) ? end.view : start.view;
@@ -1747,7 +1748,7 @@ public abstract class Transition implements Cloneable {
endValues = mEndValues.viewValues.get(oldView);
}
boolean cancel = (startValues != null || endValues != null) &&
- oldInfo.transition.areValuesChanged(oldValues, endValues);
+ oldInfo.transition.isTransitionRequired(oldValues, endValues);
if (cancel) {
if (anim.isRunning() || anim.isStarted()) {
if (DBG) {
@@ -1770,32 +1771,36 @@ public abstract class Transition implements Cloneable {
}
/**
- * 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
+ * Returns whether or not the transition should create an Animator, based on the values
+ * captured during {@link #captureStartValues(TransitionValues)} and
+ * {@link #captureEndValues(TransitionValues)}. 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.
+ * provide logic more specific to the transition implementation.
*
- * @param oldValues the first set of values, may be {@code null}
- * @param newValues the second set of values, may be {@code null}
+ * @param startValues the values from captureStartValues, This may be {@code null} if the
+ * View did not exist in the start state.
+ * @param endValues the values from captureEndValues. This may be {@code null} if the View
+ * did not exist in the end state.
*/
- protected boolean areValuesChanged(TransitionValues oldValues, TransitionValues newValues) {
+ public boolean isTransitionRequired(@Nullable TransitionValues startValues,
+ @Nullable TransitionValues endValues) {
boolean valuesChanged = false;
- // if oldValues null, then transition didn't care to stash values,
+ // if startValues null, then transition didn't care to stash values,
// and won't get canceled
- if (oldValues != null && newValues != null) {
+ if (startValues != null && endValues != null) {
String[] properties = getTransitionProperties();
if (properties != null) {
int count = properties.length;
for (int i = 0; i < count; i++) {
- if (isValueChanged(oldValues, newValues, properties[i])) {
+ if (isValueChanged(startValues, endValues, properties[i])) {
valuesChanged = true;
break;
}
}
} else {
- for (String key : oldValues.values.keySet()) {
- if (isValueChanged(oldValues, newValues, key)) {
+ for (String key : startValues.values.keySet()) {
+ if (isValueChanged(startValues, endValues, key)) {
valuesChanged = true;
break;
}
diff --git a/core/java/android/transition/Visibility.java b/core/java/android/transition/Visibility.java
index ed7fd86..da7d904 100644
--- a/core/java/android/transition/Visibility.java
+++ b/core/java/android/transition/Visibility.java
@@ -462,18 +462,18 @@ public abstract class Visibility extends Transition {
}
@Override
- protected boolean areValuesChanged(TransitionValues oldValues, TransitionValues newValues) {
- if (oldValues == null && newValues == null) {
+ public boolean isTransitionRequired(TransitionValues startValues, TransitionValues newValues) {
+ if (startValues == null && newValues == null) {
return false;
}
- if (oldValues != null && newValues != null &&
+ if (startValues != null && newValues != null &&
newValues.values.containsKey(PROPNAME_VISIBILITY) !=
- oldValues.values.containsKey(PROPNAME_VISIBILITY)) {
+ startValues.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);
+ VisibilityInfo changeInfo = getVisibilityChangeInfo(startValues, newValues);
return changeInfo.visibilityChange && (changeInfo.startVisibility == View.VISIBLE ||
changeInfo.endVisibility == View.VISIBLE);
}