Example usage for android.view.animation LinearInterpolator LinearInterpolator

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

Introduction

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

Prototype

public LinearInterpolator() 

Source Link

Usage

From source file:Main.java

public static LinearInterpolator getLinearInterpolator() {
    return new LinearInterpolator();
}

From source file:Main.java

public static void doSimpleRefresh(Object view) {
    LinearInterpolator interpolator = new LinearInterpolator();
    ObjectAnimator refreshAnimator = ObjectAnimator.ofFloat(view, "rotation", 0f, 360f);
    refreshAnimator.setInterpolator(interpolator);
    refreshAnimator.setDuration(300);//from w w w.jav a  2  s .  co  m
    refreshAnimator.setRepeatCount(3);
    refreshAnimator.start();
}

From source file:Main.java

public static void slideFromLeftToRight(View view) {
    ObjectAnimator animator = ObjectAnimator.ofFloat(view, "X", -2000, 0).setDuration(1000);

    animator.setInterpolator(new LinearInterpolator());

    animator.start();/*from   w w  w.j  av a  2 s  .  c  om*/
}

From source file:Main.java

public static Animator createNoAnimationAnimator(View view) {
    ValueAnimator anim = ValueAnimator.ofInt(0, 1);
    anim.setInterpolator(new LinearInterpolator());
    anim.setDuration(1);//w  ww.j  a  v  a2s  .  c  om

    return anim;
}

From source file:Main.java

public static ObjectAnimator createShowGradientAnimation(View view) {
    ObjectAnimator alphaAnimation = ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1f);
    alphaAnimation.setDuration(400);//from w  ww  .  j ava  2 s . c om
    alphaAnimation.setInterpolator(new LinearInterpolator());
    return alphaAnimation;
}

From source file:Main.java

public static Animator createFadeInAnimator(View view) {
    ObjectAnimator anim = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
    anim.setInterpolator(new LinearInterpolator());
    anim.setDuration(250);//from  w ww .ja v a2s.  c o  m

    return anim;
}

From source file:Main.java

public static Animator createFadeOutAnimator(View view) {
    ObjectAnimator anim = ObjectAnimator.ofFloat(view, "alpha", 1f, 0f);
    anim.setInterpolator(new LinearInterpolator());
    anim.setDuration(250);/*from  w  ww .  j a  va  2  s.com*/

    return anim;
}

From source file:Main.java

public static void animateView(View view) {
    final Animation animation = new AlphaAnimation(1f, 0f);
    animation.setDuration(1000); // Animate for 1 seconds
    animation.setInterpolator(new LinearInterpolator());
    animation.setRepeatCount(Animation.INFINITE);
    animation.setRepeatMode(Animation.REVERSE);
    view.startAnimation(animation);/*  www .  j a  va  2  s  .c om*/
}

From source file:Main.java

public static void setAlphaAnim(float fromAlpha, float toAlpha, long duration) {
    AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha);
    alphaAnimation.setDuration(duration);
    alphaAnimation.setInterpolator(new LinearInterpolator());

}

From source file:Main.java

public static void animaBotao(Button botao) {
    final Animation animation = new AlphaAnimation(1, 0); // Change alpha from fully visible to invisible
    animation.setDuration(400);/*from  ww  w.j  a v  a  2 s  .c o m*/
    animation.setInterpolator(new LinearInterpolator()); // do not alter animation rate
    animation.setRepeatCount(2);
    animation.setRepeatMode(Animation.REVERSE); // Reverse animation at the end so the button will fade back in
    botao.startAnimation(animation);
}