summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/com/android/internal/app/ActionBarImpl.java9
-rw-r--r--core/java/com/android/internal/widget/ScrollingTabContainerView.java16
2 files changed, 16 insertions, 9 deletions
diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java
index bc87153..008f400 100644
--- a/core/java/com/android/internal/app/ActionBarImpl.java
+++ b/core/java/com/android/internal/app/ActionBarImpl.java
@@ -95,7 +95,6 @@ public class ActionBarImpl extends ActionBar {
private int mContextDisplayMode;
private boolean mHasEmbeddedTabs;
- private int mContentHeight;
final Handler mHandler = new Handler();
Runnable mTabSelector;
@@ -163,8 +162,6 @@ public class ActionBarImpl extends ActionBar {
mContextDisplayMode = mActionView.isSplitActionBar() ?
CONTEXT_DISPLAY_SPLIT : CONTEXT_DISPLAY_NORMAL;
- mContentHeight = mActionView.getContentHeight();
-
// Older apps get the home button interaction enabled by default.
// Newer apps need to enable it explicitly.
setHomeButtonEnabled(mContext.getApplicationInfo().targetSdkVersion <
@@ -188,12 +185,6 @@ public class ActionBarImpl extends ActionBar {
}
mActionView.setCollapsable(!mHasEmbeddedTabs &&
getNavigationMode() == NAVIGATION_MODE_TABS);
-
- mContentHeight = mActionView.getContentHeight();
-
- if (mTabScrollView != null) {
- mTabScrollView.setContentHeight(mContentHeight);
- }
}
private void ensureTabsExist() {
diff --git a/core/java/com/android/internal/widget/ScrollingTabContainerView.java b/core/java/com/android/internal/widget/ScrollingTabContainerView.java
index fefa223..718d249 100644
--- a/core/java/com/android/internal/widget/ScrollingTabContainerView.java
+++ b/core/java/com/android/internal/widget/ScrollingTabContainerView.java
@@ -15,11 +15,15 @@
*/
package com.android.internal.widget;
+import com.android.internal.R;
+
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.app.ActionBar;
import android.content.Context;
+import android.content.res.Configuration;
+import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.text.TextUtils.TruncateAt;
import android.view.Gravity;
@@ -92,6 +96,18 @@ public class ScrollingTabContainerView extends HorizontalScrollView {
requestLayout();
}
+ @Override
+ protected void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+
+ // Action bar can change size on configuration changes.
+ // Reread the desired height from the theme-specified style.
+ 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();
+ }
+
public void animateToVisibility(int visibility) {
if (mVisibilityAnim != null) {
mVisibilityAnim.cancel();