Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import android.animation.ObjectAnimator;

import android.view.View;

public class Main {
    public static void animShow(View v) {
        animShow(v, 300, 0, 1);
    }

    public static void animShow(View v, int duration, float from, float to) {
        if (v.getVisibility() == View.GONE) {
            v.setVisibility(View.VISIBLE);
        }
        v.clearAnimation();
        ObjectAnimator.ofFloat(v, "alpha", from, to).setDuration(duration).start();

    }
}