Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Created December 21, 2020 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatilShreyas/f150d4169971ff0da3a4e3e8c373d97b to your computer and use it in GitHub Desktop.
Save PatilShreyas/f150d4169971ff0da3a4e3e8c373d97b to your computer and use it in GitHub Desktop.
fun showDialog(
title: String = "",
subTitle: String = "",
message: String = "",
isCancellable: Boolean = true,
positiveButton: Button? = null,
negativeButton: Button? = null,
) {
// Your code
}
fun main() {
// Show simple info dialog
showDialog(
title = "Info",
message = "Here's Info"
)
// Show dialog with button
showDialog(
title = "Exit",
message = "Want to exit application?",
positiveButton = Button("Yes"),
negativeButton = Button("No"),
isCancellable = false
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment