animate Alpha via ObjectAnimator - Android Animation

Android examples for Animation:Alpha Fly Animation

Description

animate Alpha via ObjectAnimator

Demo Code


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

import android.view.View;

public class Main {
    public static final long ALPHA_DURATION = 500;

    public static void animateAlpha(View view, float start, float end) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view,
                "alpha", start, end);
        objectAnimator.setDuration(ALPHA_DURATION);
        objectAnimator.start();/*from   ww w . ja  va  2 s. c o m*/
    }
}

Related Tutorials