Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;

public class Main {
    public static Animation makeInvisibleAnimated(final View view) {
        final Animation a = new AlphaAnimation(1.00f, 0.00f);
        a.setDuration(500);
        a.setAnimationListener(getFadeOutListener(view));

        view.startAnimation(a);

        return a;
    }

    private static AnimationListener getFadeOutListener(final View view) {
        final AnimationListener fadeOutListener = new AnimationListener() {

            public void onAnimationEnd(final Animation animation) {
                view.setVisibility(View.INVISIBLE);
            }

            public void onAnimationRepeat(final Animation animation) {

            }

            public void onAnimationStart(final Animation animation) {

            }
        };

        return fadeOutListener;
    }
}