CancelFocusDialog.kt 1.05 KB
Newer Older
konghaorui committed
1 2 3 4 5 6 7 8
package com.yidianling.dynamic.dialog

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.WindowManager
import com.yidianling.dynamic.R
import com.yidianling.dynamic.dialog.listener.CancelFocusDialogListener
konghaorui committed
9
import kotlinx.android.synthetic.main.dynamic_cancel_focus_dialog_layout.*
konghaorui committed
10 11 12 13 14 15 16 17 18

/**
 * Created by xj on 2019/9/25.
 */
class CancelFocusDialog(val mContext: Context, val listener: CancelFocusDialogListener): Dialog(mContext, R.style.dialog_default_style) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

konghaorui committed
19
        setContentView(R.layout.dynamic_cancel_focus_dialog_layout)
konghaorui committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

        val params = window.attributes
        params.width = WindowManager.LayoutParams.MATCH_PARENT
        params.height = WindowManager.LayoutParams.MATCH_PARENT
        window.attributes = params

        cancel_focus_dialog_cancel.setOnClickListener { hide() }

        cancel_focus_dialog_sure.setOnClickListener {
            listener?.onSure()
            hide()
        }


    }

}