From 56e27bb5b5cdfce2ba1d97a7e0de7b6dd1cff33d Mon Sep 17 00:00:00 2001 From: Zech Date: Wed, 30 Mar 2016 14:26:41 +0800 Subject: [PATCH] add group menu item with java code --- .../java/com/cocosw/bottomsheet/BottomSheet.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/src/main/java/com/cocosw/bottomsheet/BottomSheet.java b/library/src/main/java/com/cocosw/bottomsheet/BottomSheet.java index 0affbeb..1fc01fb 100755 --- a/library/src/main/java/com/cocosw/bottomsheet/BottomSheet.java +++ b/library/src/main/java/com/cocosw/bottomsheet/BottomSheet.java @@ -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