summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorVladislav Kaznacheev <kaznacheev@google.com>2015-05-15 13:01:32 -0700
committerVladislav Kaznacheev <kaznacheev@google.com>2015-05-20 18:29:46 +0000
commit8cebf3a098eeff1f4b2359c4a3abdaf0e4dc494f (patch)
treebd55a3b01fd315c0a5009de6d3fe1cf5323dca20 /core/java/android
parentb300d31bf1cb138f0a7c4c484459cc6a2ce2f69c (diff)
Make VPA.setInterpolator(null) unset the interpolator.
Bug:21199392 Change-Id: Iae4b82254ddf6b60d442258e79ff0ea4d54c0a4d (cherry picked from commit 58ae164100060d1b8a9709aeea7a2b488ff0ac98)
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/ViewPropertyAnimator.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java
index f18b7acf64f0..bd45007909a3 100644
--- a/core/java/android/view/ViewPropertyAnimator.java
+++ b/core/java/android/view/ViewPropertyAnimator.java
@@ -80,18 +80,12 @@ 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 ever set 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 set to a
+ * non-null value 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;
@@ -338,7 +332,6 @@ 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;
}
@@ -349,7 +342,7 @@ public class ViewPropertyAnimator {
* @return The timing interpolator for this animation.
*/
public TimeInterpolator getInterpolator() {
- if (mInterpolatorSet) {
+ if (mInterpolator != null) {
return mInterpolator;
} else {
// Just return the default from ValueAnimator, since that's what we'd get if
@@ -897,7 +890,7 @@ public class ViewPropertyAnimator {
if (mDurationSet) {
animator.setDuration(mDuration);
}
- if (mInterpolatorSet) {
+ if (mInterpolator != null) {
animator.setInterpolator(mInterpolator);
}
animator.start();