Example usage for android.view.animation AccelerateInterpolator AccelerateInterpolator

List of usage examples for android.view.animation AccelerateInterpolator AccelerateInterpolator

Introduction

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

Prototype

public AccelerateInterpolator() 

Source Link

Usage

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  2s.c  o  m*/
    outToBottom.setInterpolator(new AccelerateInterpolator());
    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);
    inFromBottom.setDuration(350);/*from   www. java 2s.c  om*/
    inFromBottom.setInterpolator(new AccelerateInterpolator());
    return inFromBottom;
}

From source file:Main.java

public static void animateViewsIn(View... views) {
    for (int i = 0; i < views.length; i++) {
        ViewCompat.animate(views[i]).alpha(1f).setDuration(800).setStartDelay(i * 100)
                .setInterpolator(new AccelerateInterpolator()).start();
    }//  w  w  w .j  av a  2 s.co m
}

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

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(250);/*  w  w  w .jav a 2s.co  m*/
    inFromLeft.setInterpolator(new AccelerateInterpolator());
    return inFromLeft;
}

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(250);//from   w w  w. j av a2s. c  om
    outtoRight.setInterpolator(new AccelerateInterpolator());
    return outtoRight;
}

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(250);/*from  www  .  ja va  2  s. co m*/
    inFromRight.setInterpolator(new AccelerateInterpolator());
    return inFromRight;
}

From source file:Main.java

protected static void show(final View view) {
    Animation fadeIn = new AlphaAnimation(0, 1);
    fadeIn.setStartOffset(500);/*from   ww w . j  a  v a  2 s  .  c o  m*/
    fadeIn.setDuration(500);

    Animation collapse = new ScaleAnimation(1, 1, 0, 1);
    collapse.setDuration(500);

    AnimationSet animation = new AnimationSet(false);
    animation.setInterpolator(new AccelerateInterpolator());
    animation.addAnimation(collapse);
    animation.addAnimation(fadeIn);

    animation.setAnimationListener(new Animation.AnimationListener() {
        @Override
        public void onAnimationStart(Animation animation) {
            view.setVisibility(View.VISIBLE);
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            view.setVisibility(View.VISIBLE);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {

        }
    });

    view.startAnimation(animation);
}

From source file:Main.java

public static void animteViewsOut(ViewPropertyAnimatorListener listener, View... views) {
    for (int i = 0; i < views.length; i++) {
        ViewPropertyAnimatorCompat animator = ViewCompat.animate(views[i]).alpha(0f).setDuration(800)
                .setStartDelay(i * 100).setInterpolator(new AccelerateInterpolator());

        if ((i + 1) == views.length) {
            animator.setListener(listener).start();
        } else {/* w  w  w .j  a  v  a 2  s.c o m*/
            animator.start();
        }
    }
}

From source file:Main.java

public static Animation getFadeInAnimation(int durationInMilliseconds) {
    Animation fadeIn = new AlphaAnimation(0, 1);
    fadeIn.setFillAfter(true);//from  w  ww .  ja  v  a2s . c om
    fadeIn.setInterpolator(new AccelerateInterpolator());
    fadeIn.setDuration(durationInMilliseconds);
    return fadeIn;
}