Example usage for android.view.animation Animation setInterpolator

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

Introduction

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

Prototype

public void setInterpolator(Interpolator i) 

Source Link

Document

Sets the acceleration curve for this animation.

Usage

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(500);//from  w w w .  jav a  2s  .c  om
    inFromRight.setInterpolator(new AccelerateInterpolator());
    return inFromRight;
}

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);// www.jav  a  2s  . c o m
    inFromRight.setInterpolator(new AccelerateInterpolator());
    return inFromRight;
}

From source file:Main.java

public static Animation slideInAnimation() {

    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(500);//from  ww  w.j a  v a2s.  co  m
    inFromRight.setInterpolator(new AccelerateDecelerateInterpolator());
    return inFromRight;
}

From source file:Main.java

public static Animation outToTopAnimation() {
    Animation outToTop = 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);
    outToTop.setDuration(350);//from w  w w  . j a v  a2 s.  c  o m
    outToTop.setInterpolator(new AccelerateInterpolator());
    return outToTop;
}

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(DURATION);//www . ja va2  s  .c o  m
    inFromLeft.setInterpolator(new AccelerateDecelerateInterpolator());
    return inFromLeft;
}

From source file:Main.java

public static Animation inFromTopAnimation() {

    Animation inFromTop = 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);
    inFromTop.setDuration(350);//from   w w  w . ja v a2 s .  co m
    inFromTop.setInterpolator(new AccelerateInterpolator());
    return inFromTop;
}

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(OUT_DURATION);
    outtoLeft.setInterpolator(new AccelerateInterpolator());
    return outtoLeft;
}

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(250);//www  .j  a  v a 2  s. co m
    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(OUT_DURATION);
    outtoRight.setInterpolator(new AccelerateInterpolator());
    return outtoRight;
}

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);
    outToBottom.setDuration(350);/*from   ww w.  j a va 2 s .co m*/
    outToBottom.setInterpolator(new AccelerateInterpolator());
    return outToBottom;
}