create Height Out Animation - Android Animation

Android examples for Animation:Animation Creation

Description

create Height Out Animation

Demo Code


//package com.java2s;

import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;

public class Main {
    private static final int ANIMATION_LENGTH = 500;
    private static final float SCALE_1 = 1.0f;
    private static final float SCALE_0 = 0.0f;

    /**// ww  w .  j  a  va  2 s  . co  m
     * @return A fade out animation from 100% - 0% taking half a second
     */
    public static Animation createHeightOutAnimation() {
        Animation heightOut = new ScaleAnimation(SCALE_1, SCALE_1, SCALE_1,
                SCALE_0);
        heightOut.setDuration(ANIMATION_LENGTH);
        return heightOut;
    }
}

Related Tutorials