package com.renrenliao.im.utils

import com.renrenliao.im.provider.ClarityPotion
import com.renrenliao.im.widget.dialog.LoadingDialog

object DialogLoaingUtils {
    private var mDialogLoading: LoadingDialog? = null

    fun showDialogLoading() {
        if (mDialogLoading == null) {
            mDialogLoading = ClarityPotion.currentActivity()?.let { LoadingDialog(it) }
        }
        if (!mDialogLoading!!.isShowing) {
            mDialogLoading!!.show()
        }
    }

    fun hideDialogLoading() {
        if (mDialogLoading != null && mDialogLoading!!.isShowing) {
            mDialogLoading!!.dismiss()
        }
    }

}