I have BottomDialog Fragment which consists only of Composable (Row(title) and LazyColumn). The first issue I faced was when you scroll your list down and then you try to scroll up list won't scroll and the dialog starts to minimize. This is solved with

modifier = Modifier.nestedScroll(rememberNestedScrollInteropConnection())

But now user can't minimize a dialog when he tries to do it by touching a title. And there is my question, How to solve this?

Minimum reproducible code

During creating this example I found that I can maximize dialog when touching the title, also I can start moving the action going to the top with my finger (to start to expand it) and then move the finger to the bottom of the screen, in this way the dialog will be dismissed, but still can't minimize it in a non-tricky way.

ComposeView(requireContext()).apply {
            setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
            setContent {
                Theme {
                    Column(modifier = Modifier.nestedScroll(rememberNestedScrollInteropConnection())) {
                        Row {
                            Text(
                                modifier = Modifier
                                    .padding(16.dp)
                                    .fillMaxWidth(),
                                text = "Title"
                            )
                        }
                        LazyColumn(
                            Modifier
                                .weight(1f)
                                .fillMaxWidth()
                        ) {
                            items(100) {
                                Text(
                                    text = "Item $it",
                                    modifier = Modifier
                                        .padding(16.dp)
                                        .fillMaxWidth(),
                                )
                            }
                        }
                    }
                }
            }
        }

Please do not propose BottomSheetScaffold. Because I want to create a standardized bottom dialog. And to use it I will need just pass a list of items and a Compose function for one item. IMO BottomSheetScaffold shouldn't be released at all, cause it was designed "not well". Just imagine earlier before Jetpack Compose you write your code around the bottom dialog, nice layering. No.

2

There are 2 best solutions below

1
On BEST ANSWER

The documentation mentions:

To resolve this, make sure you also set scrollable modifiers to these types of nested composables.

modifier = Modifier.verticalScroll(rememberScrollState()) 

Placing this on the header will fix it.

3
On

As a temp decision. I just think of LazyColumn works properly so I need to wrap my header to the LazyColumn.

So I created this function. And Just pass here any Composable

@Composable
fun TrickyLazyColumn(content: @Composable () -> Unit) {
    LazyColumn {
        items(
            items = listOf(1),
            itemContent = {
                content.invoke()
            })
    }
}

enter image description here