Android Animation Create outToRightAnimation()

Here you can find the source of outToRightAnimation()

Description

out To Right Animation

License

Open Source License

Declaration

static public Animation outToRightAnimation() 

Method Source Code

//package com.java2s;

import android.view.animation.AccelerateInterpolator;

import android.view.animation.Animation;

import android.view.animation.TranslateAnimation;

public class Main {
    static public Animation outToRightAnimation() {

        Animation outtoRight = new TranslateAnimation(

        Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT,
                +1.0f,/*from   w w  w.j a  v a2 s  . co m*/

                Animation.RELATIVE_TO_PARENT, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f

        );

        outtoRight.setDuration(200);

        outtoRight.setInterpolator(new AccelerateInterpolator());

        return outtoRight;

    }

    static public Animation outToRightAnimation(int duration) {

        Animation outtoRight = new TranslateAnimation(

        Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT,
                +1.0f,

                Animation.RELATIVE_TO_PARENT, 0.0f,
                Animation.RELATIVE_TO_PARENT, 0.0f

        );

        outtoRight.setDuration(duration);

        outtoRight.setInterpolator(new AccelerateInterpolator());

        return outtoRight;

    }
}

Related

  1. mainFragmentMoveRight(int distance)
  2. mainFragmentMoveRightAt(int from, int distance)
  3. outToBottomAnimation()
  4. outToBottomAnimation(long duration)
  5. outToLeftAnimation()
  6. outToRightAnimation(int duration)
  7. inFromBottomLeftAnimation()
  8. inFromLeftAnimation()
  9. inFromRightAnimation()