summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-05-19 15:48:38 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-05-19 15:48:38 -0700
commitb9537db8d9ee27efb4a98415ad2d6b50c1806e5d (patch)
tree70353fa41e9f87e2681b80f5144f819ca1b7fbed /core/java
parent9c9088a54f6dee7a13dcc7a12297137147b01baa (diff)
parentdacbb746c99bd80bd618f1ba14eaa5a969e3b148 (diff)
downloadframeworks_base-b9537db8d9ee27efb4a98415ad2d6b50c1806e5d.zip
frameworks_base-b9537db8d9ee27efb4a98415ad2d6b50c1806e5d.tar.gz
frameworks_base-b9537db8d9ee27efb4a98415ad2d6b50c1806e5d.tar.bz2
Merge "DO NOT MERGE Action bar config changes" into honeycomb-mr2
Diffstat (limited to 'core/java')
-rw-r--r--core/java/com/android/internal/widget/ActionBarView.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index cc51911..891557d 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -28,6 +28,8 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
@@ -980,6 +982,21 @@ public class ActionBarView extends ViewGroup {
}
@Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+
+ // Make sure we reload positioning elements that may change with configuration.
+ Resources res = getContext().getResources();
+ final int imagePadding = res.getDimensionPixelSize(
+ com.android.internal.R.dimen.action_bar_home_image_padding);
+ final int upMargin = res.getDimensionPixelSize(
+ com.android.internal.R.dimen.action_bar_home_up_margin);
+ mIconView.setPadding(imagePadding, getPaddingTop(), imagePadding, getPaddingBottom());
+ ((LayoutParams) mUpView.getLayoutParams()).rightMargin = upMargin;
+ mUpView.requestLayout();
+ }
+
+ @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
measureChildWithMargins(mUpView, widthMeasureSpec, 0, heightMeasureSpec, 0);
final LayoutParams upLp = (LayoutParams) mUpView.getLayoutParams();