Merge "Fix bug 5099037 - No delete option when multiple videos are selected"
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ public class MenuBuilder implements Menu {
|
||||
}
|
||||
}
|
||||
|
||||
if (changedAtLeastOneItem) onItemsChanged(false);
|
||||
if (changedAtLeastOneItem) onItemsChanged(true);
|
||||
}
|
||||
|
||||
public void setGroupEnabled(int group, boolean enabled) {
|
||||
@@ -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) {
|
||||
@@ -971,7 +972,7 @@ public class MenuBuilder implements Menu {
|
||||
void onItemVisibleChanged(MenuItemImpl item) {
|
||||
// Notify of items being changed
|
||||
mIsVisibleItemsStale = true;
|
||||
onItemsChanged(false);
|
||||
onItemsChanged(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user