NicolasV
11/13/2024, 7:58 AMusePlatformDefaultWidth = false
, I add a LazyColumn
in this dialog ; No issue below Android 15 (< api 35), but on this version the Dialog is out of the screen at the bottom.
I know that there is the edge-to-edge system, it's surely linked but I add system paddings on my container
MaterialTheme(
colorScheme = colorScheme,
typography = MontSerrat
) {
Box(
Modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.primary)
.statusBarsPadding()
.background(MaterialTheme.colorScheme.background)
.navigationBarsPadding()
) {
content()
}
}
so I tried to set the height manually
val configuration = LocalConfiguration.current
val screenHeight = configuration.screenHeightDp
Dialog(
onDismissRequest = { /**Nothing**/ },
properties = DialogProperties(
dismissOnBackPress = false,
dismissOnClickOutside = false,
decorFitsSystemWindows = false,
usePlatformDefaultWidth = false
)
) {
BoxWithConstraints(
Modifier
.fillMaxWidth()
.height(screenHeight.dp)
.background(TransparentBlack)
.padding(20.dp)
) {
LazyColumn(
modifier = Modifier
.fillMaxWidth()
.height(maxHeight)
.align(Alignment.TopCenter)
.background(LightGrey, shape = RoundedCornerShape(20.dp))
.padding(20.dp)
) {
[...]
}
}
}
it doesn't work
I found a "solution" but I don't like it at all : I added a big padding on the LazyColumn
LazyColumn(
modifier = Modifier
.fillMaxWidth()
.height(maxHeight - if(isApi35) 60.dp else 0.dp )
.align(Alignment.TopCenter)
.background(LightGrey, shape = RoundedCornerShape(20.dp))
.padding(20.dp)
)
Is there a better way to handle this ?