To animate view slide out from right to left - Android Animation

Android examples for Animation:Slide Animation

Description

To animate view slide out from right to left

Demo Code


//package com.java2s;

import android.view.View;

import android.view.animation.TranslateAnimation;

public class Main {
    /**/* w w  w. ja va2s.c  o  m*/
     * To animate view slide out from right to left
     *
     * @param view
     */
    public static void slideToLeft(View view) {
        TranslateAnimation animate = new TranslateAnimation(40, 0, 0, 0);
        animate.setDuration(500);
        animate.setFillAfter(false);
        view.startAnimation(animate);
    }
}

Related Tutorials