summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorVladislav Kaznacheev <kaznacheev@google.com>2015-06-15 06:58:59 +0000
committerVladislav Kaznacheev <kaznacheev@google.com>2015-06-15 06:58:59 +0000
commit78f146f420b894e7c6ab4545917d80f98447401a (patch)
tree0bf612afb28993369b96a5fe60db09cbf38ba9ab /core/java
parent8cebf3a098eeff1f4b2359c4a3abdaf0e4dc494f (diff)
Revert "Make VPA.setInterpolator(null) unset the interpolator."
This reverts commit 8cebf3a098eeff1f4b2359c4a3abdaf0e4dc494f. Bug: 21804709 Change-Id: I4b3c2c4721b8e7dd5cb38c806bdd078344b09799
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/ViewPropertyAnimator.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java
index bd45007909a3..f18b7acf64f0 100644
--- a/core/java/android/view/ViewPropertyAnimator.java
+++ b/core/java/android/view/ViewPropertyAnimator.java
@@ -80,12 +80,18 @@ public class ViewPropertyAnimator {
/**
* The interpolator of the underlying Animator object. By default, we don't set the interpolator
- * on the Animator and just use its default interpolator. If the interpolator is set to a
- * non-null value on this Animator, then we use the interpolator that it was set to.
+ * on the Animator and just use its default interpolator. If the interpolator is ever set on
+ * this Animator, then we use the interpolator that it was set to.
*/
private TimeInterpolator mInterpolator;
/**
+ * A flag indicating whether the interpolator has been set on this object. If not, we don't set
+ * the interpolator on the underlying Animator, but instead just use its default interpolator.
+ */
+ private boolean mInterpolatorSet = false;
+
+ /**
* Listener for the lifecycle events of the underlying ValueAnimator object.
*/
private Animator.AnimatorListener mListener = null;
@@ -332,6 +338,7 @@ public class ViewPropertyAnimator {
* @return This object, allowing calls to methods in this class to be chained.
*/
public ViewPropertyAnimator setInterpolator(TimeInterpolator interpolator) {
+ mInterpolatorSet = true;
mInterpolator = interpolator;
return this;
}
@@ -342,7 +349,7 @@ public class ViewPropertyAnimator {
* @return The timing interpolator for this animation.
*/
public TimeInterpolator getInterpolator() {
- if (mInterpolator != null) {
+ if (mInterpolatorSet) {
return mInterpolator;
} else {
// Just return the default from ValueAnimator, since that's what we'd get if
@@ -890,7 +897,7 @@ public class ViewPropertyAnimator {
if (mDurationSet) {
animator.setDuration(mDuration);
}
- if (mInterpolator != null) {
+ if (mInterpolatorSet) {
animator.setInterpolator(mInterpolator);
}
animator.start();