animate View Fade In - Android User Interface

Android examples for User Interface:View Fade

Description

animate View Fade In

Demo Code

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.os.Build;
import android.view.View;
import android.view.ViewPropertyAnimator;

public class Main {
  @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
  public static void animFadeIn(final View view) {
    ViewPropertyAnimator viewPropertyAnimator = view.animate();
    viewPropertyAnimator.alpha(1f);/*  www  .  j a v  a2 s .  c  om*/
    viewPropertyAnimator.setDuration(300l);
    view.setVisibility(View.VISIBLE);
    viewPropertyAnimator.start();

    viewPropertyAnimator.setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {

      }
    });
  }
}

Related Tutorials