use of com.marshalchen.common.uimodule.nineoldandroids.animation.ValueAnimator.AnimatorUpdateListener in project UltimateAndroid by cymcsg.
the class AnimateDismissAdapter method createAnimatorForView.
private Animator createAnimatorForView(final View view) {
final ViewGroup.LayoutParams lp = view.getLayoutParams();
final int originalHeight = view.getHeight();
ValueAnimator animator = ValueAnimator.ofInt(originalHeight, 0);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(final Animator animator) {
lp.height = 0;
view.setLayoutParams(lp);
}
});
animator.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(final ValueAnimator valueAnimator) {
lp.height = (Integer) valueAnimator.getAnimatedValue();
view.setLayoutParams(lp);
}
});
return animator;
}
Aggregations