I am having trouble in implementing view binding in a Custom Dialog Layout. Is it possible?
private fun showCustomDialog(title: String) {
val dialog = Dialog(activity)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setCancelable(false)
dialog.setContentView(R.layout.custom_layout)
val body = dialog.findViewById(R.id.body) as TextView
body.text = title
val noBtn = dialog.findViewById(R.id.noBtn) as TextView
yesBtn.setOnClickListener {
dialog.dismiss()
}
val yesBtn = dialog.findViewById(R.id.yesBtn) as Button
noBtn.setOnClickListener { dialog.dismiss() }
dialog.show()
}