Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Context;
import android.view.View;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

public class Main {
    public static void executeAnimation(Context context, View view, int resId, AnimationListener listener) {
        Animation anim = AnimationUtils.loadAnimation(context, resId);
        executeAnimation(anim, view, listener);
    }

    public static void executeAnimation(Animation anim, View view, AnimationListener listener) {
        if (listener != null)
            anim.setAnimationListener(listener);
        view.startAnimation(anim);
    }
}