Create Fade In Animation via ObjectAnimator - Android Animation

Android examples for Animation:Fade Animation

Description

Create Fade In Animation via ObjectAnimator

Demo Code


//package com.java2s;
import android.animation.ObjectAnimator;
import android.view.View;

public class Main {
    public static void FadeIn(View view, int duration) {
        ObjectAnimator fadeIn = ObjectAnimator.ofFloat(view, "alpha", 0f,
                1f);//from  w  w w .  j  av a  2s .c o  m
        fadeIn.setDuration(duration);
        fadeIn.start();
    }
}

Related Tutorials