Example usage for android.view.animation AnimationUtils loadAnimation

List of usage examples for android.view.animation AnimationUtils loadAnimation

Introduction

In this page you can find the example usage for android.view.animation AnimationUtils loadAnimation.

Prototype

public static Animation loadAnimation(Context context, @AnimRes int id) throws NotFoundException 

Source Link

Document

Loads an Animation object from a resource

Usage

From source file:Main.java

public static Animation runFadeOutAnimationOn(Activity ctx, View target) {
    Animation animation = AnimationUtils.loadAnimation(ctx, android.R.anim.fade_out);
    target.startAnimation(animation);/*from   ww  w.  j a v  a 2s.co  m*/
    return animation;
}

From source file:Main.java

public static void animate(View view, int resAnim) {
    Animation animFadein = AnimationUtils.loadAnimation(view.getContext(), resAnim);
    view.startAnimation(animFadein);//  ww  w. j ava 2s  .co m
}

From source file:Main.java

public static Animation getEditTileAnim(Context context, int resId) {
    return AnimationUtils.loadAnimation(context, resId);
}

From source file:Main.java

public static void startAnimation(Context context, View view, int animId) {
    view.startAnimation(AnimationUtils.loadAnimation(context, animId));
}

From source file:Main.java

private static void animSlideIn(View view, int resAnim) {
    Animation animation = AnimationUtils.loadAnimation(view.getContext(), resAnim);
    view.startAnimation(animation);/*from ww  w. j a v a  2s  .c  o m*/
    view.setVisibility(View.VISIBLE);
}

From source file:Main.java

public static void performRightToLeftSwipeAnim(View view, Context context) {
    view.startAnimation(AnimationUtils.loadAnimation(context, 0x7f04000b));
}

From source file:Main.java

public static void animEff(Context context, View animView, int animId) {
    Animation shakeAnimation = AnimationUtils.loadAnimation(context, animId);
    animView.setAnimation(shakeAnimation);
}

From source file:Main.java

public static void performScaleWithCustomTime(int i, View view, Context context) {
    Animation animation = AnimationUtils.loadAnimation(context, 0x7f04000c);
    animation.setDuration(i);/*from  www  .ja  va2 s.  co  m*/
    view.startAnimation(animation);
}

From source file:Main.java

public static void performScaleXWithCustomTime(int i, View view, Context context) {
    Animation animation = AnimationUtils.loadAnimation(context, 0x7f04000d);
    animation.setDuration(i);/*from w ww  . j a  va2  s.  c o m*/
    view.startAnimation(animation);
}

From source file:Main.java

public static void animateView(Context context, View view, int resAnimId, long duration) {
    Animation a = AnimationUtils.loadAnimation(context, resAnimId);
    a.setDuration(duration);/*from w  w w.  j  av a 2s  .c  om*/
    view.startAnimation(a);
}