package com.renrenliao.im.widget.dialog

import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.View
import android.view.Window
import android.view.WindowManager
import android.widget.TextView
import com.renrenliao.im.R

/**
 **@ClassName ProgressDialog
 **@Description
 **@Author gan
 **@Date 2022/5/24 19:10
 **/
class ProgressDialog(context: Context) : Dialog(context, R.style.CustomDialogStyle) {
    var text_show :TextView? = null
    init {
        setCanceledOnTouchOutside(false)
        setCancelable(true)
        val view = View.inflate(context, R.layout.dialog_load, null)
        text_show = view.findViewById<TextView>(R.id.text_show)

        window?.setGravity(Gravity.CENTER)
        window?.setLayout(
            WindowManager.LayoutParams.MATCH_PARENT,
            WindowManager.LayoutParams.MATCH_PARENT
        )
        requestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY)
        window?.setContentView(view)
    }

    fun showTips(tips:String){
        text_show?.text = tips
    }
}