Search in sources :

Example 1 with ArcAnimator

use of io.codetail.animation.arcanimator.ArcAnimator in project material-sheet-fab by gowong.

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();
}
Also used : ArcAnimator(io.codetail.animation.arcanimator.ArcAnimator) Animator(com.nineoldandroids.animation.Animator) AnimatorListenerAdapter(com.nineoldandroids.animation.AnimatorListenerAdapter) ArcAnimator(io.codetail.animation.arcanimator.ArcAnimator)

Example 2 with ArcAnimator

use of io.codetail.animation.arcanimator.ArcAnimator in project MaterialCalendar by Haoxiqiang.

the class MemoFragment method returnBlue.

void returnBlue() {
    mBlue.setVisibility(View.VISIBLE);
    ArcAnimator arcAnimator = ArcAnimator.createArcAnimator(mBlue, startBlueX, startBlueY, 90, Side.LEFT).setDuration(500);
    arcAnimator.start();
}
Also used : ArcAnimator(io.codetail.animation.arcanimator.ArcAnimator)

Aggregations

ArcAnimator (io.codetail.animation.arcanimator.ArcAnimator)2 Animator (com.nineoldandroids.animation.Animator)1 AnimatorListenerAdapter (com.nineoldandroids.animation.AnimatorListenerAdapter)1