Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas

PatilShreyas/NamedArgs.kt Secret

Created Dec 21, 2020
Embed
What would you like to do?
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