use of org.aisen.weibo.sina.ui.widget.io.codetail.animation.arcanimator.ArcAnimator in project AisenWeiBo by wangdan.
the class FabAnimation method startArcAnim.
protected void startArcAnim(View view, float endX, float endY, float degrees, Side side, long duration, Interpolator interpolator, final AnimationListener listener) {
// Setup animation
// Cast end coordinates to ints so that the FAB will be animated to the same position even
// when there are minute differences in the coordinates
ArcAnimator anim = ArcAnimator.createArcAnimator(view, (int) endX, (int) endY, degrees, side);
anim.setDuration(duration);
anim.setInterpolator(interpolator);
// Add listener
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
if (listener != null) {
listener.onStart();
}
}
@Override
public void onAnimationEnd(Animator animation) {
if (listener != null) {
listener.onEnd();
}
}
});
// Start animation
anim.start();
}
Aggregations