Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    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);
            }
        }
    }
}