CollapsingToolbarLayout also collapse Toolbar when using with RecyclerView when scrolling up
I don't want to make Toolbar(ActionBar) disappear when scrolling screen up or while collapsing within AppBarLayout.
I am using CoordinatorLayout.
Following is my layout file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/coordinator"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="#dimen/header_pic_height"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways"
android:fitsSystemWindows="true"
app:contentScrim="#color/PrimaryColor"
app:expandedTitleMarginStart="48dp"
app:expandedTitleMarginEnd="64dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_collapseMode="parallax">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="#style/AppTheme"
android:title=" "
app:layout_collapseMode="pin" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_collapseMode="parallax"
android:background="#color/PrimaryColor"
android:padding="5dp">
<FrameLayout
android:layout_width="55dp"
android:layout_marginLeft="8dp"
android:layout_height="match_parent"
android:layout_marginRight="16dp">
<ImageView
android:id="#+id/imageView"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="4dp"
android:layout_marginTop="5dp"
/>
<ImageView
android:id="#+id/check_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginBottom="20dp"
android:src="#drawable/check_sm"
android:layout_gravity="center_vertical"
android:visibility="gone" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_collapseMode="parallax" >
<TextView
android:id="#+id/projectName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="#+id/MainFragmentTicketItemAccount"
android:ellipsize="end"
android:singleLine="true"
android:text="Project Name"
android:layout_marginLeft="6dp"
android:textColor="#android:color/white"
android:textSize="#dimen/list_text_size"/>
<TextView
android:id="#+id/labelProjectNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="#string/lbl_project_no"
android:textSize="14sp"
android:textColor="#color/label_color" />
<TextView
android:id="#+id/projectNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="2"
android:layout_marginLeft="6dp"
android:text="657894512"
android:textStyle="bold"
android:textColor="#color/text_color"
android:textSize="12sp" />
<TextView
android:id="#+id/labelAccountName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="#string/lbl_account_name"
android:textSize="14sp"
android:textColor="#color/label_color" />
<TextView
android:id="#+id/accountName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="2"
android:layout_marginLeft="6dp"
android:text="Aqui del carlos"
android:textStyle="bold"
android:textColor="#color/text_color"
android:textSize="12sp" />
<TextView
android:id="#+id/labelstartDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="#string/start_date"
android:textSize="14sp"
android:textColor="#color/label_color" />
<TextView
android:id="#+id/startDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="2"
android:layout_marginLeft="6dp"
android:text="25-06-2016"
android:textStyle="bold"
android:textColor="#color/text_color"
android:textSize="12sp" />
<TextView
android:id="#+id/labelEndDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="#string/acc5"
android:textSize="14sp"
android:textColor="#color/label_color" />
<TextView
android:id="#+id/endDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="2"
android:layout_marginLeft="6dp"
android:text="30-06-2016"
android:textStyle="bold"
android:textColor="#color/text_color"
android:textSize="12sp" />
<TextView
android:id="#+id/labelpadidod_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="#string/lbl_padido_no"
android:textSize="14sp"
android:textColor="#color/label_color" />
<TextView
android:id="#+id/padidoNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="2"
android:layout_marginLeft="6dp"
android:text="4581233"
android:textStyle="bold"
android:textColor="#color/text_color"
android:textSize="12sp" />
<TextView
android:id="#+id/lbl_installation_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="#string/lbl_installation_no"
android:textSize="14sp"
android:textColor="#color/label_color" />
<TextView
android:id="#+id/installationNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="2"
android:layout_marginLeft="6dp"
android:text="4581233"
android:textStyle="bold"
android:textColor="#color/text_color"
android:textSize="12sp" />
<TextView
android:id="#+id/lbl_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="6dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="#string/status"
android:textSize="14sp"
android:textColor="#color/label_color" />
<TextView
android:id="#+id/status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:maxLines="2"
android:layout_marginLeft="6dp"
android:text="Activo"
android:textStyle="bold"
android:textColor="#color/text_color"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="#+id/imageView123"
android:layout_width="match_parent"
android:layout_height="30dp"
android:src="#drawable/arrow_up_circle"/>
</LinearLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/simpleRecyclerView"
android:layout_height="match_parent"
android:layout_width="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="#+id/MainFragmentEmptyLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone"
android:gravity="center">
<ImageView
android:layout_height="194dp"
android:layout_width="253dp"
android:src="#drawable/ic_main_no_data"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/no_data1"
android:textSize="25sp"
android:textStyle="bold"
android:textColor="#color/info_no_data_color"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/no_data2"
android:textSize="15sp"
android:textStyle="normal"
android:textColor="#color/info_no_data_color"
android:layout_marginTop="5dp"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
while scrolling appBar it should be fixed when reached to toolbar height, so i need toolbar fixed at its position.
thanks.
My requirement is something different from other SO question that is toolBar not collapsing etc but in my case i don't wanted to collapse my toolBar while scrolling up and collapsing appBar,
So i came up with following solution, this will help someone with similar issue.
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:minHeight="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:contentScrim="#color/PrimaryColor"
app:expandedTitleMarginStart="48dp"
app:expandedTitleMarginEnd="64dp">
following couple line of code solved my issue.
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:minHeight="?attr/actionBarSize"
Related
I have a problem I want the orange cardView on the top to be like this:
and when the user Scorll I have to make this orange card scroll as well
but I used coordinate layout with anchor for the card
I've to make it invisible when the user scrolls away a little bit but I have this:
my question is how to make this orange cardview to stay and scroll with other layout elements?
my xml file is:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_collapseMode="pin"
app:popupTheme="#style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:id="#+id/nested_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/profile_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:layout_marginLeft="#dimen/app_margin"
android:layout_marginRight="#dimen/app_margin"
android:layout_marginBottom="#dimen/app_margin"
app:elevation="3dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Medium"
android:layout_marginTop="60dp"
android:layout_marginBottom="#dimen/app_margin"
android:text="Mark Davis"
android:layout_centerHorizontal="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="#id/username"
android:text="IT consuler"
android:layout_marginBottom="#dimen/app_margin"
android:id="#+id/textView" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/textView"
android:layout_marginTop="15dp"
android:layout_weight="1"
android:elevation="3dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Personal Information"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Medium" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.v7.widget.CardView>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_margin="#dimen/app_margin"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Medium"
android:text="Personal Inforamtion"
android:elevation="3dp"
android:textStyle="bold"
android:layout_margin="#dimen/app_margin"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User Name"
android:textStyle="bold"
android:textSize="16sp"
android:textColor="#color/colorAccent"
android:layout_marginBottom="#dimen/app_margin"
android:layout_marginLeft="#dimen/app_margin"
android:textAppearance="#style/TextAppearance.AppCompat.Small"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="User Name"
android:layout_marginLeft="32dp"
android:layout_marginRight="#dimen/app_margin"
android:layout_marginBottom="#dimen/app_margin"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Email"
android:textStyle="bold"
android:textSize="16sp"
android:textColor="#color/colorAccent"
android:layout_marginBottom="#dimen/app_margin"
android:layout_marginLeft="#dimen/app_margin"
android:textAppearance="#style/TextAppearance.AppCompat.Small"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:layout_marginLeft="32dp"
android:layout_marginRight="#dimen/app_margin"
android:layout_marginBottom="#dimen/app_margin"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Display name"
android:textStyle="bold"
android:textSize="16sp"
android:textColor="#color/colorAccent"
android:layout_marginBottom="#dimen/app_margin"
android:layout_marginLeft="#dimen/app_margin"
android:textAppearance="#style/TextAppearance.AppCompat.Small"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Display name"
android:layout_marginLeft="32dp"
android:layout_marginRight="#dimen/app_margin"
android:layout_marginBottom="#dimen/app_margin"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:textStyle="bold"
android:textSize="16sp"
android:textColor="#color/colorAccent"
android:layout_marginBottom="#dimen/app_margin"
android:layout_marginLeft="#dimen/app_margin"
android:textAppearance="#style/TextAppearance.AppCompat.Small"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:layout_marginLeft="32dp"
android:layout_marginRight="#dimen/app_margin"
android:layout_marginBottom="#dimen/app_margin"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.v7.widget.CardView
android:id="#+id/profile_pic"
android:layout_margin="#dimen/app_margin"
android:layout_width="100dp"
android:layout_height="100dp"
app:layout_anchor="#id/profile_card"
app:layout_anchorGravity="center|top"
app:cardCornerRadius="50dp"
app:cardBackgroundColor="#color/colorAccent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/ic_profile"/>
</android.support.v7.widget.CardView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/buttonLove"
android:layout_width ="wrap_content"
android:layout_height="wrap_content"
android:src = "#drawable/ic_edit"
app:borderWidth="0dp"
android:elevation="5dp"
app:pressedTranslationZ="12dp"
app:rippleColor="#color/button_white"
android:onClick="onClick"
android:background="#color/colorAccent"
android:layout_margin="#dimen/app_margin"
android:layout_gravity="bottom|end"
app:fabSize="normal"
/>
</android.support.design.widget.CoordinatorLayout>
I need a help with CoordinatorLayout... I need hide/show toolbar when scrolling and together with this hiding behavior I need make smaller text and hide another layout in my AppBarLayout...
My layout looks like this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="#+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/main_light_gray">
<include
layout="#layout/toolbar_layout_filter_sales" />
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
local:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#color/main_light_gray">
<android.support.design.widget.TabLayout
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:id="#+id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/tablayout_background"
local:tabIndicatorColor="#color/main_red"
local:tabIndicatorHeight="0dp"
local:tabGravity="center"
local:tabBackground="#drawable/tab_background_selector"
local:tabMode="fixed"
local:tabPaddingStart="20dp"
local:tabPaddingEnd="20dp"
local:tabTextColor="#color/main_dark_text"
local:tabSelectedTextColor="#color/white" />
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="fill_parent"
local:layout_behavior="#string/appbar_scrolling_view_behavior" />
</LinearLayout>
</RelativeLayout>
<!--</LinearLayout>-->
</android.support.design.widget.CoordinatorLayout>
Layout toolbar_layout_filter_sales looks like this:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/layout_rounded_corners"
android:stateListAnimator="#null"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
local:layout_scrollFlags="scroll|enterAlways"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
local:popupTheme="#style/ThemeOverlay.AppCompat.Light">
<LinearLayout
android:layout_marginTop="25dp"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<TextView
android:textStyle="bold"
android:textColor="#color/white"
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
style="#style/TextAppearance.AppCompat.Widget.ActionBar.Title"
android:layout_gravity="center" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:id="#+id/toolbar_refresh_layout"
android:layout_marginRight="15dp"
android:layout_marginLeft="15dp"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/toolbar_refresh"
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="centerInside"
android:src="#drawable/ic_refresh" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
<LinearLayout
android:id="#+id/filterLayout"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="5dp">
<TextView
android:textSize="18dp"
android:textStyle="bold"
android:ellipsize="marquee"
android:maxLines="1"
android:text="Today"
local:MvxBind="Text SelectedFilterText"
android:textColor="#color/white"
android:id="#+id/filterTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="2dp"
android:layout_marginBottom="1dp" />
<Button
android:textAllCaps="false"
android:id="#+id/filterButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14dp"
android:text="15.5.2018"
local:MvxBind="Text CurrentPeriod"
android:ellipsize="marquee"
android:maxLines="1"
android:textColor="#color/white"
android:gravity="center_vertical"
android:textStyle="normal"
android:background="#android:color/transparent"
android:drawableEnd="#drawable/arrow_down_white"
android:drawablePadding="10dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="0dp" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/main_dark_line"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="0dp" />
<LinearLayout
android:id="#+id/filterLayout"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp">
<TextView
android:text="58 395,00"
local:MvxBind="TextFormatted TotalSales, Converter=SpannableStringPriceConverter"
android:textSize="26dp"
android:textStyle="bold"
android:ellipsize="marquee"
android:maxLines="1"
android:textColor="#color/white"
android:id="#+id/salesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp" />
<TextView
local:MvxBind="Text LastUpdate, Converter=LastUpdateConverter"
android:textSize="12dp"
android:textStyle="italic"
android:ellipsize="marquee"
android:maxLines="1"
android:text="XX"
android:textColor="#color/white"
android:id="#+id/lastUpdateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
</LinearLayout>
</android.support.design.widget.AppBarLayout>
In default it looks like this:
After scrolling I have this:
But I need something like this:
I need text with value make smaller and text under value hide.
I don't understand why my CollapsingToolbar layout is collapsed when my view is created by default.
I think this the NestedScrollView the responsible but i don't no why.
This make me crazy.
My activity layout :
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="#dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v4.view.ViewPager
android:id="#+id/pager_images"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"/>
<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/AppTheme.PopupOverlay" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_product" />
</android.support.design.widget.CoordinatorLayout>
And my content_layout with nested scrollview :
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="4dp">
<include layout="#layout/layout_progress" />
<TextView
android:id="#+id/tv_reference"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="2dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="1"
android:text=""
android:textColor="#color/MyApp_gray"
android:textSize="10sp"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:fontFamily="sans-serif-light"
android:maxLines="2"
android:text=""
android:textColor="#color/cardview_dark_background"
android:textSize="16sp" />
<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_choix"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="4dp"
android:background="#android:color/white"
card_view:cardCornerRadius="2dp"
card_view:cardElevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:id="#+id/tv_quantity_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:maxLines="2"
android:text="#string/product_quantity"
android:textColor="#color/cardview_dark_background"
android:textSize="12sp" />
<com.MyApp.utils.HorizontalNumberPicker
android:id="#+id/horizontal_qty_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:background="#color/MyApp_gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="#+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text=""
android:textColor="#color/cardview_dark_background"
android:textSize="18sp"
android:textStyle="" />
<TextView
android:id="#+id/tv_price_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text=" / Unité"
android:textColor="#color/cardview_dark_background"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="#+id/tv_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp"
android:drawableLeft="#drawable/ic_hourglass_red_18dp"
android:drawablePadding="4dp"
android:gravity="center"
android:maxLines="2"
android:text=""
android:textColor="#color/MyApp_gray"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
</android.support.v7.widget.CardView>
<Button
android:id="#+id/btn_book"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="30dp"
android:layout_marginTop="10dp"
android:background="#drawable/btn_primary"
android:drawableLeft="#drawable/ic_add_shopping_cart_white_24dp"
android:drawablePadding="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="#string/store_action_book"
android:textColor="#android:color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_desc_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="2dp"
android:layout_marginTop="20dp"
android:ellipsize="end"
android:maxLines="1"
android:text="#string/product_description"
android:textColor="#color/cardview_dark_background"
android:textSize="14sp"
android:textStyle="bold" />
<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_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="4dp"
android:background="#android:color/white"
card_view:cardCornerRadius="2dp"
card_view:cardElevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<at.blogc.android.views.ExpandableTextView
android:id="#+id/tv_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:layout_marginTop="10dp"
android:ellipsize="end"
android:maxLines="5"
android:text=""
android:textColor="#color/MyApp_gray"
android:textIsSelectable="true"
android:textSize="12sp"
app:animation_duration="1000" />
<Button
android:id="#+id/btn_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/transparent"
android:text="#string/action_expand"
android:textColor="#color/MyApp_red" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
Rendering :
More strange it still working when i use the NestedScrollView to top. It seems like the NestedScrollView scroll to bottom automatically.
Solved with this thread :
nestedscrollview-scroll-down-itself-when-content-is-fills
android:descendantFocusability="blocksDescendants" to the LinearLayout inside NestedScrollView
Worked for me.
Collapsing layout image will only collapse and expand. Pull-down zoom view is not supported in the nested scroll view. If we zoom in on the image it does not actually zoom. What is the solution to zooming the image during pull down?
<?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"
android:id="#+id/editprofilelayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
<android.support.design.widget.AppBarLayout
android:id="#+id/materialup_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
>
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/main.collapsing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:contentScrim="#android:color/transparent"
android:fitsSystemWindows="true"
app:expandedTitleTextAppearance="#android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
>
<ImageView
android:id="#+id/materialup.profile_backdrop"
android:layout_width="match_parent"
android:layout_height="150dp"
android:scaleType="centerCrop"
android:src="#color/app_color"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"
/>0
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/profile_image"
android:layout_width="76dp"
android:layout_height="76dp"
android:layout_marginTop="100dp"
android:layout_marginLeft="20dp"
android:layout_gravity="left"
android:src="#drawable/profileicon"
android:background="#null"
app:border_width="0dp"
app:border_color="#FFF"
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"
android:background="#null"
app:layout_collapseMode="pin"
android:fitsSystemWindows="true"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
android:foreground="?android:windowActionBarOverlay"
style="#style/ToolBarWithNavigationBack">
<TextView
style="#style/TextAppearance.AppCompat.Widget.ActionBar.Title"
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:visibility="gone"
android:layout_height="wrap_content"
android:textColor="#color/white" />
</android.support.v7.widget.Toolbar>
<ImageButton
android:id="#+id/editbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_edit_profile"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:background="#null"
android:fitsSystemWindows="true"
android:nestedScrollingEnabled="false"
android:layout_gravity="center_horizontal|end"/>
<ImageButton
android:id="#+id/morebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_more_white"
android:visibility="invisible"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:background="#null"
android:fitsSystemWindows="true"
android:nestedScrollingEnabled="false"
android:layout_gravity="center_horizontal|end"/>
<LinearLayout
android:id="#+id/materialup.title_containermain2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="155dp"
android:clipChildren="false"
android:clipToPadding="false"
android:background="#null"
android:orientation="vertical"
android:gravity="center"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
>
<LinearLayout
android:id="#+id/materialup.title_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#null"
android:orientation="vertical"
android:gravity="center"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:id="#+id/layout3"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"
android:background="#null"
>
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:id="#+id/imageButton6"
android:layout_toLeftOf="#+id/editprofile"
android:layout_marginRight="15dp"
android:src="#drawable/ic_settings_profile"/>
<Button
android:layout_width="100dp"
android:layout_height="25dp"
android:id="#+id/editprofile"
android:text="Edit Profile"
android:textColor="#ffffff"
android:background="#drawable/rounded_corner_profile"
android:textSize="15dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_alignTop="#+id/imageButton6"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="11dp"
android:layout_marginEnd="18dp" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="#null"
android:background="#drawable/customcheckbox"
android:visibility="invisible"
android:gravity="center_horizontal"
android:id="#+id/follow"
android:layout_alignBottom="#+id/username"
android:layout_alignRight="#+id/editprofile"
android:layout_alignEnd="#+id/editprofile" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="18dp"
android:textStyle="bold"
android:id="#+id/username"
android:textColor="#000000"
android:layout_marginTop="30dp"
android:layout_marginLeft="18dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12dp"
android:layout_below="#+id/username"
android:id="#+id/bio"
android:textColor="#000000"
android:layout_marginTop="10dp"
android:layout_marginLeft="18dp"
/>
<ImageView
android:layout_width="15dp"
android:layout_height="wrap_content"
android:id="#+id/image4"
android:layout_below="#+id/bio"
android:src="#drawable/ic_link"
android:layout_alignBottom="#+id/website"
android:layout_marginLeft="18dp"
android:layout_marginTop="15dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12dp"
android:textColor="#color/app_color"
android:id="#+id/website"
android:layout_below="#+id/bio"
android:layout_toRightOf="#+id/image4"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="FOLLOWERS"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12dp"
android:id="#+id/followers"
android:layout_below="#+id/image4"
android:layout_toRightOf="#+id/followercount"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12dp"
android:textColor="#color/app_color"
android:id="#+id/followercount"
android:layout_below="#+id/image4"
android:layout_marginLeft="18dp"
android:layout_marginTop="10dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/app_color"
android:text="0"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12dp"
android:id="#+id/followingcount"
android:layout_below="#+id/image4"
android:layout_toRightOf="#+id/followers"
android:layout_marginLeft="18dp"
android:layout_marginTop="10dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="FOLLOWING"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12dp"
android:id="#+id/following"
android:layout_below="#+id/image4"
android:layout_toRightOf="#+id/followingcount"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="#+id/tabs1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#color/white"
app:tabSelectedTextColor="#color/app_color"
app:tabTextColor="#color/app_color"
app:tabIndicatorHeight="2dp"
app:tabIndicatorColor="#color/app_color"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll"
app:tabMode="fixed"
/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:id="#+id/nest_scrollview"
android:fillViewport="true"
android:layout_gravity="fill_vertical"
>
</android.support.v4.widget.NestedScrollView>
<com.cogzidel.hotfuse.NonSwipeableViewPager
android:id="#+id/materialup_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>
I have a collapsing toolbar layout, below that a tab layout and below that the corresponding viewpager. I want to implement snapping such that when I collapse the collapsing toolbar layout more than half and leave it, it should snap and collapse completely. How do I do it? Here is my actual layout :
<?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"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#231f20"
android:fitsSystemWindows="true">
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
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="?attr/actionBarSize"
android:layout_gravity="bottom"
android:background="#231f20"
app:layout_anchor="#+id/appbar"
app:layout_anchorGravity="bottom"
app:tabGravity="fill"
app:tabMode="fixed" />
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
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="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="#FAC80A"
app:expandedTitleMarginBottom="110dp"
app:expandedTitleMarginStart="200dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax">
<ImageView
android:id="#+id/imageView78"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:background="#drawable/user_profile_bg_img"
android:scaleType="fitXY"
android:src="#drawable/gradient" />
<ImageView
android:id="#+id/imageView82"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="10dp"
android:src="#drawable/user_profile_shape_profile_pic"
android:layout_centerVertical="true"
android:layout_marginLeft="30dp" />
<ImageView
android:id="#+id/imageView80"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="center_vertical"
android:elevation="10dp"
android:layout_marginRight="60dp"
android:layout_marginTop="35dp" />
<ImageView
android:id="#+id/imageView81"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:elevation="10dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="20dp"
android:layout_marginTop="35dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="300dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:paddingRight="10dp"
android:elevation="10dp"
android:id="#+id/fans">
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.8"
android:text="Fans"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF" />
</LinearLayout>
<ImageView
android:id="#+id/imageView179"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="10dp"
android:src="#drawable/user_profile_thin_line_separator_profile_metrics" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:paddingRight="10dp"
android:elevation="10dp"
android:id="#+id/comments">
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.8"
android:text="Comments"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF" />
</LinearLayout>
<ImageView
android:id="#+id/imageView180"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="10dp"
android:src="#drawable/user_profile_thin_line_separator_profile_metrics" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:paddingRight="10dp"
android:elevation="10dp"
android:id="#+id/bookmarks">
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<TextView
android:id="#+id/textView111"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.8"
android:text="Bookmarks"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF" />
</LinearLayout>
<ImageView
android:id="#+id/imageView181"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="10dp"
android:src="#drawable/user_profile_thin_line_separator_profile_metrics" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:elevation="10dp"
android:id="#+id/galleries">
<TextView
android:id="#+id/textView112"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="16sp" />
<TextView
android:id="#+id/textView113"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.8"
android:text="Galleries"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#FFFFFF" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/textView114"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="200dp"
android:layout_marginTop="200dp"
android:textColor="#FFFFFF" />
</RelativeLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:elevation="4dp"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
it latest version of the design library, compile 'com.android.support:design:23.1.0', the snap has been added
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
should do it