get Y Z Translate Animation - Android Animation

Android examples for Animation:Translate Animation

Description

get Y Z Translate Animation

Demo Code


//package com.java2s;

import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;

public class Main {
    public static Animation getYZTranslate(float fromYZoom, float toYZoom,
            long duration) {
        TranslateAnimation animation = new TranslateAnimation(
                Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
                0, Animation.RELATIVE_TO_SELF, fromYZoom,
                Animation.RELATIVE_TO_SELF, toYZoom);
        animation.setFillAfter(true);/* w w w .ja va  2s .  c  om*/
        animation.setDuration(duration);
        return animation;
    }
}

Related Tutorials