Skip to content

Instantly share code, notes, and snippets.

@amsterdatech
Last active April 26, 2021 04:15
Show Gist options
  • Save amsterdatech/c86f6072ae19dbc41bae46068d0b76cd to your computer and use it in GitHub Desktop.
Save amsterdatech/c86f6072ae19dbc41bae46068d0b76cd to your computer and use it in GitHub Desktop.
val showDialogButton = findViewById<Button>(R.id.show_dialog_button)
showDialogButton?.let {
it.setOnClickListener {
dialog {
title = resources.getString(R.string.custom_dialog_title)
contentText = resources.getString(R.string.custom_dialog_body)
negativeText = resources.getString(R.string.custom_dialog_negative_text)
positiveText = resources.getString(R.string.custom_dialog_positive_text)
positiveAction = { toast("Positive Action!!!") }
negativeAction = { toast("Negative Action!!!") }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment