简体   繁体   中英

android collapsing toolbar bounce while scrolling recyclerview

Hi I'm trying to add header with recyclerview so I decide to go with material components CoordinatorLayout & AppBarLayout then CollapsingToolbarLayout,

But While i scroll slightly up it getting bounce. Can you please help me then also suggest me how can i added header for recyclerview without this apporach,If any good examples please share.

Thanks in advance!

    <?xml version="1.0" encoding="utf-8"?>
   <android.support.design.widget.CoordinatorLayout   xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:wheel="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">


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

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        app:contentScrim="?attr/colorPrimary"
        app:expandedTitleMarginEnd="64dp"
        app:expandedTitleMarginStart="48dp"
        app:layout_scrollFlags="scroll|enterAlwaysCollapsed">

        <include
            app:layout_collapseMode="pin"
            layout="@layout/main_lay_header"
             />

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

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


<!--<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/refreshDashBoard"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    -->
    <android.support.v7.widget.RecyclerView
        android:id="@+id/scrollableview"
        android:layout_width="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:layout_height="match_parent"
        android:layout_below="@+id/appbar"
        android:background="@color/sep_color" />
<!--</android.support.v4.widget.SwipeRefreshLayout>-->


<com.pnikosis.materialishprogress.ProgressWheel
    android:id="@+id/progress_wheel"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_centerHorizontal="true"
    android:layout_gravity="center"
    android:layout_centerVertical="true"
    android:visibility="gone"
    wheel:matProg_barColor="#5588FF"
    wheel:matProg_progressIndeterminate="true" />

<doodleblue.doodleblue.com.widgets.CustomButton
    android:id="@+id/bottomBarText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:background="#1CD591"
    android:text="Create"
    android:textAllCaps="false"
    android:textColor="@color/white"
    android:textSize="@dimen/text_size_5"
    android:visibility="gone"
    custom:typeface="Brandon_med" />

Try this link . Hope this help you out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM