Skip to content

kevicsalazar/appkit-alerts-android

Repository files navigation

AppKit-Alerts-Kotlin

Alerts Library for Android

Inspired by JavaScript SweetAlert

Kotlin


Kotlin version is 1.0.5-2.

Usage

Show Basic Alert

        Alert("Aviso", "Se ingresó correctamente") {
            confirmButton("OK")
        }.show()

Show Warning Alert

        Alert("Aviso", "Seguro que desea eliminarlo", DialogType.Warning) {
            confirmButton("")
        }.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)