Create fly out Rotate Scale Animation - Android Animation

Android examples for Animation:Rotate Animation

Description

Create fly out 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 outRotateScaleAnimation(float pivotX,
            float pivotY, float posX, float posY) {
        AnimationSet set = new AnimationSet(true);

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

        Animation scale = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f, posX,
                posY);//from www.j a v a2s .c  o  m
        scale.setInterpolator(new AccelerateInterpolator());

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

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

Related Tutorials