Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.annotation.SuppressLint;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;

public class Main {
    @SuppressLint("NewApi")
    public static Animation makeVisibleAnimated(final View view) {
        final Animation a = new AlphaAnimation(0.00f, 1.00f);
        a.setDuration(500);
        a.setAnimationListener(getFadeInListener(view));

        view.startAnimation(a);

        return a;
    }

    private static AnimationListener getFadeInListener(final View view) {
        final AnimationListener fadeInListener = new AnimationListener() {

            public void onAnimationEnd(final Animation animation) {

            }

            public void onAnimationRepeat(final Animation animation) {

            }

            public void onAnimationStart(final Animation animation) {
                view.setVisibility(View.VISIBLE);
            }
        };

        return fadeInListener;
    }
}