summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@google.com> 2011-05-17 13:57:07 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-05-17 13:57:07 -0700
commit36aad417a3d9366cd931a7c7d85e96d13fe04bf8 (patch)
treec2eb9e49ed141ffa5526afb5737a6bada86c7668
parent384fa845fb940bdbbfb8b1c4e8dbb5b678dbb53b (diff)
parent5d4034a37e5ac3832b91388024f6eddf343cf3f6 (diff)
Merge "resolved conflicts for merge of 2b6ace58 to master"
-rw-r--r--core/java/com/android/internal/widget/AbsActionBarView.java2
-rw-r--r--core/java/com/android/internal/widget/ActionBarView.java27
2 files changed, 15 insertions, 14 deletions
diff --git a/core/java/com/android/internal/widget/AbsActionBarView.java b/core/java/com/android/internal/widget/AbsActionBarView.java
index 7830dcaa3494..788883bc378b 100644
--- a/core/java/com/android/internal/widget/AbsActionBarView.java
+++ b/core/java/com/android/internal/widget/AbsActionBarView.java
@@ -154,7 +154,7 @@ public abstract class AbsActionBarView extends ViewGroup {
availableWidth -= child.getMeasuredWidth();
availableWidth -= spacing;
- return availableWidth;
+ return Math.max(0, availableWidth);
}
protected int positionChild(View child, int x, int y, int contentHeight) {
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index 13ccbba3af64..f1887eb4a238 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -713,48 +713,48 @@ public class ActionBarView extends AbsActionBarView {
mHomeLayout.measure(MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST),
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
final int homeWidth = mHomeLayout.getMeasuredWidth();
- availableWidth -= homeWidth;
- leftOfCenter -= homeWidth;
+ availableWidth = Math.max(0, availableWidth - homeWidth);
+ leftOfCenter = Math.max(0, availableWidth - homeWidth);
}
if (mMenuView != null && mMenuView.getParent() == this) {
availableWidth = measureChildView(mMenuView, availableWidth,
childSpecHeight, 0);
- rightOfCenter -= mMenuView.getMeasuredWidth();
+ rightOfCenter = Math.max(0, rightOfCenter - mMenuView.getMeasuredWidth());
}
boolean showTitle = mTitleLayout != null && mTitleLayout.getVisibility() != GONE &&
(mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0;
if (showTitle) {
availableWidth = measureChildView(mTitleLayout, availableWidth, childSpecHeight, 0);
- leftOfCenter -= mTitleLayout.getMeasuredWidth();
+ leftOfCenter = Math.max(0, leftOfCenter - mTitleLayout.getMeasuredWidth());
}
switch (mNavigationMode) {
case ActionBar.NAVIGATION_MODE_LIST:
if (mListNavLayout != null) {
final int itemPaddingSize = showTitle ? mItemPadding * 2 : mItemPadding;
- availableWidth -= itemPaddingSize;
- leftOfCenter -= itemPaddingSize;
+ availableWidth = Math.max(0, availableWidth - itemPaddingSize);
+ leftOfCenter = Math.max(0, leftOfCenter - itemPaddingSize);
mListNavLayout.measure(
MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST),
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
final int listNavWidth = mListNavLayout.getMeasuredWidth();
- availableWidth -= listNavWidth;
- leftOfCenter -= listNavWidth;
+ availableWidth = Math.max(0, availableWidth - listNavWidth);
+ leftOfCenter = Math.max(0, leftOfCenter - listNavWidth);
}
break;
case ActionBar.NAVIGATION_MODE_TABS:
if (mTabScrollView != null) {
final int itemPaddingSize = showTitle ? mItemPadding * 2 : mItemPadding;
- availableWidth -= itemPaddingSize;
- leftOfCenter -= itemPaddingSize;
+ availableWidth = Math.max(0, availableWidth - itemPaddingSize);
+ leftOfCenter = Math.max(0, leftOfCenter - itemPaddingSize);
mTabScrollView.measure(
MeasureSpec.makeMeasureSpec(availableWidth, MeasureSpec.AT_MOST),
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
final int tabWidth = mTabScrollView.getMeasuredWidth();
- availableWidth -= tabWidth;
- leftOfCenter -= tabWidth;
+ availableWidth = Math.max(0, availableWidth - tabWidth);
+ leftOfCenter = Math.max(0, leftOfCenter - tabWidth);
}
break;
}
@@ -763,7 +763,8 @@ public class ActionBarView extends AbsActionBarView {
mIndeterminateProgressView.getVisibility() != GONE) {
availableWidth = measureChildView(mIndeterminateProgressView, availableWidth,
childSpecHeight, 0);
- rightOfCenter -= mIndeterminateProgressView.getMeasuredWidth();
+ rightOfCenter = Math.max(0,
+ rightOfCenter - mIndeterminateProgressView.getMeasuredWidth());
}
if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0 && mCustomNavView != null) {