summaryrefslogtreecommitdiffstats
path: root/core/res
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2014-05-23 17:27:24 -0700
committerAdam Powell <adamp@google.com>2014-05-28 12:36:38 -0700
commite021e6ed8931a0a8296af182fc9b0c76b64fb0c4 (patch)
tree8bf85bb26b93d8f44d42fcf36c63091a2174b851 /core/res
parent560ce61c598d9912c4adbd9c602f1a870fb478f4 (diff)
downloadframeworks_base-e021e6ed8931a0a8296af182fc9b0c76b64fb0c4.zip
frameworks_base-e021e6ed8931a0a8296af182fc9b0c76b64fb0c4.tar.gz
frameworks_base-e021e6ed8931a0a8296af182fc9b0c76b64fb0c4.tar.bz2
Toolbar factoring and ActionBar functionality integration
Toolbars now can act in the role of ActionBar with the exception of navigation modes. Expandable action views are now supported as well as populating menu items from a host window. Change-Id: If477db9c7ad9f95723f28cf73cbf03a07ce9d6ad
Diffstat (limited to 'core/res')
-rw-r--r--core/res/res/layout/screen_toolbar.xml51
-rw-r--r--core/res/res/values/attrs.xml28
-rw-r--r--core/res/res/values/styles.xml11
-rw-r--r--core/res/res/values/styles_quantum.xml3
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--core/res/res/values/themes.xml1
-rw-r--r--core/res/res/values/themes_quantum.xml2
7 files changed, 91 insertions, 6 deletions
diff --git a/core/res/res/layout/screen_toolbar.xml b/core/res/res/layout/screen_toolbar.xml
new file mode 100644
index 0000000..290c7da
--- /dev/null
+++ b/core/res/res/layout/screen_toolbar.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+
+<!--
+This is an optimized layout for a screen with a toolbar enabled.
+-->
+
+<com.android.internal.widget.ActionBarOverlayLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/decor_content_parent"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:splitMotionEvents="false"
+ android:theme="?attr/actionBarTheme">
+ <FrameLayout android:id="@android:id/content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+ <com.android.internal.widget.ActionBarContainer
+ android:id="@+id/action_bar_container"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ style="?attr/actionBarStyle"
+ android:viewName="android:action_bar"
+ android:gravity="top">
+ <Toolbar
+ android:id="@+id/action_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ style="?attr/toolbarStyle" />
+ <com.android.internal.widget.ActionBarContextView
+ android:id="@+id/action_context_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ style="?attr/actionModeStyle" />
+ </com.android.internal.widget.ActionBarContainer>
+</com.android.internal.widget.ActionBarOverlayLayout>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index c05dfca..5fec907 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -493,6 +493,9 @@
{@link android.view.Window#setAllowExitTransitionOverlap(boolean)}. -->
<attr name="windowAllowExitTransitionOverlap" format="boolean"/>
+ <!-- Internal layout used internally for window decor -->
+ <attr name="windowActionBarFullscreenDecorLayout" format="reference" />
+
<!-- ============ -->
<!-- Alert Dialog styles -->
<!-- ============ -->
@@ -685,6 +688,7 @@
<!-- Default ActivityChooserView style. -->
<attr name="activityChooserViewStyle" format="reference" />
+ <!-- Default Toolbar style. -->
<attr name="toolbarStyle" format="reference" />
<!-- Fast scroller styles -->
@@ -1713,6 +1717,7 @@
<attr name="windowSwipeToDismiss" />
<attr name="windowContentTransitions" />
<attr name="windowContentTransitionManager" />
+ <attr name="windowActionBarFullscreenDecorLayout" />
<!-- The minimum width the window is allowed to be, along the major
axis of the screen. That is, when in landscape. Can be either
@@ -6398,11 +6403,17 @@
<attr name="indeterminateProgressStyle" format="reference" />
<!-- Specifies the horizontal padding on either end for an embedded progress bar. -->
<attr name="progressBarPadding" format="dimension" />
+ <!-- Up navigation glyph -->
+ <attr name="homeAsUpIndicator" />
<!-- Specifies padding that should be applied to the left and right sides of
system-provided items in the bar. -->
<attr name="itemPadding" format="dimension" />
<!-- Set true to hide the action bar on a vertical nested scroll of content. -->
<attr name="hideOnContentScroll" format="boolean" />
+ <attr name="contentInsetStart" format="dimension" />
+ <attr name="contentInsetEnd" format="dimension" />
+ <attr name="contentInsetLeft" format="dimension" />
+ <attr name="contentInsetRight" format="dimension" />
</declare-styleable>
<declare-styleable name="ActionMode">
@@ -6653,10 +6664,19 @@
<attr name="titleMarginEnd" format="dimension" />
<attr name="titleMarginTop" format="dimension" />
<attr name="titleMarginBottom" format="dimension" />
- <attr name="contentInsetStart" format="dimension" />
- <attr name="contentInsetEnd" format="dimension" />
- <attr name="contentInsetLeft" format="dimension" />
- <attr name="contentInsetRight" format="dimension" />
+ <attr name="contentInsetStart" />
+ <attr name="contentInsetEnd" />
+ <attr name="contentInsetLeft" />
+ <attr name="contentInsetRight" />
+ <attr name="maxButtonHeight" format="dimension" />
+ <attr name="navigationButtonStyle" format="reference" />
+ <attr name="buttonGravity">
+ <!-- Push object to the top of its container, not changing its size. -->
+ <flag name="top" value="0x30" />
+ <!-- Push object to the bottom of its container, not changing its size. -->
+ <flag name="bottom" value="0x50" />
+ </attr>
+ <attr name="collapseIcon" format="reference" />
</declare-styleable>
<declare-styleable name="Toolbar_LayoutParams">
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index f6cd9e8..fc6110d 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1197,6 +1197,16 @@ please see styles_device_defaults.xml.
<item name="android:subtitleTextAppearance">@android:style/TextAppearance.Widget.Toolbar.Subtitle</item>
<item name="android:minHeight">?android:attr/actionBarSize</item>
<item name="android:titleMargins">4dp</item>
+ <item name="android:maxButtonHeight">56dp</item>
+ <item name="android:buttonGravity">top</item>
+ <item name="android:navigationButtonStyle">@android:style/Widget.Toolbar.Button.Navigation</item>
+ <item name="android:collapseIcon">?android:attr/homeAsUpIndicator</item>
+ </style>
+
+ <style name="Widget.Toolbar.Button.Navigation" parent="@android:style/Widget">
+ <item name="android:background">?android:attr/selectableItemBackground</item>
+ <item name="android:minWidth">56dp</item>
+ <item name="android:scaleType">center</item>
</style>
<style name="TextAppearance.Widget.ActionBar.Title"
@@ -2394,7 +2404,6 @@ please see styles_device_defaults.xml.
<item name="android:background">@android:drawable/ab_transparent_light_holo</item>
<item name="android:backgroundStacked">@android:drawable/ab_stacked_transparent_light_holo</item>
<item name="android:backgroundSplit">@android:drawable/ab_bottom_transparent_light_holo</item>
- <item name="android:homeAsUpIndicator">@android:drawable/ic_ab_back_holo_light</item>
<item name="android:progressBarStyle">@android:style/Widget.Holo.Light.ProgressBar.Horizontal</item>
<item name="android:indeterminateProgressStyle">@android:style/Widget.Holo.Light.ProgressBar</item>
</style>
diff --git a/core/res/res/values/styles_quantum.xml b/core/res/res/values/styles_quantum.xml
index 2e7a5b1..ea32681 100644
--- a/core/res/res/values/styles_quantum.xml
+++ b/core/res/res/values/styles_quantum.xml
@@ -773,7 +773,7 @@ please see styles_device_defaults.xml.
<item name="background">@null</item>
<item name="backgroundStacked">@null</item>
<item name="backgroundSplit">@null</item>
- <item name="displayOptions">useLogo|showHome|showTitle</item>
+ <item name="displayOptions">showTitle</item>
<item name="divider">?attr/dividerVertical</item>
<item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
<item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle</item>
@@ -783,6 +783,7 @@ please see styles_device_defaults.xml.
<item name="itemPadding">8dip</item>
<item name="homeLayout">@layout/action_bar_home_quantum</item>
<item name="gravity">center_vertical</item>
+ <item name="contentInsetStart">56dp</item>
</style>
<style name="Widget.Quantum.ActionBar.Solid">
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 69f73e5..4109d03 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1862,6 +1862,7 @@
<java-symbol type="attr" name="toolbarStyle" />
<java-symbol type="attr" name="titleTextAppearance" />
<java-symbol type="attr" name="subtitleTextAppearance" />
+ <java-symbol type="attr" name="windowActionBarFullscreenDecorLayout" />
<java-symbol type="drawable" name="ic_lock_bugreport" />
<java-symbol type="id" name="icon_frame" />
<java-symbol type="style" name="Animation.VolumePanel" />
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index aaab949..41f4ff8 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -192,6 +192,7 @@ please see themes_device_defaults.xml.
<item name="windowDrawsSystemBarBackgrounds">false</item>
<item name="statusBarColor">@android:color/black</item>
<item name="navigationBarColor">@android:color/black</item>
+ <item name="windowActionBarFullscreenDecorLayout">@layout/screen_action_bar</item>
<!-- Define these here; ContextThemeWrappers around themes that define them should
always clear these values. -->
diff --git a/core/res/res/values/themes_quantum.xml b/core/res/res/values/themes_quantum.xml
index bb787bb..484c694 100644
--- a/core/res/res/values/themes_quantum.xml
+++ b/core/res/res/values/themes_quantum.xml
@@ -162,6 +162,7 @@ please see themes_device_defaults.xml.
<item name="windowActionBar">true</item>
<item name="windowActionModeOverlay">false</item>
<item name="windowDrawsSystemBarBackgrounds">true</item>
+ <item name="windowActionBarFullscreenDecorLayout">@layout/screen_toolbar</item>
<item name="statusBarColor">?attr/colorPrimaryDark</item>
<item name="navigationBarColor">?attr/colorPrimaryDark</item>
@@ -505,6 +506,7 @@ please see themes_device_defaults.xml.
<item name="windowActionBar">true</item>
<item name="windowActionModeOverlay">false</item>
<item name="windowDrawsSystemBarBackgrounds">true</item>
+ <item name="windowActionBarFullscreenDecorLayout">@layout/screen_toolbar</item>
<item name="statusBarColor">?attr/colorPrimaryDark</item>
<item name="navigationBarColor">?attr/colorPrimaryDark</item>