am a31cda89: am 0021d3fa: Merge "Revert "Make VPA.setInterpolator(null) unset the interpolator."" into mnc-dev
* commit 'a31cda89957cc1f29ae1b97a7fadf0266b7ae7b1': Revert "Make VPA.setInterpolator(null) unset the interpolator."
This commit is contained in:
committed by
Android Git Automerger
commit
dfa44e75d5
@@ -80,11 +80,17 @@ public class ViewPropertyAnimator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The interpolator of the underlying Animator object. By default, we don't set the interpolator
|
* 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
|
* on the Animator and just use its default interpolator. If the interpolator is ever set on
|
||||||
* non-null value on this Animator, then we use the interpolator that it was set to.
|
* this Animator, then we use the interpolator that it was set to.
|
||||||
*/
|
*/
|
||||||
private TimeInterpolator mInterpolator;
|
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.
|
* Listener for the lifecycle events of the underlying ValueAnimator object.
|
||||||
*/
|
*/
|
||||||
@@ -332,6 +338,7 @@ public class ViewPropertyAnimator {
|
|||||||
* @return This object, allowing calls to methods in this class to be chained.
|
* @return This object, allowing calls to methods in this class to be chained.
|
||||||
*/
|
*/
|
||||||
public ViewPropertyAnimator setInterpolator(TimeInterpolator interpolator) {
|
public ViewPropertyAnimator setInterpolator(TimeInterpolator interpolator) {
|
||||||
|
mInterpolatorSet = true;
|
||||||
mInterpolator = interpolator;
|
mInterpolator = interpolator;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -342,7 +349,7 @@ public class ViewPropertyAnimator {
|
|||||||
* @return The timing interpolator for this animation.
|
* @return The timing interpolator for this animation.
|
||||||
*/
|
*/
|
||||||
public TimeInterpolator getInterpolator() {
|
public TimeInterpolator getInterpolator() {
|
||||||
if (mInterpolator != null) {
|
if (mInterpolatorSet) {
|
||||||
return mInterpolator;
|
return mInterpolator;
|
||||||
} else {
|
} else {
|
||||||
// Just return the default from ValueAnimator, since that's what we'd get if
|
// Just return the default from ValueAnimator, since that's what we'd get if
|
||||||
@@ -890,7 +897,7 @@ public class ViewPropertyAnimator {
|
|||||||
if (mDurationSet) {
|
if (mDurationSet) {
|
||||||
animator.setDuration(mDuration);
|
animator.setDuration(mDuration);
|
||||||
}
|
}
|
||||||
if (mInterpolator != null) {
|
if (mInterpolatorSet) {
|
||||||
animator.setInterpolator(mInterpolator);
|
animator.setInterpolator(mInterpolator);
|
||||||
}
|
}
|
||||||
animator.start();
|
animator.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user