Thread
#compose
    mario

    mario

    1 year ago
    Hello, I have a question about alerdialog, this component only can have a title and a text? according the API one alertdialog have these parameters
    title: (@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?
    and no, the
    text
    composable slot allows you to set anything inside it
    mario

    mario

    1 year ago
    yes I know is a compose function, but I have a strange result with a OutlinedTextField, and the name "text" maybe would be better a "content" as a button
    a

    alorma

    1 year ago
    what youmean by "strange result".... if you post some code, and screenshots we may can help you
    mario

    mario

    1 year ago
    yes let me share a video
    a

    alorma

    1 year ago
    mario

    mario

    1 year ago
    @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))
    
                }
            }
        )
    }
    I am using rc2
    a

    alorma

    1 year ago
    uhmmm, yes weird. maybe use a Box, and give it a fixed height bigger than the outlined text box itself
    mario

    mario

    1 year ago
    yes, this way works but i wouldn't like to have a fixed height, wrapContentHeight should work 😞
    a

    alorma

    1 year ago
    don't forget to mention if you found a solutioon
    mario

    mario

    1 year ago
    ok I will do so, thx
    @alorma I found the problem
    a

    alorma

    1 year ago
    😛arty-parrot:
    mario

    mario

    1 year ago
    the problem is my custom typografy
    I am using font
    Sarabum
    it must be a little bigger than the default
    im going to open a issue because i think should adapt to all kinds of fonts
    Eric Ampire [MOD]

    Eric Ampire [MOD]

    1 year ago
    It's also possible to use
    Dialog
    instead of
    AlertDialog
    if you want to have a custom layout