Skip to content Skip to sidebar Skip to footer

Collapsingtoolbarlayout Like Playstore App

I am trying to have the same behavior as the PlayStore app in terms of scrolling. Here is the gif of what I want to achieve https://giphy.com/gifs/MymB51M84gpdS. What I have is the

Solution 1:

Similiar question:collapsing toolbar layout like google play store

There is an ImageView with parallax collapseMode and of course, they pinned the Toolbar but after collapsing the CollapsingToolbarLayout, Toolbar is going to be hide.

Something like this:

<android.support.design.widget.CoordinatorLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height="match_parent"><android.support.design.widget.AppBarLayoutandroid:id="@+id/appBarLayout"android:layout_width="match_parent"android:layout_height="wrap_content"android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"><android.support.design.widget.CollapsingToolbarLayoutandroid:id="@+id/seffafCollapsingToolbarLayout"android:layout_width="match_parent"android:layout_height="240dp"app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"><ImageViewandroid:id="@+id/header"android:layout_width="match_parent"android:layout_height="match_parent"android:scaleType="centerCrop"android:src="@drawable/header"app:layout_collapseMode="parallax" /><android.support.v7.widget.Toolbarandroid:id="@+id/toolbar"android:layout_width="match_parent"android:layout_height="?attr/actionBarSize"app:layout_collapseMode="pin" /></android.support.design.widget.CollapsingToolbarLayout></android.support.design.widget.AppBarLayout></android.support.design.widget.CoordinatorLayout>

Result:

enter image description here

Post a Comment for "Collapsingtoolbarlayout Like Playstore App"