Skip to content

Instantly share code, notes, and snippets.

@Rishabhk07
Created July 16, 2017 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rishabhk07/90674397cf5c655838a65542a21385bb to your computer and use it in GitHub Desktop.
Save Rishabhk07/90674397cf5c655838a65542a21385bb to your computer and use it in GitHub Desktop.
Collapsing toolbar android
<?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:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_height="250dp"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:background="@color/transparent"
>
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/ctFullStory"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="@android:color/white"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
>
<ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/ivFullStory"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax"
android:scaleType="centerCrop"
/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:layout_collapseMode="pin"
/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include
layout="@layout/full_story_webview"></include>
</android.support.design.widget.CoordinatorLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment