Skip to content

Instantly share code, notes, and snippets.

@acappelli
Created December 29, 2014 13:13
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 acappelli/112f7cce0e5417bedb82 to your computer and use it in GitHub Desktop.
Save acappelli/112f7cce0e5417bedb82 to your computer and use it in GitHub Desktop.
<!--
Copyright 2014 Soichiro Kashima
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<FrameLayout 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:orientation="vertical">
<!--
Dummy background contents.
You can replace this to map or something.
-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#E91E63" />
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#3F51B5" />
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#2196F3" />
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#03A9F4" />
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#8BC34A" />
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#FFEB3B" />
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#FFC107" />
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#FF9800" />
</LinearLayout>
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="@dimen/flexible_space_image_height"
android:scaleType="centerCrop"
android:src="@drawable/example" />
<com.github.ksoichiro.android.observablescrollview.TouchInterceptionFrameLayout
android:id="@+id/scroll_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.ksoichiro.android.observablescrollview.ObservableScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/header_bar_height"
android:background="@android:color/white"
android:fillViewport="true">
<TextView
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:text="@string/lipsum" />
</com.github.ksoichiro.android.observablescrollview.ObservableScrollView>
<FrameLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false">
<View
android:id="@+id/header_background"
android:layout_width="match_parent"
android:layout_height="@dimen/header_bar_height"
android:background="?attr/colorPrimary"
android:minHeight="@dimen/header_bar_height" />
<LinearLayout
android:id="@+id/header_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/header_bar_height"
android:minHeight="@dimen/header_bar_height"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingLeft="@dimen/margin_standard"
android:textColor="@android:color/white"
android:textSize="20sp" />
</LinearLayout>
<com.melnykov.fab.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
app:fab_colorNormal="@color/accentLight"
app:fab_colorPressed="@color/accent" />
</FrameLayout>
</com.github.ksoichiro.android.observablescrollview.TouchInterceptionFrameLayout>
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment