Skip to content

SecretA/ComposeAlertDialogUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Jetpack Compose Confirmation Dialog Utils

A utils class for alert dialogs in compose

Just copy the class ConfirmationDialog.kt to you project and use it as below:

@Preview
@Composable
private fun ConfirmationDialogPreview() {
    AppTheme {
        val showDialog = remember { mutableStateOf(true) }
        ConfirmationDialog(
            showDialog = showDialog,
            titleResId = R.string.save_changes,
            bodyResId = R.string.are_you_sure,
            confirmBtnTextResId = R.string.save,
            dismissBtnTextResId = R.string.cancel
        )
    }
}

About

A utils class for alert dialogs in compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages