Study Record

[Android] Compose 다이얼로그 본문

안드로이드/compose

[Android] Compose 다이얼로그

초코초코초코 2023. 9. 13. 16:59
728x90

😶 Alert Dialog

AlertDialog(
    onDismissRequest = {
        // Dismiss the dialog when the user clicks outside the dialog or on the back
        // button. If you want to disable that functionality, simply use an empty
        // onCloseRequest.
    },
    title = { Text(text = stringResource(R.string.congratulations)) },
    text = { Text(text = stringResource(R.string.you_scored, score)) },
    modifier = modifier,
    dismissButton = {
        TextButton(
            onClick = {
                activity.finish()
            }
        ) {
            Text(text = stringResource(R.string.exit))
        }
    },
    confirmButton = {
        TextButton(onClick = onPlayAgain) {
            Text(text = stringResource(R.string.play_again))
        }
    }
)

 

 

 

 

androidx.compose.material3  |  Android Developers

androidx.appsearch.builtintypes.properties

developer.android.com

 

 

Dialogs – Material Design 3

Dialogs provide important prompts in a user flow. They can require an action, communicate information for making decisions, or help users accomplish a focused task.

m3.material.io

 

728x90