Alerts Library for Android
Inspired by JavaScript SweetAlert
Kotlin version is 1.0.5-2.
Show Basic Alert
Alert("Aviso", "Se ingresó correctamente") {
confirmButton("OK")
}.show()
Show Warning Alert
Alert("Aviso", "Seguro que desea eliminarlo", DialogType.Warning) {
confirmButton("Sí")
}.show()
Show Input Text Alert
InputTextAlert("Ingresar", "Nombre") {
confirmButton("OK") { dialog, input ->
dismiss()
}
cancelButton("Cancelar")
}.show()
Show Selector Alert
val users = listOf("Kevin", "Kelly", "Juan", "Cristina")
SelectorAlert("Aviso", users) {
Log.i("Selected", users[it])
}.show()
Show Download Alert
val alert = DownloadAlert("En progreso", "Sincronizando usuarios")
alert.show()
// Updating Alert
alert.updateProgress(1, 50)