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 void setFlickerAnimation(View v) {
    final Animation animation = new AlphaAnimation(1, 0); // Change alpha
    animation.setDuration(500); // duration - half a second
    animation.setInterpolator(new LinearInterpolator()); // do not alter
                                                         // animation
                                                         // rate
    animation.setRepeatCount(Animation.INFINITE); // Repeat animation
                                                  // infinitely
    animation.setRepeatMode(Animation.REVERSE); //
    v.setAnimation(animation);//ww  w .jav a2  s  . c  o m
}

From source file:Main.java

public static Animation fadeIn(final android.view.animation.Animation.AnimationListener animationlistener) {
    final AlphaAnimation alphaanimation = new AlphaAnimation(0F, 1F);
    alphaanimation.setDuration(300L);//from w w w.  j  a v a2 s  . c om
    alphaanimation.setInterpolator(new LinearInterpolator());
    alphaanimation.setAnimationListener(animationlistener);
    return alphaanimation;
}

From source file:Main.java

public static Animation fadeOut(final android.view.animation.Animation.AnimationListener animationlistener) {
    final AlphaAnimation alphaanimation = new AlphaAnimation(1F, 0F);
    alphaanimation.setDuration(300L);/*w w w  .  j  a  v  a 2 s.c o m*/
    alphaanimation.setInterpolator(new LinearInterpolator());
    alphaanimation.setAnimationListener(animationlistener);
    return alphaanimation;
}

From source file:Main.java

public static Animation fadeInLong(final android.view.animation.Animation.AnimationListener animationlistener) {
    final AlphaAnimation alphaanimation = new AlphaAnimation(0F, 1F);
    alphaanimation.setDuration(600L);// w  ww  . j a v a 2s.  co m
    alphaanimation.setInterpolator(new LinearInterpolator());
    alphaanimation.setAnimationListener(animationlistener);
    return alphaanimation;
}

From source file:Main.java

public static void startBlink(View view) {
    if (null == view) {
        return;/*  w w w .j a  v a2 s.c o m*/
    }
    Animation alphaAnimation = new AlphaAnimation(1, 0);
    alphaAnimation.setDuration(500);
    alphaAnimation.setInterpolator(new LinearInterpolator());
    alphaAnimation.setRepeatCount(Animation.INFINITE);
    alphaAnimation.setRepeatMode(Animation.REVERSE);
    view.startAnimation(alphaAnimation);
}

From source file:Main.java

public static void rotate0to180(View view) {
    RotateAnimation rotate = new RotateAnimation(0, 180, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(ANIM);//from   w  w w  .  ja v a2 s  .co m
    rotate.setInterpolator(new LinearInterpolator());
    rotate.setFillAfter(true);
    view.startAnimation(rotate);
}

From source file:Main.java

public static Animation getRotateAnimation() {
    final RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, .5f,
            Animation.RELATIVE_TO_SELF, .5f);
    rotateAnimation.setDuration(1500);//from w  w w. j  av a  2  s . c o m
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setRepeatCount(Animation.INFINITE);
    return rotateAnimation;
}

From source file:Main.java

public static void rotate180to360(View view) {
    RotateAnimation rotate = new RotateAnimation(180, 360, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(ANIM);/*  w w  w.  java2s  .c o m*/
    rotate.setInterpolator(new LinearInterpolator());
    rotate.setFillAfter(true);
    view.startAnimation(rotate);
}

From source file:Main.java

public static void popup(View view) {

    AnimationSet animation = new AnimationSet(true);
    float pivotX = view.getWidth() / 2;
    float pivotY = view.getHeight() / 2;
    ScaleAnimation anim = new ScaleAnimation(0f, 1.1f, 0f, 1.1f, pivotX, pivotY);
    anim.setInterpolator(new LinearInterpolator());
    anim.setDuration(300);/*w  w w  .  j  a v  a2 s.  co  m*/
    animation.addAnimation(anim);

    anim = new ScaleAnimation(1.1f, 1f, 1.1f, 1f, pivotX, pivotY);
    anim.setInterpolator(new LinearInterpolator());
    anim.setDuration(100);
    anim.setStartOffset(300);
    animation.addAnimation(anim);

    view.startAnimation(animation);
}

From source file:Main.java

public static void shake(View v) {
    final float distance = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4.0f,
            v.getResources().getDisplayMetrics());
    final ObjectAnimator animator = ObjectAnimator.ofFloat(v, "translationX", 0, distance, 0, -distance, 0);
    animator.setRepeatMode(ObjectAnimator.RESTART);
    animator.setInterpolator(new LinearInterpolator());
    animator.setRepeatCount(4);//from ww  w. j  av  a2s  .co m
    animator.setDuration(150);
    animator.start();
}