Loading core/java/android/widget/ActivityChooserView.java +1 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod * @param attrs A collection of attributes. */ public ActivityChooserView(Context context, AttributeSet attrs) { this(context, attrs, R.attr.actionButtonStyle); this(context, attrs, 0); } /** Loading core/java/com/android/internal/view/menu/ActionMenuPresenter.java +4 −1 Original line number Diff line number Diff line Loading @@ -391,7 +391,6 @@ public class ActionMenuPresenter extends BaseMenuPresenter { final boolean inGroup = seenGroups.get(groupId); boolean isAction = (maxActions > 0 || inGroup) && widthLimit > 0 && (!mStrictWidthLimit || cellsRemaining > 0); maxActions--; if (isAction) { View v = getItemView(item, mScrapActionButtonView, parent); Loading Loading @@ -430,11 +429,15 @@ public class ActionMenuPresenter extends BaseMenuPresenter { for (int j = 0; j < i; j++) { MenuItemImpl areYouMyGroupie = visibleItems.get(j); if (areYouMyGroupie.getGroupId() == groupId) { // Give back the action slot if (areYouMyGroupie.isActionButton()) maxActions++; areYouMyGroupie.setIsActionButton(false); } } } if (isAction) maxActions--; item.setIsActionButton(isAction); } } Loading core/java/com/android/internal/view/menu/MenuBuilder.java +4 −3 Original line number Diff line number Diff line Loading @@ -567,7 +567,7 @@ public class MenuBuilder implements Menu { } } if (changedAtLeastOneItem) onItemsChanged(false); if (changedAtLeastOneItem) onItemsChanged(true); } public void setGroupEnabled(int group, boolean enabled) { Loading Loading @@ -929,6 +929,7 @@ public class MenuBuilder implements Menu { * * @param structureChanged true if the menu structure changed, * false if only item properties changed. * (Visibility is a structural property since it affects layout.) */ void onItemsChanged(boolean structureChanged) { if (!mPreventDispatchingItemsChanged) { Loading Loading @@ -971,7 +972,7 @@ public class MenuBuilder implements Menu { void onItemVisibleChanged(MenuItemImpl item) { // Notify of items being changed mIsVisibleItemsStale = true; onItemsChanged(false); onItemsChanged(true); } /** Loading @@ -981,7 +982,7 @@ public class MenuBuilder implements Menu { void onItemActionRequestChanged(MenuItemImpl item) { // Notify of items being changed mIsActionItemsStale = true; onItemsChanged(false); onItemsChanged(true); } ArrayList<MenuItemImpl> getVisibleItems() { Loading core/java/com/android/internal/view/menu/MenuItemImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -585,7 +585,7 @@ public final class MenuItemImpl implements MenuItem { public MenuItem setActionProvider(ActionProvider actionProvider) { mActionView = null; mActionProvider = actionProvider; mMenu.onItemsChanged(false); mMenu.onItemsChanged(true); // Measurement can be changed return this; } Loading core/res/res/layout/activity_chooser_view.xml +4 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,8 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" style="?android:attr/actionButtonStyle"> style="?android:attr/actionButtonStyle" android:padding="0dip"> <FrameLayout android:id="@+id/default_activity_button" Loading @@ -31,7 +32,7 @@ android:layout_gravity="center" android:focusable="true" android:addStatesFromChildren="true" android:background="?android:attr/selectableItemBackground"> android:background="?android:attr/actionBarItemBackground"> <ImageView android:id="@+id/image" android:layout_width="32dip" Loading @@ -53,7 +54,7 @@ android:layout_gravity="center" android:focusable="true" android:addStatesFromChildren="true" android:background="?android:attr/selectableItemBackground"> android:background="?android:attr/actionBarItemBackground"> <ImageView android:id="@+id/image" android:layout_width="32dip" Loading Loading
core/java/android/widget/ActivityChooserView.java +1 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod * @param attrs A collection of attributes. */ public ActivityChooserView(Context context, AttributeSet attrs) { this(context, attrs, R.attr.actionButtonStyle); this(context, attrs, 0); } /** Loading
core/java/com/android/internal/view/menu/ActionMenuPresenter.java +4 −1 Original line number Diff line number Diff line Loading @@ -391,7 +391,6 @@ public class ActionMenuPresenter extends BaseMenuPresenter { final boolean inGroup = seenGroups.get(groupId); boolean isAction = (maxActions > 0 || inGroup) && widthLimit > 0 && (!mStrictWidthLimit || cellsRemaining > 0); maxActions--; if (isAction) { View v = getItemView(item, mScrapActionButtonView, parent); Loading Loading @@ -430,11 +429,15 @@ public class ActionMenuPresenter extends BaseMenuPresenter { for (int j = 0; j < i; j++) { MenuItemImpl areYouMyGroupie = visibleItems.get(j); if (areYouMyGroupie.getGroupId() == groupId) { // Give back the action slot if (areYouMyGroupie.isActionButton()) maxActions++; areYouMyGroupie.setIsActionButton(false); } } } if (isAction) maxActions--; item.setIsActionButton(isAction); } } Loading
core/java/com/android/internal/view/menu/MenuBuilder.java +4 −3 Original line number Diff line number Diff line Loading @@ -567,7 +567,7 @@ public class MenuBuilder implements Menu { } } if (changedAtLeastOneItem) onItemsChanged(false); if (changedAtLeastOneItem) onItemsChanged(true); } public void setGroupEnabled(int group, boolean enabled) { Loading Loading @@ -929,6 +929,7 @@ public class MenuBuilder implements Menu { * * @param structureChanged true if the menu structure changed, * false if only item properties changed. * (Visibility is a structural property since it affects layout.) */ void onItemsChanged(boolean structureChanged) { if (!mPreventDispatchingItemsChanged) { Loading Loading @@ -971,7 +972,7 @@ public class MenuBuilder implements Menu { void onItemVisibleChanged(MenuItemImpl item) { // Notify of items being changed mIsVisibleItemsStale = true; onItemsChanged(false); onItemsChanged(true); } /** Loading @@ -981,7 +982,7 @@ public class MenuBuilder implements Menu { void onItemActionRequestChanged(MenuItemImpl item) { // Notify of items being changed mIsActionItemsStale = true; onItemsChanged(false); onItemsChanged(true); } ArrayList<MenuItemImpl> getVisibleItems() { Loading
core/java/com/android/internal/view/menu/MenuItemImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -585,7 +585,7 @@ public final class MenuItemImpl implements MenuItem { public MenuItem setActionProvider(ActionProvider actionProvider) { mActionView = null; mActionProvider = actionProvider; mMenu.onItemsChanged(false); mMenu.onItemsChanged(true); // Measurement can be changed return this; } Loading
core/res/res/layout/activity_chooser_view.xml +4 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,8 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" style="?android:attr/actionButtonStyle"> style="?android:attr/actionButtonStyle" android:padding="0dip"> <FrameLayout android:id="@+id/default_activity_button" Loading @@ -31,7 +32,7 @@ android:layout_gravity="center" android:focusable="true" android:addStatesFromChildren="true" android:background="?android:attr/selectableItemBackground"> android:background="?android:attr/actionBarItemBackground"> <ImageView android:id="@+id/image" android:layout_width="32dip" Loading @@ -53,7 +54,7 @@ android:layout_gravity="center" android:focusable="true" android:addStatesFromChildren="true" android:background="?android:attr/selectableItemBackground"> android:background="?android:attr/actionBarItemBackground"> <ImageView android:id="@+id/image" android:layout_width="32dip" Loading