List of usage examples for android.view.animation AnimationUtils loadAnimation
public static Animation loadAnimation(Context context, @AnimRes int id) throws NotFoundException
From source file:Main.java
public static void performAlphaAnimationWithCustomTime(int i, View view, Context context) { Animation animation = AnimationUtils.loadAnimation(context, 0x7f040008); animation.setDuration(i);/*from ww w. jav a 2 s . co m*/ view.startAnimation(animation); }
From source file:Main.java
public static Animation runFadeInAnimationOn(Context ctx, View target) { Animation animation = AnimationUtils.loadAnimation(ctx, android.R.anim.fade_in); target.startAnimation(animation);/*from w w w.ja v a 2s. c o m*/ return animation; }
From source file:Main.java
public static Animation runFadeOutAnimationOn(Context ctx, View target) { Animation animation = AnimationUtils.loadAnimation(ctx, android.R.anim.fade_out); target.startAnimation(animation);/*from w w w.jav a 2s . c o m*/ return animation; }
From source file:Main.java
public static void showEmpty(Activity activity, boolean show, View emptyView) { Animation anim = AnimationUtils.loadAnimation(activity, show ? android.R.anim.fade_in : android.R.anim.fade_out); if (show && (emptyView.getVisibility() == View.GONE || emptyView.getVisibility() == View.INVISIBLE)) { emptyView.setAnimation(anim);//from ww w .ja v a 2 s .c o m emptyView.setVisibility(View.VISIBLE); } else if (!show && emptyView.getVisibility() == View.VISIBLE) { emptyView.setAnimation(anim); emptyView.setVisibility(View.GONE); } }
From source file:Main.java
public static void executeAnimation(Context context, View view, int resId, AnimationListener listener) { Animation anim = AnimationUtils.loadAnimation(context, resId); executeAnimation(anim, view, listener); }
From source file:Main.java
public static void showEmpty(Context activity, boolean show, View emptyView) { if (emptyView != null) { Animation anim = AnimationUtils.loadAnimation(activity, show ? android.R.anim.fade_in : android.R.anim.fade_out); if (show && (emptyView.getVisibility() == View.GONE || emptyView.getVisibility() == View.INVISIBLE)) { emptyView.setAnimation(anim); emptyView.setVisibility(View.VISIBLE); } else if (!show && emptyView.getVisibility() == View.VISIBLE) { emptyView.setAnimation(anim); emptyView.setVisibility(View.GONE); }//w ww. j a va 2 s.c o m } }
From source file:Main.java
/** * Runs a simple animation on a View with no extra parameters. * * @param context//from w w w . j a v a 2s .com * @param view * @param animationId */ private static void runSimpleAnimation(Context context, View view, int animationId) { view.startAnimation(AnimationUtils.loadAnimation(context, animationId)); }
From source file:Main.java
/** * Load anim and set duration//from w ww. j a v a 2 s . c o m * * @param anim * @param duration * @return */ public static Animation loadAnimation(Context context, int anim, int duration) { Animation animation = AnimationUtils.loadAnimation(context, anim); animation.setDuration(duration); return animation; }
From source file:Main.java
public static void startAnim(Context context, int resId, int resAnimId) { // Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake); // findViewById(R.id.xxx).startAnimation(shake); Animation shake = AnimationUtils.loadAnimation(context, resAnimId); ((Activity) context).findViewById(resId).startAnimation(shake); }
From source file:Main.java
public static Animation animateView(Context context, int animationResource) { Animation a = AnimationUtils.loadAnimation(context, animationResource); return a;/*from w w w . j a v a2 s . co m*/ }