Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch on LinearListView within a NestedScrollView blocks scrolling #14

Open
alican opened this issue Oct 6, 2015 · 2 comments
Open

Comments

@alican
Copy link

alican commented Oct 6, 2015

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>
@rahul-ramanujam
Copy link

Does the LinearListView implement NestedScrollingChild?

@marosseleng
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants