use of android.animation.Animator.AnimatorListener in project RecyclerViewAnimator by dkmeteor.
the class FlipVertialIn method startAnimation.
@Override
public void startAnimation(final ViewHolder holder, long duration, final BaseItemAnimator animator) {
ViewCompat.animate(holder.itemView).cancel();
AnimatorSet set = new AnimatorSet();
set.playTogether(ObjectAnimator.ofFloat(holder.itemView, "rotationX", 90, -15, 15, 0), ObjectAnimator.ofFloat(holder.itemView, "alpha", 0.25f, 0.5f, 0.75f, 1));
set.addListener(new AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationRepeat(Animator animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationEnd(Animator animation) {
animator.dispatchAddFinished(holder);
animator.mAddAnimations.remove(holder);
animator.dispatchFinishedWhenDone();
}
@Override
public void onAnimationCancel(Animator animation) {
// TODO Auto-generated method stub
}
});
set.setStartDelay(mDelay * mDelayCount);
set.setDuration(animator.getAddDuration());
set.start();
animator.mAddAnimations.add(holder);
}
use of android.animation.Animator.AnimatorListener in project RecyclerViewAnimator by dkmeteor.
the class ShakeIn method startAnimation.
@Override
public void startAnimation(final ViewHolder holder, long duration, final BaseItemAnimator animator) {
ViewCompat.animate(holder.itemView).cancel();
ObjectAnimator objectAnimatorAnimator = ObjectAnimator.ofFloat(holder.itemView, "translationX", -ViewUtils.getScreenWidth(), -ViewUtils.getScreenWidth() * 3f / 4f, -ViewUtils.getScreenWidth() / 2f, -ViewUtils.getScreenWidth() / 4f, 0, 25, -25, 25, -25, 15, -15, 6, -6, 0);
objectAnimatorAnimator.addListener(new AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
animator.dispatchAddFinished(holder);
animator.mAddAnimations.remove(holder);
animator.dispatchFinishedWhenDone();
}
@Override
public void onAnimationCancel(Animator animation) {
}
});
objectAnimatorAnimator.setStartDelay(mDelay * mDelayCount);
objectAnimatorAnimator.setDuration(animator.getAddDuration());
objectAnimatorAnimator.start();
animator.mAddAnimations.add(holder);
}
Aggregations