summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-05-23 12:43:29 -0700
committerAdam Powell <adamp@google.com>2011-05-23 13:35:25 -0700
commitf4232e0097ffb672f5d1559b20c7230081efe34f (patch)
treef83c2f405f48494392726b48dfafbc9f74b8b831
parentbdd8a16282cf85bfdbe4c15adcd5c37db772de11 (diff)
downloadframeworks_base-f4232e0097ffb672f5d1559b20c7230081efe34f.zip
frameworks_base-f4232e0097ffb672f5d1559b20c7230081efe34f.tar.gz
frameworks_base-f4232e0097ffb672f5d1559b20c7230081efe34f.tar.bz2
Change action button layout for split action bars
Change-Id: Ie1427ae6b0334bf0a8afd5cae968c286c82a3837
-rw-r--r--core/java/com/android/internal/view/menu/ActionMenuView.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/core/java/com/android/internal/view/menu/ActionMenuView.java b/core/java/com/android/internal/view/menu/ActionMenuView.java
index 290bf08..7b4f216 100644
--- a/core/java/com/android/internal/view/menu/ActionMenuView.java
+++ b/core/java/com/android/internal/view/menu/ActionMenuView.java
@@ -89,7 +89,6 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
final int childCount = getChildCount();
final int midVertical = (top + bottom) / 2;
final int dividerWidth = getDividerWidth();
- boolean hasOverflow = false;
int overflowWidth = 0;
int nonOverflowWidth = 0;
int nonOverflowCount = 0;
@@ -102,7 +101,6 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
LayoutParams p = (LayoutParams) v.getLayoutParams();
if (p.isOverflowButton) {
- hasOverflow = true;
overflowWidth = v.getMeasuredWidth();
if (hasDividerBeforeChildAt(i)) {
overflowWidth += dividerWidth;
@@ -125,15 +123,12 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
}
}
- // Try to center non-overflow items with uniformly spaced padding, including on the edges.
- // Overflow will always pin to the right edge. If there isn't enough room for that,
- // center in the remaining space.
+ // Fill action items from the left. Overflow will always pin to the right edge.
if (nonOverflowWidth <= widthRemaining - overflowWidth) {
widthRemaining -= overflowWidth;
}
- final int spacing = (widthRemaining - nonOverflowWidth) / (nonOverflowCount + 1);
- int startLeft = getPaddingLeft() + overflowWidth + spacing;
+ int startLeft = getPaddingLeft();
for (int i = 0; i < childCount; i++) {
final View v = getChildAt(i);
final LayoutParams lp = (LayoutParams) v.getLayoutParams();
@@ -146,7 +141,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
int height = v.getMeasuredHeight();
int t = midVertical - (height / 2);
v.layout(startLeft, t, startLeft + width, t + height);
- startLeft += width + lp.rightMargin + spacing;
+ startLeft += width + lp.rightMargin;
}
}