Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;

import android.view.animation.DecelerateInterpolator;

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

public class Main {
    public static AnimationSet RotateAndFadeInAnimation() {

        AlphaAnimation fade_in = new AlphaAnimation(0.2f, 1f);
        fade_in.setDuration(400);
        fade_in.setStartOffset(0);
        fade_in.setFillAfter(true);

        ScaleAnimation expand = new ScaleAnimation(0.2f, 1, 0.2f, 1, Animation.RELATIVE_TO_SELF, .5f,
                Animation.RELATIVE_TO_SELF, .5f);
        expand.setDuration(500);
        expand.setStartOffset(0);
        expand.setFillAfter(true);

        RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, .5f,
                Animation.RELATIVE_TO_SELF, .5f);
        rotate.setDuration(500);
        rotate.setStartOffset(0);
        // rotate.setInterpolator(new LinearInterpolator());
        rotate.setFillAfter(true);

        AnimationSet Reload = new AnimationSet(true);
        Reload.addAnimation(fade_in);
        Reload.addAnimation(expand);
        Reload.addAnimation(rotate);
        Reload.setInterpolator(new DecelerateInterpolator(1.3f));
        return Reload;
    }
}