Android Animation Create mainFragmentBackFromRight(int distance)

Here you can find the source of mainFragmentBackFromRight(int distance)

Description

main Fragment Back From Right

License

Open Source License

Declaration

static public Animation mainFragmentBackFromRight(int distance) 

Method Source Code

//package com.java2s;

import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.BounceInterpolator;

import android.view.animation.TranslateAnimation;

public class Main {
    static public Animation mainFragmentBackFromRight(int distance) {

        AnimationSet animationSet = new AnimationSet(true);

        Animation step1 = new TranslateAnimation(Animation.ABSOLUTE,
                distance, Animation.ABSOLUTE, 720, Animation.ABSOLUTE, 0,
                Animation.ABSOLUTE, 0);// www  .ja va 2s  .c  o  m
        step1.setDuration(200);

        Animation step2 = new TranslateAnimation(Animation.ABSOLUTE, 100,
                Animation.ABSOLUTE, -720, Animation.ABSOLUTE, 0,
                Animation.ABSOLUTE, 0);
        step2.setDuration(400);

        animationSet.addAnimation(step1);
        animationSet.addAnimation(step2);
        animationSet.setInterpolator(new BounceInterpolator());
        return animationSet;

    }
}

Related

  1. mainFragmentBackFromLeft()
  2. mainFragmentBackFromLeftAt(int currentX, int distance)
  3. mainFragmentBackFromRightAt(int from)
  4. mainFragmentMoveLeft(int distance)
  5. mainFragmentMoveLeftAt(int from, int distance)
  6. mainFragmentMoveRight(int distance)