Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Collapsing header view while scrolling up the viewpager

NoobCoder:

I'm trying to collapse my header view while scrolling up the view pager. In the following image relativelayout3 is the layout I want to collapse..

Something like playstore preview image collapse in app page..

I tried searching and the following line in relativelayout3, But it didnt work


app:layout_scrollFlags="scroll|enterAlways"

And this my complete xml,



android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://ift.tt/GEGVYd">
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/relativeLayout3"
app:layout_scrollFlags="scroll|enterAlways"
>
android:layout_width="match_parent"
android:layout_height="55dp"
android:id="@+id/toolbar"
android:background="@color/cornflower_blue_two"
android:elevation="5dp">

android:id="@+id/more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"
android:background="@null"
android:src="@drawable/ic_dots_vertical" />

android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginEnd="5dp"
android:layout_marginStart="10dp"
android:background="@null"
android:src="@drawable/ic_arrow_left" />


android:id="@+id/slider"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="@color/blue"
android:layout_below="@id/toolbar"
/>


android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_below="@+id/relativeLayout3">

android:id="@+id/product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Blah Blah"
android:textColor="@color/dark_gray"
android:textSize="25sp"
android:textStyle="bold" />

android:id="@+id/brand"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/product"
android:layout_below="@+id/product"
android:text="Blah inc."
android:textSize="20sp"
android:textStyle="bold" />

android:id="@+id/ratings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/brand"
android:layout_alignBottom="@+id/brand"
android:layout_marginStart="10dp"
android:layout_toEndOf="@+id/brand"
android:background="@color/ratings"
android:paddingEnd="10dp"
android:paddingStart="10dp"
android:text="4.7"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold" />

android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="@+id/brand"
android:layout_marginTop="14dp"
app:tabGravity="fill"
app:tabMode="fixed" />

android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="@+id/tabLayout" />









Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Collapsing header view while scrolling up the viewpager

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×