Last active
April 22, 2020 20:49
-
-
Save dan085/9b6981ea1d5fd4ecc39c9593ead9383c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//funcion en load_info | |
fun showMessageOKCancel_one( | |
ctx: Context, | |
title: String, | |
message: String, | |
okListener: Function1<MaterialDialog, Unit> | |
): MaterialDialog { | |
val a = MaterialDialog(ctx) | |
a.cancelable(false) | |
a.title(R.string.app_name, title) | |
a.message(R.string.app_name, message, false, 1.0f) | |
a.negativeButton(R.string.cancel, ctx.resources.getString(R.string.cancel), null) -----> aqui va el null para el caso de cancelar pedes agregar otro listener y editarlo en las declaraciónes de la función | |
a.positiveButton(R.string.ok, ctx.resources.getString(R.string.ok), okListener) ----> aqui va el listener en caso de aceptar | |
a.show() | |
return a | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment