package com.ccwangluo.accelerator.ui.dialog

import android.content.Context
import android.view.View
import com.ccwangluo.accelerator.R
import com.xuexiang.xui.widget.dialog.materialdialog.CustomMaterialDialog
import com.xuexiang.xui.widget.dialog.materialdialog.MaterialDialog

class PermissionDialog(var context: Context, var callBack: (Boolean) -> Unit) : CustomMaterialDialog(context) {
    override fun getDialogBuilder(context: Context?): MaterialDialog.Builder {
        return MaterialDialog.Builder(context!!)
                .customView(R.layout.dialog_premission, false);
    }

    override fun initViews(context: Context?) {
        findViewById<View>(R.id.premission_know).setOnClickListener {
            this.dismiss<PermissionDialog>()
            callBack(true)
        }
    }

    init {
        mDialog.setCancelable(false)
    }
}