Last active
February 15, 2021 23:04
-
-
Save mitchtabian/c382c26ae769e42ccfc109b327e27a25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val isShowing = remember{ mutableStateOf(true) } | |
if(isShowing.value){ | |
AlertDialog( | |
onDismissRequest = {isShowing.value = false}, | |
title = { Text("Dialog Title") }, | |
text = { Text("Here is the description text for a dialog.") }, | |
buttons = { | |
Row( | |
modifier = Modifier | |
.fillMaxWidth() | |
.padding(8.dp), | |
horizontalArrangement = Arrangement.End, | |
){ | |
Button( | |
modifier = Modifier.padding(end = 8.dp), | |
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.onError), | |
onClick = {isShowing.value = false} | |
) { | |
Text(text = "Cancel") | |
} | |
Button( | |
modifier = Modifier.padding(end = 8.dp), | |
onClick = {isShowing.value = false} | |
) { | |
Text(text = "Ok") | |
} | |
} | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment