Here is my application screen:
And layout xml:
<android.support.v4.widget.NestedScrollView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:title="@string/app_name"
app:theme="@style/Toolbar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />
</android.support.design.widget.AppBarLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/arrow_right_bold"
app:fabSize="normal" />
And I want to collapse the only content while scrolling.
I figure out that I can move Toolbar
out of AppBarLayout
but whether there is a clear way? Otherwise, I will be forced set toolbar background color
. I haven't any problem with it, but I think that it's some kind of dirty solution :)
So. How to collapse content of AppBarLayout
but not Toolbar
?