Android Animation Create inFromRightAnimation(int duration)

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

Description

in From Right Animation

License

Open Source License

Declaration

static public Animation inFromRightAnimation(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 inFromRightAnimation() {

        Animation inFromRight = new TranslateAnimation(

        Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT,
                0.0f,/*w  ww  .  j a  v  a  2  s  .  c  o  m*/

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

        );

        inFromRight.setDuration(200);

        inFromRight.setInterpolator(new AccelerateInterpolator());

        return inFromRight;

    }

    static public Animation inFromRightAnimation(int duration) {

        Animation inFromRight = new TranslateAnimation(

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

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

        );

        inFromRight.setDuration(duration);

        inFromRight.setInterpolator(new AccelerateInterpolator());

        return inFromRight;

    }
}

Related

  1. outToRightAnimation()
  2. outToRightAnimation(int duration)
  3. inFromBottomLeftAnimation()
  4. inFromLeftAnimation()
  5. inFromRightAnimation()