Android examples for android.animation:ObjectAnimator
alpha Show ObjectAnimator
//package com.java2s; import android.animation.ObjectAnimator; import android.support.annotation.NonNull; import android.view.View; public class Main { public static final int DURATION_MID = 800; public static void alphaShow(@NonNull final View view) { if (view.getWindowToken() == null) return; view.setVisibility(View.VISIBLE); ObjectAnimator alpha = ObjectAnimator .ofFloat(view, "alpha", 0f, 1f); alpha.setDuration(DURATION_MID); alpha.start();//from w ww . jav a 2 s . co m } }