Example usage for android.view.animation AlphaAnimation AlphaAnimation

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

Introduction

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

Prototype

public AlphaAnimation(float fromAlpha, float toAlpha) 

Source Link

Document

Constructor to use when building an AlphaAnimation from code

Usage

From source file:Main.java

public static void disappear(long during, View view) {
    AlphaAnimation disappearAnimation = new AlphaAnimation(1, 0);
    disappearAnimation.setDuration(during);
    disappearAnimation.setFillAfter(true);
    view.startAnimation(disappearAnimation);
}

From source file:Main.java

public static void showAlpha(View v) {
    v.setVisibility(0);// w ww. j a v  a  2  s  .  c o  m
    AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
    alphaAnimation.setDuration(200);
    v.startAnimation(alphaAnimation);
}

From source file:Main.java

public static AlphaAnimation fadeBackgroundAnimation() {
    AlphaAnimation alpha = new AlphaAnimation(0.5f, 0.2f);
    alpha.setRepeatCount(Animation.INFINITE);
    alpha.setRepeatMode(Animation.REVERSE);
    alpha.setDuration(1200);/*from  w  ww.  ja v a 2  s. c  o m*/
    alpha.setFillAfter(true);
    return alpha;
}

From source file:Main.java

public static Animation FadeAnimation(float nFromFade, float nToFade) {
    Animation fadeAnimation = new AlphaAnimation(nToFade, nToFade);

    return fadeAnimation;
}

From source file:Main.java

public static void hideAlpha(View viewMask) {
    viewMask.setVisibility(View.INVISIBLE);
    AlphaAnimation alpha = new AlphaAnimation(1, 0);
    alpha.setDuration(200);// ww  w .  ja v a 2  s  .  c  o m
    viewMask.startAnimation(alpha);
}

From source file:Main.java

public static Animation getAplhaAnimation(float fromAlpha, float toAlpha) {
    AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha);
    alphaAnimation.setFillAfter(true);/* w w w .ja v  a  2 s .  c  o  m*/
    alphaAnimation.setDuration(0);
    return (alphaAnimation);
}

From source file:Main.java

public static Animation getAlpha(float fromAlpha, float toAlpha, long duration) {
    AlphaAnimation animation = new AlphaAnimation(fromAlpha, toAlpha);
    animation.setFillAfter(true);/*  w w w.j  a v  a 2s . com*/
    animation.setDuration(duration);
    return animation;
}

From source file:Main.java

public static Animation getAlphaAnimation(float startAlpha, float toAlpha, int millisSecond) {
    Animation animation = new AlphaAnimation(startAlpha, toAlpha);
    animation.setDuration(millisSecond);
    return animation;
}

From source file:Main.java

public static void setAlphaAnimation(View v, int time, int repeatCount, int startOffset) {
    AlphaAnimation myAnimation_Alpha = new AlphaAnimation(0f, 1.0f);
    myAnimation_Alpha.setDuration(time);
    myAnimation_Alpha.setRepeatCount(repeatCount);
    myAnimation_Alpha.setStartOffset(startOffset);
    v.setAnimation(myAnimation_Alpha);// www.java2  s. c  o  m
}

From source file:Main.java

public static Animation inAlphaAnimation() {
    AlphaAnimation alpha = new AlphaAnimation(0.0f, 1.0f);
    alpha.setDuration(1000);//  w  ww.j av a  2 s  . c  om
    alpha.setInterpolator(new AccelerateInterpolator());
    return alpha;
}