Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;

import android.view.View;

public class Main {
    private static final long ANIM_DURATION_FADEIN = 200;

    public static ObjectAnimator fadeIn(final View v) {
        ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(v, "alpha", 0f, 1f);
        alphaAnim.setDuration(ANIM_DURATION_FADEIN);
        alphaAnim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationStart(Animator animation) {
                v.setVisibility(View.VISIBLE);
            }
        });

        return alphaAnim;
    }
}