An Easy-to-use Kotlin based Customizable Library with Material Layouts by @blackbeared.
Alert dialog provides a facility to select either positive or negative option with fully customizable interface. Here is a kotlin code to use Alert Dialog.
AwesomeGeneralDialog(this)
.setTopColor(ContextCompat.getColor(this, R.color.color_deep_orange))
.setIcon(R.drawable.ic_alert)
.setTitle("Custom Alert...!")
.setPositiveButton("Ok", object : View.OnClickListener {
override fun onClick(p0: View?) {
AwesomeToast.success(this@Dashboard, "Ok clicked").show()
}
})
.setNegativeButton("Cancel", object : View.OnClickListener {
override fun onClick(p0: View?) {
AwesomeToast.error(this@Dashboard, "Cancel clicked").show()
}
})
.setMessage("Set Custom Ok and Cancel Handlers.")
.setPositiveButtonColor(ContextCompat.getColor(this, R.color.color_deep_orange))
.show()
Write the above code to get the custom alert message.