public void upThrow() {
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this.mShapeLoadingView, "translationY", new float[]{mDistance, 0.0F});
ObjectAnimator scaleIndication = ObjectAnimator.ofFloat(this.mIndicationIm, "scaleX", new float[]{0.2F, 1.0F});
ObjectAnimator objectAnimator1 = null;
switch (mShapeLoadingView.getShape()) {
case SHAPE_RECT:
objectAnimator1 = ObjectAnimator.ofFloat(this.mShapeLoadingView, "rotation", new float[]{0.0F, -120.0F});
break;
case SHAPE_CIRCLE:
objectAnimator1 = ObjectAnimator.ofFloat(this.mShapeLoadingView, "rotation", new float[]{0.0F, 180.0F});
break;
case SHAPE_TRIANGLE:
objectAnimator1 = ObjectAnimator.ofFloat(this.mShapeLoadingView, "rotation", new float[]{0.0F, 180.0F});
}
objectAnimator.setDuration(500L);
objectAnimator1.setDuration(500L);
objectAnimator.setInterpolator(new DecelerateInterpolator(this.factor));
objectAnimator1.setInterpolator(new DecelerateInterpolator(this.factor));
mAnimatorSetupThrow = new AnimatorSet();
mAnimatorSetupThrow.setDuration(500L);
mAnimatorSetupThrow.playTogether(new Animator[]{objectAnimator, objectAnimator1, scaleIndication});
mAnimatorSetupThrow.addListener(new Animator.AnimatorListener() {
public void onAnimationStart(Animator animation) {
}
public void onAnimationEnd(Animator animation) {
freeFall();
AppLogger.i("TAG", "freeFall end");
}
public void onAnimationCancel(Animator animation) {
AppLogger.i("TAG", "freeFall cancel");
}
public void onAnimationRepeat(Animator animation) {
}
});
// mAnimatorSetupThrow.start();
}
public void freeFall() {
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this.mShapeLoadingView, "translationY", new float[]{0.0F, mDistance});
ObjectAnimator scaleIndication = ObjectAnimator.ofFloat(this.mIndicationIm, "scaleX", new float[]{1.0F, 0.2F});
objectAnimator.setDuration(500L);
objectAnimator.setInterpolator(new AccelerateInterpolator(this.factor));
mAnimatorSetfreeFall = new AnimatorSet();
mAnimatorSetfreeFall.setDuration(500L);
mAnimatorSetfreeFall.playTogether(new Animator[]{objectAnimator, scaleIndication});
mAnimatorSetfreeFall.addListener(new Animator.AnimatorListener() {
public void onAnimationStart(Animator animation) {
}
public void onAnimationEnd(Animator animation) {
mShapeLoadingView.changeShape();
// upThrow();
AppLogger.i("TAG", "upThrow end");
}
public void onAnimationCancel(Animator animation) {
AppLogger.i("TAG", "upThrow cancel");
}
public void onAnimationRepeat(Animator animation) {
}
});
mAnimatorSetfreeFall.start();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
mAnimatorSetfreeFall.cance()
}
无效