gone View Animation - Android User Interface

Android examples for User Interface:View Animation

Description

gone View Animation

Demo Code

/*//from w  w  w . ja va 2 s . c o m
 * *
 *  * Copyright 2012 fenbi.com. All rights reserved.
 *  * FENBI.COM PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 */
//package com.java2s;

import android.view.View;

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

public class Main {
    private static long ANIMATE_DURATION = 200;

    public static View goneView(View v, boolean animate) {
        if (v != null) {
            v.setVisibility(View.GONE);
            if (animate) {
                Animation ani = new AlphaAnimation(1f, 0f);
                ani.setDuration(ANIMATE_DURATION);
                v.startAnimation(ani);
            }
        }
        return v;
    }
}

Related Tutorials