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.view.View;
import android.view.animation.AlphaAnimation;

public class Main {
    public static void fadeToVisible(final View view, int startOffset, int duration) {
        int visibility = view.getVisibility();
        if (visibility != View.VISIBLE) {
            AlphaAnimation anim = new AlphaAnimation(0, 1);
            anim.setDuration(duration);
            anim.setStartOffset(startOffset);
            view.setVisibility(View.VISIBLE);
            view.startAnimation(anim);
        }
    }
}