Create fly in Rotate Scale Animation - Android Animation

Android examples for Animation:Rotate Animation

Description

Create fly in Rotate Scale Animation

Demo Code


//package com.java2s;
import android.view.animation.AccelerateInterpolator;

import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;

public class Main {
    public static Animation inRotateScaleAnimation(float pivotX,
            float pivotY, float posX, float posY) {
        AnimationSet set = new AnimationSet(true);

        RotateAnimation rotate = new RotateAnimation(360, 0, pivotX, pivotY);
        rotate.setInterpolator(new AccelerateInterpolator());

        Animation scale = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, posX,
                posY);//from   ww w.ja  v a2  s .  c om
        scale.setInterpolator(new AccelerateInterpolator());

        set.addAnimation(rotate);
        set.addAnimation(scale);

        set.setDuration(1000);
        set.setInterpolator(new AccelerateInterpolator());
        return set;

    }
}

Related Tutorials