am 6cd95a46: am 0e667215: Add transparent status bar demo

* commit '6cd95a46a7f6a0f94eb0e0d58c8d0ddf0992c3b5':
  Add transparent status bar demo
This commit is contained in:
Chris Banes
2015-05-08 16:57:22 +00:00
committed by Android Git Automerger
11 changed files with 114 additions and 12 deletions

View File

@@ -153,6 +153,15 @@
</intent-filter>
</activity>
<activity android:name=".widget.AppBarLayoutToolbarCollapseWithImageWithInsets"
android:label="@string/design_appbar_collapsing_toolbar_with_image_insets"
android:theme="@style/Theme.Design.TransparentStatus">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.example.android.support.design.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name=".widget.AppBarLayoutToolbarParallaxOverlapContent"
android:label="@string/design_appbar_parallax_overlap"
android:theme="@style/Theme.Design">

View File

@@ -22,14 +22,14 @@
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_height="192dp"
android:layout_width="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_app_bar"
android:layout_width="match_parent"
android:layout_height="192dp"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar

View File

@@ -23,14 +23,14 @@
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_height="wrap_content"
android:layout_height="192dp"
android:layout_width="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_app_bar"
android:layout_width="match_parent"
android:layout_height="192dp"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar

View File

@@ -21,14 +21,14 @@
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_height="192dp"
android:layout_width="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_app_bar"
android:layout_width="match_parent"
android:layout_height="192dp"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed">
<android.support.v7.widget.Toolbar

View File

@@ -22,16 +22,16 @@
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_height="192dp"
android:layout_width="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_app_bar"
android:layout_width="match_parent"
android:layout_height="192dp"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:foregroundScrimColor="?attr/colorPrimary">
app:contentScrim="?attr/colorPrimary">
<ImageView
android:id="@+id/app_bar_image"

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ 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.
-->
<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:layout_height="256dp"
android:layout_width="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_app_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:contentScrim="?attr/colorPrimary">
<ImageView
android:id="@+id/app_bar_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax"
android:src="@drawable/photo"
android:scaleType="centerCrop"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/include_appbar_scrollview"/>
</android.support.design.widget.CoordinatorLayout>

View File

@@ -22,17 +22,17 @@
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_height="192dp"
android:layout_width="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_app_bar"
android:layout_width="match_parent"
android:layout_height="192dp"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:layout_scrollInterpolator="@android:anim/decelerate_interpolator"
app:foregroundScrimColor="?attr/colorPrimary">
app:contentScrim="?attr/colorPrimary">
<ImageView
android:id="@+id/app_bar_image"

View File

@@ -17,6 +17,11 @@
<resources>
<style name="Theme.Design.TransparentStatus">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
<style name="Theme.Navigation" parent="Theme.Navigation.Base">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>

View File

@@ -69,6 +69,7 @@
<string name="design_appbar_collapsing_toolbar_pin_fab">AppBar/Collapsing Toolbar (pinned with FAB)</string>
<string name="design_appbar_collapsing_toolbar_scroll">AppBar/Collapsing Toolbar (scroll off)</string>
<string name="design_appbar_collapsing_toolbar_with_image">AppBar/Collapsing Toolbar + Parallax Image</string>
<string name="design_appbar_collapsing_toolbar_with_image_insets">AppBar/Collapsing Toolbar + Parallax Image + Insets</string>
<string name="design_appbar_parallax_overlap">AppBar/Parallax Overlapping content</string>
<string name="scroll_top">Top</string>
<string name="scroll_bottom">Bottom</string>

View File

@@ -23,6 +23,8 @@
<item name="colorAccent">#FFAB40</item>
</style>
<style name="Theme.Design.TransparentStatus">
</style>
<style name="Theme.FAB" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#ff00bcd4</item>

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2015 The Android Open Source Project
*
* 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.
*/
package com.example.android.support.design.widget;
import com.example.android.support.design.R;
public class AppBarLayoutToolbarCollapseWithImageWithInsets extends AppBarLayoutUsageBase {
@Override
protected int getLayoutId() {
return R.layout.design_appbar_toolbar_collapse_with_image_insets;
}
}