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 setAlphaAnimation(View view, float fromAlpha, float toAlpha, int intDuration,
        boolean boolFillAfter) {
    AlphaAnimation mAnmation = new AlphaAnimation(fromAlpha, toAlpha);
    mAnmation.setDuration(intDuration);/*  w w w.  j  a v a2 s .co m*/
    mAnmation.setFillAfter(boolFillAfter);
    // mAnmation.setRepeatMode(Animation.RESTART);
    // mAnmation.setRepeatCount(intRepeatCount);
    // mAnmation.setInterpolator(AnimationUtils.loadInterpolator(mContext,
    // com.webclient.R.anim.bounce_interpolator));
    view.startAnimation(mAnmation);
}

From source file:Main.java

public static void fadeIn(View view, long duration, long delay) {
    Animation animation = new AlphaAnimation(0, 1);
    animation.setDuration(duration);//from ww  w .  ja  va2s.c o  m
    animation.setStartOffset(delay);

    view.startAnimation(animation);
}

From source file:Main.java

public static void fadeIn(View view, int durationMillis) {
    if (view != null) {
        AlphaAnimation fadeImage = new AlphaAnimation(0, 1);
        fadeImage.setDuration(durationMillis);
        fadeImage.setInterpolator(new DecelerateInterpolator());
        view.startAnimation(fadeImage);/*w w  w.j a v a  2  s  .c  o  m*/
    }
}

From source file:Main.java

public static Animation createAlpha(float fromAlpha, float toAlpha, long duration) {
    Animation animation = new AlphaAnimation(fromAlpha, toAlpha);
    animation.setInterpolator(new DecelerateInterpolator());
    animation.setDuration(duration);//  w  w w.ja va2  s  .c  o m

    return animation;
}

From source file:Main.java

public static Animation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis) {
    AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha);
    alpha.setDuration(durationMillis);//from  w  ww  . j av  a2s .c  o m
    alpha.setFillAfter(true);
    return alpha;
}

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);/*from  ww  w  .  j  a  v a  2 s.  c  o m*/
}

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 Animation initAlphaAnimtion(Context context, float fromAlpha, float toAlpha, long duration) {
    Animation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha);
    alphaAnimation.setDuration(duration);
    return alphaAnimation;
}

From source file:Main.java

public static Animation getAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis) {
    Animation alphaAnimation = new AlphaAnimation(fromAlpha, toAlpha);
    alphaAnimation.setDuration(durationMillis);
    return alphaAnimation;
}

From source file:Main.java

public static Animation createAlphaAnimation(float fromAlpha, float toAlpha, long duration) {
    AlphaAnimation anim = new AlphaAnimation(fromAlpha, toAlpha);
    anim.setDuration(duration);// w  w  w  .  j  a  v a2 s.co m
    anim.setInterpolator(new AccelerateInterpolator());
    return anim;
}