Android Animation Create inFromRightAnimation()

Here you can find the source of inFromRightAnimation()

Description

in From Right Animation

License

Open Source License

Declaration

static public Animation inFromRightAnimation() 

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  va  2s .  c om*/

                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. outToLeftAnimation()
  2. outToRightAnimation()
  3. outToRightAnimation(int duration)
  4. inFromBottomLeftAnimation()
  5. inFromLeftAnimation()
  6. inFromRightAnimation(int duration)