package com.sheep.gamegroup.view.dialog;

import android.app.Activity;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.TextView;

import com.kfzs.duanduan.utils.dlg.ViewFindUtils;
import com.sheep.jiuyan.samllsheep.R;

public class DialogShowLoading {
    private TextView textView;
    private AlertDialog alertDialog;

    public static DialogShowLoading showDialog(final Activity activity) {
        DialogShowLoading dialogShowLoading= new DialogShowLoading();
        View view = View.inflate(activity, R.layout.dialog_show_loading, null);
        TextView dialog_loading = ViewFindUtils.find(view, R.id.dialog_loading);
        AlertDialog mAlertDialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
                .setView(view)
                .create();
        dialogShowLoading.setAlertDialog(mAlertDialog);
        try {
            mAlertDialog.show();
        } catch (Exception e) {
            e.printStackTrace();
        }
        dialogShowLoading.setTextView(dialog_loading);
        return dialogShowLoading;
    }

    public TextView getTextView() {
        return textView;
    }

    public void setTextView(TextView textView) {
        this.textView = textView;
    }

    public AlertDialog getAlertDialog() {
        return alertDialog;
    }

    public void setAlertDialog(AlertDialog alertDialog) {
        this.alertDialog = alertDialog;
    }
}
