summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Olsson <roger.olsson@sonyericsson.com>2010-10-26 14:41:01 +0200
committerSteve Kondik <shade@chemlab.org>2010-11-18 01:53:51 -0500
commitf3e1faa834174c2d19d9bc8a2d164a145f528468 (patch)
treedcee63f353f0ddb5f87d33894e32555b59b1c7a6
parent8c273e24c6e3e2da098a4bb193d227d7d55d79b8 (diff)
downloadframeworks_base-f3e1faa834174c2d19d9bc8a2d164a145f528468.zip
frameworks_base-f3e1faa834174c2d19d9bc8a2d164a145f528468.tar.gz
frameworks_base-f3e1faa834174c2d19d9bc8a2d164a145f528468.tar.bz2
TabWidget orientation
TabWidget orientation specified in tab_content.xml instead of TabWidget.java. Generally, the orientation of the TabWidget should be set in xml-files and not in TabWidget.java. A sub class of TabActivity may call setContentView() using a custom layout where the TabWidget orientation is vertical. This is the case in the UI Enablers Bottom Tab feature, for landscape display orientation. Change-Id: Ia677441a0af96a8d2ab47ef3298eb440c34924f6
-rw-r--r--core/java/android/widget/TabWidget.java1
-rw-r--r--core/res/res/layout/tab_content.xml5
2 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index afae7ef..b4b355a 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -109,7 +109,6 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
}
private void initTabWidget() {
- setOrientation(LinearLayout.HORIZONTAL);
mGroupFlags |= FLAG_USE_CHILD_DRAWING_ORDER;
final Context context = mContext;
diff --git a/core/res/res/layout/tab_content.xml b/core/res/res/layout/tab_content.xml
index 0ee87ce..79147fb 100644
--- a/core/res/res/layout/tab_content.xml
+++ b/core/res/res/layout/tab_content.xml
@@ -22,8 +22,9 @@
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent" android:layout_height="match_parent">
- <TabWidget android:id="@android:id/tabs" android:layout_width="match_parent"
- android:layout_height="wrap_content" android:layout_weight="0" />
+ <TabWidget android:id="@android:id/tabs"
+ android:orientation="horizontal" android:layout_width="match_parent"
+ android:layout_height="wrap_content" android:layout_weight="0" />
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="match_parent" android:layout_height="0dip"
android:layout_weight="1"/>