Skip to content

Instantly share code, notes, and snippets.

@yaronv
Created December 28, 2015 21:28
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 yaronv/5bb031e93b860263a23e to your computer and use it in GitHub Desktop.
Save yaronv/5bb031e93b860263a23e to your computer and use it in GitHub Desktop.
Sample activity xml file
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true"
android:background="@color/app_screens_bg_grey"
tools:context="yv.jot.activities.LocationDetailsActivity">
<android.support.design.widget.AppBarLayout
android:layout_height="192dp"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<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="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/place_image"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:src="@drawable/material_bg"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar"
android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" >
<include layout="@layout/content_location_details"/>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment