Android Animation Create outToRightAnimation(int duration)

Here you can find the source of outToRightAnimation(int duration)

Description

out To Right Animation

License

Open Source License

Declaration

static public Animation outToRightAnimation(int duration) 

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,/*w  ww.jav a2s. 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. mainFragmentMoveRightAt(int from, int distance)
  2. outToBottomAnimation()
  3. outToBottomAnimation(long duration)
  4. outToLeftAnimation()
  5. outToRightAnimation()
  6. inFromBottomLeftAnimation()
  7. inFromLeftAnimation()
  8. inFromRightAnimation()
  9. inFromRightAnimation(int duration)