Example usage for android.view.animation Animation RELATIVE_TO_PARENT

List of usage examples for android.view.animation Animation RELATIVE_TO_PARENT

Introduction

In this page you can find the example usage for android.view.animation Animation RELATIVE_TO_PARENT.

Prototype

int RELATIVE_TO_PARENT

To view the source code for android.view.animation Animation RELATIVE_TO_PARENT.

Click Source Link

Document

The specified dimension holds a float and should be multiplied by the height or width of the parent of the object being animated.

Usage

From source file:Main.java

public static Animation outToLeftAnimation() {
    Animation outtoLeft = 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);
    outtoLeft.setDuration(350);/*from w w  w . j  ava2  s  .  com*/
    outtoLeft.setInterpolator(new AccelerateInterpolator());
    return outtoLeft;
}

From source file:Main.java

public static Animation outToRightAnimation() {
    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(350);/*w ww. j  a  v  a 2s  .  c  o m*/
    outtoRight.setInterpolator(new AccelerateInterpolator());
    return outtoRight;
}

From source file:Main.java

public static Animation inFromLeftAnimation() {
    Animation inFromLeft = 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);
    inFromLeft.setDuration(350);//from   w  w w  .  j  a  va2 s  .c om
    inFromLeft.setInterpolator(new AccelerateInterpolator());
    return inFromLeft;
}

From source file:Main.java

public static Animation inFromRightAnimation() {

    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(350);/*from www  .  ja v  a 2s.  com*/
    inFromRight.setInterpolator(new AccelerateInterpolator());
    return inFromRight;
}

From source file:Main.java

public static Animation inFromLeftAnimation() {
    Animation inFromLeft = 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);

    return inFromLeft;
}

From source file:Main.java

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

    return inFromRight;
}

From source file:Main.java

public static Animation outToBottomAnimation() {
    Animation outToBottom = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
            Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f,
            Animation.RELATIVE_TO_PARENT, +1.0f);

    return outToBottom;
}

From source file:Main.java

public static Animation inFromBottomAnimation() {
    Animation inFromBottom = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f,
            Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, +1.0f,
            Animation.RELATIVE_TO_PARENT, 0.0f);

    return inFromBottom;
}

From source file:Main.java

public static Animation createToSouthOutAnimation() {
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0,
            Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 1);
    animation.setDuration(500);/* w  w  w. jav  a 2s .c  o  m*/
    return animation;
}

From source file:Main.java

public static Animation createFromSouthInAnimation() {
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0,
            Animation.RELATIVE_TO_PARENT, 0, Animation.RELATIVE_TO_PARENT, 1, Animation.RELATIVE_TO_PARENT, 0);
    animation.setDuration(500);// www . j a va2 s. co  m
    return animation;
}