Skip to content

Latest commit

 

History

History
 
 

alertdialog

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Alert Dialog

Create simple alert dialogs with simple code

Supported platforms: Android.

You may be looking for the Material version or the AppCompat version.

Example

import splitties.alertdialog.alertDialog
import splitties.alertdialog.cancelButton
import splitties.alertdialog.messageResource
import splitties.alertdialog.okButton
import splitties.alertdialog.onShow
import splitties.alertdialog.positiveButton

class YourActivity : AppCompatActivity {

    //...

    private fun doIrreversibleStuffOrCancel() {
        alertDialog {
            messageResource = R.string.dialog_msg_confirm_irreversible_stuff
            okButton { irreversibleStuff() }
            cancelButton()
        }.onShow {
            positiveButton.textColorResource = R.color.red_500
        }.show()
    }
}

Download

implementation("com.louiscad.splitties:splitties-alertdialog:$splitties_version")