package com.emato.ich.utils;

import android.app.ProgressDialog;
import android.content.Context;

/**
 * 加载框
 */
public class WaitingDialogUtils {

    private static ProgressDialog progressDialog;


    public static void showWaitingDialog(Context context){
        if (progressDialog == null) {
            progressDialog = new ProgressDialog(context);
            progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        }
        progressDialog.setMessage("加载中...");
        progressDialog.setCancelable(true);
        progressDialog.show();
    }

    public static void cancelProgressDialog(){
        if (progressDialog != null) {
            if (progressDialog.isShowing()) {
                progressDialog.dismiss();
            }
        }
    }

}
