Update action bar for Quantum
BUG: 13914652
Change-Id: Ibc4f597bf5412590c363a228acff40d1ab3bc2c1
diff --git a/core/res/res/layout/action_bar_home_quantum.xml b/core/res/res/layout/action_bar_home_quantum.xml
new file mode 100644
index 0000000..3968429
--- /dev/null
+++ b/core/res/res/layout/action_bar_home_quantum.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+
+<view xmlns:android="http://schemas.android.com/apk/res/android"
+ class="com.android.internal.widget.ActionBarView$HomeView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical|start">
+ <ImageView android:id="@android:id/up"
+ android:src="?android:attr/homeAsUpIndicator"
+ android:layout_gravity="center_vertical|start"
+ android:visibility="gone"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:scaleType="center" />
+ <ImageView android:id="@android:id/home"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:scaleType="fitCenter" />
+</view>
diff --git a/core/res/res/values-land/dimens_quantum.xml b/core/res/res/values-land/dimens_quantum.xml
new file mode 100644
index 0000000..7789219
--- /dev/null
+++ b/core/res/res/values-land/dimens_quantum.xml
@@ -0,0 +1,23 @@
+<?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.
+-->
+<resources>
+
+ <!-- Default height of an action bar. -->
+ <dimen name="action_bar_default_height_quantum">48dp</dimen>
+ <!-- Default padding of an action bar. -->
+ <dimen name="action_bar_default_padding_quantum">0dp</dimen>
+
+</resources>
diff --git a/core/res/res/values/dimens_quantum.xml b/core/res/res/values/dimens_quantum.xml
index 3913752..02e61e2 100644
--- a/core/res/res/values/dimens_quantum.xml
+++ b/core/res/res/values/dimens_quantum.xml
@@ -17,6 +17,8 @@
<!-- Default height of an action bar. -->
<dimen name="action_bar_default_height_quantum">56dp</dimen>
+ <!-- Default padding of an action bar. -->
+ <dimen name="action_bar_default_padding_quantum">4dp</dimen>
<!-- Vertical padding around action bar icons. -->
<dimen name="action_bar_icon_vertical_padding_quantum">16dp</dimen>
<!-- Text size for action bar titles -->
@@ -28,6 +30,10 @@
<!-- Bottom margin for action bar subtitles -->
<dimen name="action_bar_subtitle_bottom_margin_quantum">5dp</dimen>
+ <dimen name="action_button_min_width_quantum">48dp</dimen>
+ <dimen name="action_button_min_height_quantum">48dp</dimen>
+ <dimen name="action_overflow_min_width_quantum">36dp</dimen>
+
<dimen name="text_size_display_4_quantum">112sp</dimen>
<dimen name="text_size_display_3_quantum">56sp</dimen>
<dimen name="text_size_display_2_quantum">45sp</dimen>
diff --git a/core/res/res/values/styles_quantum.xml b/core/res/res/values/styles_quantum.xml
index 2720d61..595dc79 100644
--- a/core/res/res/values/styles_quantum.xml
+++ b/core/res/res/values/styles_quantum.xml
@@ -713,10 +713,9 @@
<style name="Widget.Quantum.PopupMenu" parent="Widget.Quantum.ListPopupWindow"/>
<style name="Widget.Quantum.ActionButton" parent="Widget.ActionButton">
- <item name="minWidth">@dimen/action_button_min_width</item>
+ <item name="minWidth">@dimen/action_button_min_width_quantum</item>
+ <item name="minHeight">@dimen/action_button_min_height_quantum</item>
<item name="gravity">center</item>
- <item name="paddingStart">12dip</item>
- <item name="paddingEnd">12dip</item>
<item name="scaleType">center</item>
<item name="maxLines">2</item>
</style>
@@ -729,6 +728,9 @@
<item name="src">@drawable/ic_menu_moreoverflow_quantum</item>
<item name="background">?attr/actionBarItemBackground</item>
<item name="contentDescription">@string/action_menu_overflow_description</item>
+ <item name="minWidth">@dimen/action_overflow_min_width_quantum</item>
+ <item name="minHeight">@dimen/action_button_min_height_quantum</item>
+ <item name="scaleType">center</item>
</style>
<style name="Widget.Quantum.ActionButton.TextButton" parent="Widget.Quantum.ButtonBar"/>
@@ -756,16 +758,19 @@
</style>
<style name="Widget.Quantum.ActionBar" parent="Widget.ActionBar">
- <item name="titleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Title</item>
- <item name="subtitleTextStyle">@style/TextAppearance.Quantum.Widget.ActionBar.Subtitle</item>
<item name="background">@null</item>
<item name="backgroundStacked">@null</item>
<item name="backgroundSplit">@null</item>
+ <item name="displayOptions">showHome|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>
<item name="progressBarStyle">@style/Widget.Quantum.ProgressBar.Horizontal</item>
<item name="indeterminateProgressStyle">@style/Widget.Quantum.ProgressBar</item>
<item name="progressBarPadding">32dip</item>
<item name="itemPadding">8dip</item>
+ <item name="homeLayout">@layout/action_bar_home_quantum</item>
+ <item name="gravity">center_vertical</item>
</style>
<style name="Widget.Quantum.ActionBar.Solid">
diff --git a/core/res/res/values/themes_quantum.xml b/core/res/res/values/themes_quantum.xml
index 9e235d6..aef01ac 100644
--- a/core/res/res/values/themes_quantum.xml
+++ b/core/res/res/values/themes_quantum.xml
@@ -300,10 +300,10 @@
<item name="actionModeStyle">@style/Widget.Quantum.ActionMode</item>
<item name="actionModeCloseButtonStyle">@style/Widget.Quantum.ActionButton.CloseMode</item>
<item name="actionBarStyle">@style/Widget.Quantum.ActionBar.Solid</item>
- <item name="actionBarSize">@dimen/action_bar_default_height</item>
+ <item name="actionBarSize">@dimen/action_bar_default_height_quantum</item>
<item name="actionModePopupWindowStyle">@style/Widget.Quantum.PopupWindow.ActionMode</item>
<item name="actionBarWidgetTheme">@null</item>
- <item name="actionBarTheme">@null</item>
+ <item name="actionBarTheme">@style/Theme.Quantum.ActionBar</item>
<item name="actionBarItemBackground">@drawable/item_background_quantum</item>
<item name="actionModeCutDrawable">@drawable/ic_menu_cut_quantum</item>
@@ -638,10 +638,10 @@
<item name="actionModeStyle">@style/Widget.Quantum.Light.ActionMode</item>
<item name="actionModeCloseButtonStyle">@style/Widget.Quantum.Light.ActionButton.CloseMode</item>
<item name="actionBarStyle">@style/Widget.Quantum.Light.ActionBar.Solid</item>
- <item name="actionBarSize">@dimen/action_bar_default_height</item>
+ <item name="actionBarSize">@dimen/action_bar_default_height_quantum</item>
<item name="actionModePopupWindowStyle">@style/Widget.Quantum.Light.PopupWindow.ActionMode</item>
<item name="actionBarWidgetTheme">@null</item>
- <item name="actionBarTheme">@null</item>
+ <item name="actionBarTheme">@style/Theme.Quantum.Light.ActionBar</item>
<item name="actionBarItemBackground">@drawable/item_background_quantum</item>
<item name="actionModeCutDrawable">@drawable/ic_menu_cut_quantum</item>
@@ -708,12 +708,20 @@
<item name="colorButtonPressedColored">?attr/colorPrimaryDark</item>
</style>
+ <style name="Theme.Quantum.ActionBar">
+ <item name="colorControlActivated">?attr/colorControlNormal</item>
+ </style>
+
+ <style name="Theme.Quantum.Light.ActionBar">
+ <item name="colorControlActivated">?attr/colorControlNormal</item>
+ </style>
+
<!-- Variant of the quantum (light) theme that has a solid (opaque) action bar
with an inverse color profile. The dark action bar sharply stands out against
the light content. -->
<style name="Theme.Quantum.Light.DarkActionBar">
<item name="actionBarWidgetTheme">@null</item>
- <item name="actionBarTheme">@style/Theme.Quantum</item>
+ <item name="actionBarTheme">@style/Theme.Quantum.ActionBar</item>
</style>
<!-- Variant of the quantum (dark) theme with no action bar. -->