summaryrefslogtreecommitdiffstats
path: root/core/java/com/android/internal/widget/ScrollingTabContainerView.java
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-08-11 17:40:57 -0700
committerAdam Powell <adamp@google.com>2011-08-11 17:40:59 -0700
commitaf6b97ebe0e6a67d1691c4d7789c7bc312c1e13e (patch)
tree289ebf886e699dcc4b1cef9e0a4b523f6e56b3f4 /core/java/com/android/internal/widget/ScrollingTabContainerView.java
parent9cc07c3939581909bf7de42df0215a65fab7b472 (diff)
downloadframeworks_base-af6b97ebe0e6a67d1691c4d7789c7bc312c1e13e.zip
frameworks_base-af6b97ebe0e6a67d1691c4d7789c7bc312c1e13e.tar.gz
frameworks_base-af6b97ebe0e6a67d1691c4d7789c7bc312c1e13e.tar.bz2
Fix action bar tabs collapsing when they shouldn't.
Change-Id: Ib0a91722b580802d2b5e3b07c4e57397665a3394
Diffstat (limited to 'core/java/com/android/internal/widget/ScrollingTabContainerView.java')
-rw-r--r--core/java/com/android/internal/widget/ScrollingTabContainerView.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/core/java/com/android/internal/widget/ScrollingTabContainerView.java b/core/java/com/android/internal/widget/ScrollingTabContainerView.java
index 0e4c9ef..71f9364 100644
--- a/core/java/com/android/internal/widget/ScrollingTabContainerView.java
+++ b/core/java/com/android/internal/widget/ScrollingTabContainerView.java
@@ -68,6 +68,11 @@ public class ScrollingTabContainerView extends HorizontalScrollView
super(context);
setHorizontalScrollBarEnabled(false);
+ TypedArray a = getContext().obtainStyledAttributes(null, R.styleable.ActionBar,
+ com.android.internal.R.attr.actionBarStyle, 0);
+ setContentHeight(a.getLayoutDimension(R.styleable.ActionBar_height, 0));
+ a.recycle();
+
mTabLayout = createTabLayout();
addView(mTabLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT));
@@ -91,16 +96,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView
mMaxTabWidth = -1;
}
- int heightMode = MeasureSpec.getMode(heightMeasureSpec);
- int heightSize = MeasureSpec.getSize(heightMeasureSpec);
- if (heightMode != MeasureSpec.UNSPECIFIED) {
- if (mContentHeight == 0 && heightMode == MeasureSpec.EXACTLY) {
- // Use this as our content height.
- mContentHeight = heightSize;
- }
- heightSize = Math.min(heightSize, mContentHeight);
- heightMeasureSpec = MeasureSpec.makeMeasureSpec(heightSize, heightMode);
- }
+ heightMeasureSpec = MeasureSpec.makeMeasureSpec(mContentHeight, MeasureSpec.EXACTLY);
final boolean canCollapse = !lockedExpanded && mAllowCollapse;