fade to show a View VISIBLE - Android Animation

Android examples for Animation:Fade Animation

Description

fade to show a View VISIBLE

Demo Code


//package com.java2s;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.view.View;

public class Main {
    public static void fade_VISIBLE(final View view) {
        fade_VISIBLE(view, 500);/* ww w  .  j a  va  2 s  .c o  m*/
    }

    public static void fade_VISIBLE(final View view, int duration) {
        view.animate().alpha(100.0f).setDuration(duration)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        view.setVisibility(View.VISIBLE);
                    }
                });
    }
}

Related Tutorials