Composable nested within ScrollView in a XML layout is not scrolling, intercepted by ScrollView

Viewed 32

I have tried a few answers which had worked with XML only layouts, they do not seem to be working for XML with ComposeViews inside.

I need my ComposeView to get/handle the motion event.

I have tried to override dispatchTouchEvent of parent layouts, and dispatch to ComposeView. I have tried requestdisallowintercepttouchevent on parent layout, on ScrollView its self and other nested layouts.

Any suggestions would be greatly appreciated!

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="@dimen/size_0"
        android:paddingBottom="@dimen/size_24"
        android:fillViewport="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/contentWrapperLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:id="@+id/top_Component_Layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingStart="@dimen/size_24"
                android:paddingTop="@dimen/size_0"
                android:paddingEnd="@dimen/size_24"
                android:paddingBottom="@dimen/size_32"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_bias="0.018">

                <androidx.compose.ui.platform.ComposeView
                    android:id="@+id/composeView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="16dp"
                    android:paddingBottom="@dimen/size_8"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"/>
0 Answers
Related