Java tutorial
//package com.java2s; //License from project: Open Source License import android.animation.Animator; import android.animation.ObjectAnimator; import android.view.View; public class Main { /** * Create fade in animation for appearing effect * * @param target target view for animating * @param durationInMilis animation duration * @param delayInMilis start animation in delay * @param listener listener of animation behaviour */ public static void setFadeAppearEffect(View target, int durationInMilis, int delayInMilis, Animator.AnimatorListener listener) { ObjectAnimator alphaAnimation6 = ObjectAnimator.ofFloat(target, "alpha", 0.0F, 1.0F); alphaAnimation6.setStartDelay(delayInMilis); alphaAnimation6.setDuration(durationInMilis); if (listener != null) { alphaAnimation6.addListener(listener); } alphaAnimation6.start(); } }