get Z Translate Animation - Android Animation

Android examples for Animation:Translate Animation

Description

get Z Translate Animation

Demo Code


//package com.java2s;

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

public class Main {
    public static Animation getZTranslate(float fromXZoom, float toXZoom,
            float fromYZoom, float toYZoom, long duration) {
        TranslateAnimation animation = new TranslateAnimation(
                Animation.RELATIVE_TO_SELF, fromXZoom,
                Animation.RELATIVE_TO_SELF, toXZoom,
                Animation.RELATIVE_TO_SELF, fromYZoom,
                Animation.RELATIVE_TO_SELF, toYZoom);
        animation.setFillAfter(true);//  w w  w . j  a  v a2  s. c o  m
        animation.setDuration(duration);
        return animation;
    }
}

Related Tutorials