create Fade In Animator - Android android.animation

Android examples for android.animation:Animator Fade

Description

create Fade In Animator

Demo Code


//package com.java2s;
import android.animation.Animator;
import android.animation.ObjectAnimator;

import android.view.View;

import android.view.animation.LinearInterpolator;

public class Main {
    public static Animator createFadeInAnimator(View view) {
        ObjectAnimator anim = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
        anim.setInterpolator(new LinearInterpolator());
        anim.setDuration(250);//from   w w w  .java2 s .  c  om

        return anim;
    }
}

Related Tutorials