LinearListView icon indicating copy to clipboard operation
LinearListView copied to clipboard

Touch on LinearListView within a NestedScrollView blocks scrolling

Open alican opened this issue 9 years ago • 2 comments

I have the typical Material layout with a CollapsingToolbarLayout in a CoordinatorLayout an on the bottom a NestedScrollView with a LinearListView.

The LinearListView in the NestedScrollView blocks the scrolling function of the NestedScrollView if I touch inside the LinearListView but if I touch outside of the LinearListView within the NestedScrollView it works. But this issue only occurs when the LinearListView have just few of elements. If I have more, the touching and scrolling works with LinearListView.

Here is a sample code:

<android.support.design.widget.CoordinatorLayout
        android:id="@+id/rootLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbarlayout"
            android:layout_width="match_parent"
            android:layout_height="@dimen/app_bar_height"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/collapsingToolbarLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:contentScrim="?attr/colorPrimary"
                app:expandedTitleMargin="@dimen/expandedTitleMargin"
                app:layout_scrollFlags="scroll|exitUntilCollapsed">

                <ImageView
                    android:id="@+id/userpicture"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:scaleType="centerCrop"
                    app:layout_collapseMode="parallax"
                    app:layout_collapseParallaxMultiplier="0.7" />

                <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:layout_collapseMode="pin"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

            </android.support.design.widget.CollapsingToolbarLayout>
        </android.support.design.widget.AppBarLayout>

        <android.support.v4.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:padding="5dp"
                android:orientation="vertical">



                <android.support.v7.widget.CardView
                    xmlns:android="http://schemas.android.com/apk/res/android"    
                    xmlns:card_view="http://schemas.android.com/apk/res-auto"

                    android:id="@+id/card_view"
                    android:layout_gravity="center"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    card_view:cardCornerRadius="4dp"
                    card_view:cardUseCompatPadding="true"
                    card_view:cardPreventCornerOverlap="true"
                    android:layout_alignParentBottom="true"
                    android:clickable="false"
                    android:layout_marginBottom="35dp"
                    android:background="@color/cardview_light_background">

                    <com.linearlistview.LinearListView
                        android:clickable="false"
                        xmlns:app="http://schemas.android.com/apk/res-auto"
                        android:id="@+id/list_view"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:showDividers="middle"
                        android:dividerPadding="2dp"
                        app:dividerThickness="2dp" />

                    </android.support.v7.widget.CardView>   
            </RelativeLayout>

        </android.support.v4.widget.NestedScrollView>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fabBttn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_anchorGravity="bottom|right|end"
        app:layout_anchor="@id/appbarlayout"
        android:layout_margin="16dp"
        android:src="@drawable/ic_create_24dp"
        android:tint="@color/white"
        app:borderWidth="0dp"
        app:fabSize="normal" />

</android.support.design.widget.CoordinatorLayout>

alican avatar Oct 06 '15 13:10 alican

Does the LinearListView implement NestedScrollingChild?

rahul-ramanujam avatar May 05 '16 16:05 rahul-ramanujam

@alican Hi, did you eventually manage to do some progress on this?

marosseleng avatar Jan 26 '17 12:01 marosseleng