Skip to content

Instantly share code, notes, and snippets.

@bartekpacia
Created December 3, 2019 23:25
Show Gist options
  • Save bartekpacia/725856fc35fec2a321a5a2ddba49a75d to your computer and use it in GitHub Desktop.
Save bartekpacia/725856fc35fec2a321a5a2ddba49a75d to your computer and use it in GitHub Desktop.
dialog with forced stack button layout
btnAccept.setOnClickListener {
val builder = MaterialAlertDialogBuilder(this, R.style.ThemeOverlay_MaterialComponents_MaterialAlertDialog)
.setTitle(R.string.are_you_sure)
.setMessage(R.string.are_you_sure_accept)
.setPositiveButton(" ${getString(R.string.accept)}") { _, _ ->
requestDetailViewModel.acceptRequest(relationResponse.id)
}
.setNeutralButton(" ${getString(R.string.cancel)}") { _, _ ->
// Nothing to do
}
builder.show()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment