use of com.nineoldandroids.animation.ObjectAnimator in project android-shapeLoadingView by zzz40500.
the class LoadingView method freeFall.
/**
* 下落
*/
public void freeFall() {
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mShapeLoadingView, "translationY", 0, mDistance);
ObjectAnimator scaleIndication = ObjectAnimator.ofFloat(mIndicationIm, "scaleX", 1, 0.2f);
objectAnimator.setDuration(ANIMATION_DURATION);
objectAnimator.setInterpolator(new AccelerateInterpolator(factor));
mDownAnimatorSet = new AnimatorSet();
mDownAnimatorSet.setDuration(ANIMATION_DURATION);
mDownAnimatorSet.playTogether(objectAnimator, scaleIndication);
mDownAnimatorSet.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
mShapeLoadingView.changeShape();
upThrow();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
mDownAnimatorSet.start();
}
Aggregations