show View with Animation - Android android.view.animation

Android examples for android.view.animation:Show Animation

Description

show View with Animation

Demo Code

import android.content.Context;
import android.view.View;
import android.view.animation.AnimationUtils;

public class Main {

  public static void showView(Context context, View view, int animId) {
    if (view == null)
      return;//from  w ww .  j av  a2s .co m
    if (view.getVisibility() == View.VISIBLE)
      return;
    view.setVisibility(View.VISIBLE);
    view.clearAnimation();
    view.startAnimation(AnimationUtils.loadAnimation(context, animId));
  }

}

Related Tutorials