summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2011-03-01 10:49:23 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-01 10:49:23 -0800
commit0357e5b2fe067555b8bee66563a117b2978bc291 (patch)
tree221a098772f662cbe127406066b0419ae3bb669c /core/java/android
parent857447f1f992cc6b29ed70a7135a7b7e581d748e (diff)
parent52a5e6588395c9cea128d245a2572b7d69bbb12c (diff)
downloadframeworks_base-0357e5b2fe067555b8bee66563a117b2978bc291.zip
frameworks_base-0357e5b2fe067555b8bee66563a117b2978bc291.tar.gz
frameworks_base-0357e5b2fe067555b8bee66563a117b2978bc291.tar.bz2
Merge "Scrollable tabs are correctly displayed."
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/widget/TabWidget.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index d74ef24..6f76dd0 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -172,6 +172,11 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
@Override
void measureHorizontal(int widthMeasureSpec, int heightMeasureSpec) {
+ if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.UNSPECIFIED) {
+ super.measureHorizontal(widthMeasureSpec, heightMeasureSpec);
+ return;
+ }
+
// First, measure with no constraint
final int unspecifiedWidth = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
mImposedTabsHeight = -1;
@@ -208,9 +213,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
}
// Measure again, this time with imposed tab widths and respecting initial spec request
- if (mImposedTabsHeight >= 0 || unspecifiedWidth != widthMeasureSpec) {
- super.measureHorizontal(widthMeasureSpec, heightMeasureSpec);
- }
+ super.measureHorizontal(widthMeasureSpec, heightMeasureSpec);
}
/**