public MenuItem setVisible(boolean shown) { // Try to set the shown state to the given state. If the shown state was changed // (i.e. the previous state isn't the same as given state), notify the parent menu that // the shown state has changed for this item if (setVisibleInt(shown)) mMenu.onItemVisibleChanged(this); return this; }
public MenuItem setVisible(boolean shown) { // Try to set the shown state to the given state. If the shown state was changed // (i.e. the previous state isn't the same as given state), notify the parent menu that // the shown state has changed for this item if (setVisibleInt(shown)) mMenu.onItemVisibleChanged(this); return this; }
public void setGroupVisible(int group, boolean visible) { final int N = mItems.size(); // We handle the notification of items being changed ourselves, so we use setVisibleInt rather // than setVisible and at the end notify of items being changed boolean changedAtLeastOneItem = false; for (int i = 0; i < N; i++) { MenuItemImpl item = mItems.get(i); if (item.getGroupId() == group) { if (item.setVisibleInt(visible)) changedAtLeastOneItem = true; } } if (changedAtLeastOneItem) onItemsChanged(true); }
public void setGroupVisible(int group, boolean visible) { final int N = mItems.size(); // We handle the notification of items being changed ourselves, so we use setVisibleInt rather // than setVisible and at the end notify of items being changed boolean changedAtLeastOneItem = false; for (int i = 0; i < N; i++) { MenuItemImpl item = mItems.get(i); if (item.getGroupId() == group) { if (item.setVisibleInt(visible)) changedAtLeastOneItem = true; } } if (changedAtLeastOneItem) onItemsChanged(true); }