Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add group menu item with java code #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions library/src/main/java/com/cocosw/bottomsheet/BottomSheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,21 @@ public Builder sheet(@MenuRes int xmlRes) {
return this;
}

/**
* Add one item into BottomSheet
*
* @param group ID of group
* @param id ID of item
* @param iconRes icon resource
* @param textRes icon resource
* @return This Builder object to allow for chaining of calls to set methods
*/
public Builder sheet(int group, int id, @DrawableRes int iconRes, @StringRes int textRes) {
ActionMenuItem item = new ActionMenuItem(context, group, id, 0, 0, context.getText(textRes));
item.setIcon(iconRes);
menu.add(item);
return this;
}

/**
* Add one item into BottomSheet
Expand Down