Anyone have any idea why my AlertDialog only shows...
# compose-android
c
Anyone have any idea why my AlertDialog only shows a single line of text even though my text is much longer?
Copy code
val text = stateHolder.myFlow.collectAsState(initial = null).value.toString()
AlertDialog(
    onDismissRequest = dismiss,
    icon = { Icon(Icons.Filled.Settings, contentDescription = null) },
    title = { Text(text = "Test") },
    text = {
        Log.e("ABC", text)
            Text(
                text = text
            )
    },
    confirmButton = {},
    dismissButton = {})
I end up with only one line going across my dialog. But logcat outputs
null
Some really long string that is the actual output of the flowable and I can see the whole thing in logcat but not the dialog
If I change the text arg to
Copy code
text = {
    Log.e("ABC", text)
        Text(
            text = "blah".repeat(30)
        )
},
then my dialog will show like 3 lines. Pretty confused. my only hunch is that technically in my actual code, (as seen in logcat too) is that the initial value is null, and so the Dialog will not change it's height?
z
Sounds plausible. As a workaround, you can just not show the alert until the value is non-null. But this sounds like a layout bug, please file
❤️ 1
👍 1
a
I am not sure if this affect your findings or not.. but we should always log data using
SideEffect { Log.e("ABC", text) }
c
@Zach Klippenstein (he/him) [MOD] that suggestion helped! thanks
z
I think its due to how
AlertDialogFlowRow
works, should probably be migrated to
FlowRow
?