I have a ModalBottomSheetLayout
@Composable
fun BottomSheetWrapper() {
ModalBottomSheetLayout(
sheetState = sheetState,
sheetContent = {
Spacer(modifier = Modifier.height(1.dp))
content()
},
modifier = modifier,
content = {}
)}
and I add it to the root of activity using extension function:
fun Fragment.showAsBottomSheet(content: @Composable (() -> Unit) -> Unit) {
val viewGroup = requireActivity().findViewById(android.R.id.content) as ViewGroup
addContentToView(viewGroup, content)
}
I do it just like presented in this article
It works perfectly on all of my screens except of just one. That screen is very complicated and has multiple custom views which is impossible to post here.
As a result this bottomsheet
overlaps with the screen content. It feels like bottomsheet
is displayed behind some of the content. It't not clickable and not draggable and I can scroll other content over my bottomsheet
on that screen.
My first guess was to set elevation
to ModalBottomSheetLayout
itself but it didn't help.
Just wanted to see if anyone has any ideas how to force ModalBottomSheetLayout
to be displayed on top of other XML content.