From e8c8ae401b6f0d894a766a1601f55f0fe567df02 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Fri, 8 Feb 2013 17:32:24 -0800 Subject: [PATCH] Fix setting action bar backgrounds after layout Fix a bug that would prevent the drawable bounds from being set correctly for action bar containers. Change-Id: I396aa40e3d8f6e3b47bcd438e1f26bbfc7b20a7f --- .../android/internal/widget/ActionBarContainer.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/java/com/android/internal/widget/ActionBarContainer.java b/core/java/com/android/internal/widget/ActionBarContainer.java index 0cfe4fdf932ac..6120a090d48bb 100644 --- a/core/java/com/android/internal/widget/ActionBarContainer.java +++ b/core/java/com/android/internal/widget/ActionBarContainer.java @@ -84,6 +84,10 @@ public class ActionBarContainer extends FrameLayout { mBackground = bg; if (bg != null) { bg.setCallback(this); + if (mActionBarView != null) { + mBackground.setBounds(mActionBarView.getLeft(), mActionBarView.getTop(), + mActionBarView.getRight(), mActionBarView.getBottom()); + } } setWillNotDraw(mIsSplit ? mSplitBackground == null : mBackground == null && mStackedBackground == null); @@ -98,6 +102,10 @@ public class ActionBarContainer extends FrameLayout { mStackedBackground = bg; if (bg != null) { bg.setCallback(this); + if ((mIsStacked && mStackedBackground != null)) { + mStackedBackground.setBounds(mTabContainer.getLeft(), mTabContainer.getTop(), + mTabContainer.getRight(), mTabContainer.getBottom()); + } } setWillNotDraw(mIsSplit ? mSplitBackground == null : mBackground == null && mStackedBackground == null); @@ -112,6 +120,9 @@ public class ActionBarContainer extends FrameLayout { mSplitBackground = bg; if (bg != null) { bg.setCallback(this); + if (mIsSplit && mSplitBackground != null) { + mSplitBackground.setBounds(0, 0, getMeasuredWidth(), getMeasuredHeight()); + } } setWillNotDraw(mIsSplit ? mSplitBackground == null : mBackground == null && mStackedBackground == null);