mario
07/21/2021, 11:29 AMtitle: (@Composable () -> Unit)? = null,
text: @Composable (() -> Unit)? = null,
both are composable but the name indicate something specific (text).
I have tried to create a OutlinedTextField in text parameter with a strange result, it would not be better to create a content parameter?alorma
07/21/2021, 11:31 AMalorma
07/21/2021, 11:31 AMtext
composable slot allows you to set anything inside itmario
07/21/2021, 11:33 AMalorma
07/21/2021, 11:34 AMmario
07/21/2021, 11:34 AMalorma
07/21/2021, 11:35 AMmario
07/21/2021, 11:43 AMmario
07/21/2021, 11:44 AM@Composable
fun AddAlertDialog() {
val textState = remember { mutableStateOf(TextFieldValue()) }
AlertDialog(
onDismissRequest = { },
text = {
OutlinedTextField(
modifier = Modifier.wrapContentWidth(),
value = textState.value,
onValueChange = { textState.value = it },
label = { Text("Nueva categoría") })
},
dismissButton = {
TextButton(
onClick = {}) {
Text(stringResource(id = android.R.string.cancel).uppercase(Locale.getDefault()))
}
},
confirmButton = {
TextButton(
onClick = {}) {
Text(stringResource(id = android.R.string.ok))
}
}
)
}
mario
07/21/2021, 11:45 AMalorma
07/21/2021, 11:52 AMmario
07/21/2021, 12:00 PMalorma
07/21/2021, 12:02 PMmario
07/21/2021, 12:03 PMmario
07/21/2021, 12:14 PMalorma
07/21/2021, 12:14 PMmario
07/21/2021, 12:14 PMmario
07/21/2021, 12:14 PMSarabum
mario
07/21/2021, 12:15 PMmario
07/21/2021, 12:16 PMEric Ampire [MOD]
07/23/2021, 9:01 AMDialog
instead of AlertDialog
if you want to have a custom layout