1

I want to add lazyColumn in bottom sheet dialog written in xml via below code:


    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/coordin"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <FrameLayout
            android:id="@+id/bottomSheet"
            style="@style/FeedbackBottomSheetDialog"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
         app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

            <androidx.core.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fillViewport="true">

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <androidx.compose.ui.platform.ComposeView
                        android:id="@+id/search_engine_compose_view"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent" />
                </FrameLayout>

            </androidx.core.widget.NestedScrollView>

        </FrameLayout>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

in the compose view lazyColumn will be placed. The problem is I can not use lazyColumn with NestedScrollView and got the following error and app crashes:

Nesting scrollable in the same direction layouts like LazyColumn and Column(Modifier.verticalScroll()) is not allowed. Does any one have any ideas how to solve the problem. Here is my lazyColumn Composable

@Composable
fun MovieList(
    movieName: List<String>
) {
    LazyColumn {
        items(movieName.size)
        {
            Text(movieName)
        }
    }
}
  • Did you figure out a solution? I'm having a similar issue: https://stackoverflow.com/questions/69770777/compose-lazycolumn-scrolling-behavior-inside-of-coordinatorlayout-via-composevie. I either need to re-write all of my bottom nav or write some interop code that works like a NestedScrollView – jchristof Nov 08 '21 at 19:41

1 Answers1

-2

In my scenario i Had

<FrameLayout
    isNestedScrollingEnabled = "true">
<ComposeView/>
</FrameLayout>

and everything seemed to be working great

Moonshine
  • 219
  • 3
  • 7
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 29 '21 at 11:31