Last active
September 26, 2016 19:51
-
-
Save luckyhandler/0b84656dd42a8f6b09592d3845d267ee to your computer and use it in GitHub Desktop.
Android - Collapsing Toolbar Skeleton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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" | |
xmlns:tools="http://schemas.android.com/tools" | |
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"> | |
<android.support.design.widget.CollapsingToolbarLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:contentScrim="?attr/colorPrimary" | |
app:layout_scrollFlags="scroll|exitUntilCollapsed"> | |
<ImageView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:adjustViewBounds="true" | |
android:scaleType="centerCrop"/> | |
<include layout="@layout/layout_toolbar"/> | |
</android.support.design.widget.CollapsingToolbarLayout> | |
</android.support.design.widget.AppBarLayout> | |
<android.support.v4.widget.NestedScrollView | |
app:layout_behavior="@string/appbar_scrolling_view_behavior" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"/> | |
</android.support.design.widget.CoordinatorLayout> | |
-------------- | |
<android.support.v7.widget.Toolbar | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="?attr/actionBarSize" | |
app:layout_collapseMode="pin"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment