Merge "Fix holo tabs to work on phone screens."
diff --git a/core/res/res/layout/tab_indicator_holo.xml b/core/res/res/layout/tab_indicator_holo.xml
index d37476b..60c80e9 100644
--- a/core/res/res/layout/tab_indicator_holo.xml
+++ b/core/res/res/layout/tab_indicator_holo.xml
@@ -15,32 +15,24 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="56dip"
- android:layout_weight="0"
- android:layout_marginLeft="0dip"
- android:layout_marginRight="0dip"
+ android:layout_width="0dp"
+ android:layout_height="58dp"
+ android:layout_weight="1"
+ android:layout_marginLeft="-3dip"
+ android:layout_marginRight="-3dip"
+ android:paddingBottom="8dp"
android:background="@android:drawable/tab_indicator_holo">
- <View android:id="@+id/tab_indicator_left_spacer"
- android:layout_width="16dip"
- android:layout_height="0dip" />
-
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:visibility="gone"
- android:layout_toRightOf="@id/tab_indicator_left_spacer"
- android:paddingRight="8dip" />
+ android:layout_centerHorizontal="true" />
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:layout_toRightOf="@id/icon"
- android:paddingLeft="0dip"
- android:paddingRight="16dip"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
style="?android:attr/tabWidgetStyle" />
-
+
</RelativeLayout>
diff --git a/core/res/res/layout/tab_indicator_holo_large.xml b/core/res/res/layout/tab_indicator_holo_large.xml
new file mode 100644
index 0000000..bdd8d11
--- /dev/null
+++ b/core/res/res/layout/tab_indicator_holo_large.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="56dip"
+ android:layout_weight="0"
+ android:layout_marginLeft="0dip"
+ android:layout_marginRight="0dip"
+ android:background="@android:drawable/tab_indicator_holo">
+
+ <View android:id="@+id/tab_indicator_left_spacer"
+ android:layout_width="16dip"
+ android:layout_height="0dip" />
+
+ <ImageView android:id="@+id/icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:visibility="gone"
+ android:layout_toRightOf="@id/tab_indicator_left_spacer"
+ android:paddingRight="8dip" />
+
+ <TextView android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_toRightOf="@id/icon"
+ android:paddingLeft="0dip"
+ android:paddingRight="16dip"
+ style="?android:attr/tabWidgetStyle" />
+
+</RelativeLayout>
diff --git a/core/res/res/values-xlarge/styles.xml b/core/res/res/values-xlarge/styles.xml
index dd78920..a39d9d6 100644
--- a/core/res/res/values-xlarge/styles.xml
+++ b/core/res/res/values-xlarge/styles.xml
@@ -36,6 +36,22 @@
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
+ <style name="TextAppearance.Holo.Widget.TabWidget">
+ <item name="android:textSize">18sp</item>
+ <item name="android:textStyle">normal</item>
+ <item name="android:textColor">@android:color/tab_indicator_text</item>
+ </style>
+
+ <style name="Widget.Holo.TabWidget" parent="Widget.TabWidget">
+ <item name="android:textAppearance">@style/TextAppearance.Holo.Widget.TabWidget</item>
+ <item name="android:tabStripLeft">@null</item>
+ <item name="android:tabStripRight">@null</item>
+ <item name="android:tabStripEnabled">false</item>
+ <item name="android:divider">@null</item>
+ <item name="android:gravity">left|center_vertical</item>
+ <item name="android:tabLayout">@android:layout/tab_indicator_holo_large</item>
+ </style>
+
<style name="PreferencePanel">
<item name="android:layout_marginLeft">@dimen/preference_screen_side_margin</item>
<item name="android:layout_marginRight">@dimen/preference_screen_side_margin</item>
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 08f5410..f7d3c3f 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1214,8 +1214,10 @@
<item name="android:textColor">?textColorPrimary</item>
</style>
+ <!-- This style is for smaller screens; values-xlarge defines a version
+ for larger screens. -->
<style name="TextAppearance.Holo.Widget.TabWidget">
- <item name="android:textSize">18sp</item>
+ <item name="android:textSize">14sp</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@android:color/tab_indicator_text</item>
</style>
@@ -1664,6 +1666,9 @@
<item name="android:button">@android:drawable/btn_star_holo_dark</item>
</style>
+ <!-- The holo style for smaller screens actually uses the non-holo layout,
+ which is more compact. values-xlarge defines an alternative version
+ for the real holo look on a large screen. -->
<style name="Widget.Holo.TabWidget" parent="Widget.TabWidget">
<item name="android:textAppearance">@style/TextAppearance.Holo.Widget.TabWidget</item>
<item name="android:tabStripLeft">@null</item>