android - CoordinatorLayout doesn't work like I want it to -
i have layout code in activity. in viewpager
have fragments contains recyclerview. when scroll top of list have scroll again have coordinatorlayout expand. how can in 1 seamless scroll:
<android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.appbarlayout android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="300dp" android:fitssystemwindows="true" android:background="?colorprimary"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" app:expandedtitletextappearance="@style/textappearance.appcompat.widget.actionbar.title.inverse" app:expandedtitlemarginstart="20dp" app:expandedtitlemarginbottom="10dp" app:contentscrim="?attr/colorprimary" android:fitssystemwindows="true" app:layout_scrollflags="scroll|exituntilcollapsed"> <imageview android:id="@+id/image" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_collapsemode="parallax" android:scaletype="centercrop" android:transitionname="obrazek" android:src="@drawable/placer" /> <view android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/gradient" /> <android.support.v7.widget.toolbar android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="?actionbarsize" android:theme="@style/themeoverlay.appcompat.dark.actionbar" app:contentinsetstart="40dp" app:layout_scrollflags="scroll|enteralways" app:layout_collapsemode="pin" /> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <linearlayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" app:layout_behavior="@string/appbar_scrolling_view_behavior" > <android.support.design.widget.tablayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="horizontal" android:background="?attr/colorprimary" app:layout_behavior="@string/appbar_scrolling_view_behavior"/> <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"/> </linearlayout> <android.support.design.widget.floatingactionbutton android:id="@+id/fab" app:fabsize="normal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" app:elevation="6dp" app:layout_anchor="@id/main_content" app:layout_anchorgravity ="bottom|right|end" android:src="@drawable/ic_directions_run_white_48dp" />
you don't need set app:layout_behavior
tablayout
, viewpager
. setting app:layout_behavior
linearlayout
suffice.
Comments
Post a Comment