use of com.nineoldandroids.animation.AnimatorSet in project PhotoNoter by yydcdut.
the class ZoomHeaderImageView method doAnimation.
private void doAnimation() {
AnimatorSet animatorSet = new AnimatorSet();
if (mCurrentIndex % 2 == 0) {
animatorSet.playTogether(ObjectAnimator.ofFloat(mImageView0, "scaleX", 1f, 1.3f), ObjectAnimator.ofFloat(mImageView0, "scaleY", 1f, 1.3f), ObjectAnimator.ofFloat(mImageView0, "alpha", 1f, 0.0f), ObjectAnimator.ofFloat(mImageView1, "scaleX", 1.3f, 1.0f), ObjectAnimator.ofFloat(mImageView1, "scaleY", 1.3f, 1.0f), ObjectAnimator.ofFloat(mImageView1, "alpha", 0.0f, 1.0f));
} else {
animatorSet.playTogether(ObjectAnimator.ofFloat(mImageView1, "scaleX", 1f, 1.3f), ObjectAnimator.ofFloat(mImageView1, "scaleY", 1f, 1.3f), ObjectAnimator.ofFloat(mImageView1, "alpha", 1f, 0.0f), ObjectAnimator.ofFloat(mImageView0, "scaleX", 1.3f, 1.0f), ObjectAnimator.ofFloat(mImageView0, "scaleY", 1.3f, 1.0f), ObjectAnimator.ofFloat(mImageView0, "alpha", 0.0f, 1.0f));
}
animatorSet.setDuration(400).addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
mImageView0.setVisibility(VISIBLE);
mImageView1.setVisibility(VISIBLE);
if (mCurrentIndex % 2 == 0) {
mImageView1.setImageResource(mResArray[(mCurrentIndex + 1) % 5]);
} else {
mImageView0.setImageResource(mResArray[(mCurrentIndex + 1) % 5]);
}
}
@Override
public void onAnimationEnd(Animator animation) {
mCurrentIndex++;
if (mCurrentIndex % 2 == 0) {
mImageView1.setVisibility(INVISIBLE);
} else {
mImageView0.setVisibility(INVISIBLE);
}
mHandler.sendEmptyMessageDelayed(0, 3000);
}
});
animatorSet.start();
}
use of com.nineoldandroids.animation.AnimatorSet 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