use of net.qiujuer.genius.ui.animation.AnimatorListener in project Genius-Android by qiujuer.
the class BalloonMarker method animateClose.
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void animateClose() {
mBalloonMarkerDrawable.stop();
ViewPropertyAnimator animator = mNumber.animate();
animator.alpha(0f);
animator.setDuration(100);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
animator.withEndAction(new Runnable() {
@Override
public void run() {
//We use INVISIBLE instead of GONE to avoid a requestLayout
mNumber.setVisibility(View.INVISIBLE);
mBalloonMarkerDrawable.animateToNormal();
}
});
} else {
animator.setListener(new AnimatorListener() {
@Override
public void onAnimationEnd(Animator animation) {
//We use INVISIBLE instead of GONE to avoid a requestLayout
mNumber.setVisibility(View.INVISIBLE);
mBalloonMarkerDrawable.animateToNormal();
}
});
}
animator.start();
}
Aggregations