Is the material3 website wrong about what's supported in Android? For instance, I was looking for `F...
v
Is the material3 website wrong about what's supported in Android? For instance, I was looking for
FullScreenDialog
, as listed here https://m3.material.io/components/dialogs/overview - but it's definitely not listed here https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary !
m
It's supported by the standard Dialog implementation. Just size the inner content appropriately:
Copy code
@OptIn(ExperimentalComposeUiApi::class)
@Preview
@Composable
fun DialogTestPreview() {
    MaterialTheme {
        Dialog(
            onDismissRequest = { },
            properties = DialogProperties(
                usePlatformDefaultWidth = false
            )
        ) {
            Column(modifier = Modifier
                .fillMaxSize(1.0f)
                .clip(RoundedCornerShape(8.dp))
                .background(Color.White)
            ) {
                IconButton(onClick = { /*TODO*/ }, modifier = Modifier.align(Alignment.End)) {
                    Icon(Icons.Default.Close, contentDescription = null)
                }
                Text(text = "Title")
                Button(onClick = { }) {
                    Text("OK")
                }
            }
        }
    }
}
message has been deleted
v
Ah. Thank you. Documentation a little unclear, I saw only AlertDialog on the android reference page.
m
Yeah. ALso, AlertDialog passes it's "modifier" attribute on to your content as well. So you could in theory have a full screen alert dialog by having it fillMaxSize(). If you look, ALertDialog basically does what's above, but in a way that's opinionated about the content.
c
cc @Gurupreet singh
f
As @mattinger said the most importat piece is usePlatformDefaultWidth = false