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 items programmetically feature #13

Merged
merged 1 commit into from
Feb 7, 2017

Conversation

ch-muhammad-adil
Copy link
Contributor

No description provided.

@rubensousa rubensousa merged commit d848ff2 into rubensousa:master Feb 7, 2017
@rubensousa
Copy link
Owner

Thanks :)

@ch-muhammad-adil
Copy link
Contributor Author

You are most welcome, Please update its Gradle plugin so I can use that one. ;)

@rubensousa
Copy link
Owner

I'm just adding some extra code and testing so I can release this :)

@ch-muhammad-adil
Copy link
Contributor Author

Please do update me when you release.

@rubensousa
Copy link
Owner

Can you check the sample and the addItem API again? It should behave better now.

@ch-muhammad-adil
Copy link
Contributor Author

Let me try it.

@ch-muhammad-adil
Copy link
Contributor Author

API is really simple now.
I have given a comment on one of your commit where you have removed a function. I hope you understand my idea. There can be another option we can give to developers that is loading icons from URL and inside the Library APIs we can use any Image Loader Library. This will also allow developers to add items dynamically. (Just an idea)

@rubensousa
Copy link
Owner

Ok, I can also do that. Thanks once again :)

@ch-muhammad-adil
Copy link
Contributor Author

If we can give an option to developers to add menu items in bulk.

Like

for(int i=0;i<list.size();i++){
       builderObject.addMenu(i,list.get(i).getName(),list.get(i).getIcon())
}

icon can be a drawable, resource file, bitmap and urlPath.

This would be an amazing feature in this library.

@ch-muhammad-adil
Copy link
Contributor Author

Sorry I have tested, its fine so far. just need to add option for bitmap and icon URL.

@ch-muhammad-adil
Copy link
Contributor Author

ch-muhammad-adil commented Feb 9, 2017

So far I am able to do this way.. It working fine in my case and I am able to achieve my task. (y) Thanks

private void createShareMenu() {
        BottomSheetBuilder builder = new BottomSheetBuilder(MyCardsActivity.this, R.style.AppTheme_BottomSheetDialog_Custom)
                .setMode(BottomSheetBuilder.MODE_GRID)
//                .setMenu(R.menu.share_item_menu)
                .setItemClickListener(new BottomSheetItemClickListener() {
                    @Override
                    public void onBottomSheetItemClick(MenuItem item) {

                    }
                });
        for (MenuItem menuItem : ListOfMenuItems) {
            builder.addItem(menuItem.getMenuId(), menuItem.getName(), new BitmapDrawable(getResources(), menuItem.getBitmap()));
        }
        BottomSheetMenuDialog dialog = builder.createDialog();
        dialog.show();
    }

@ch-muhammad-adil ch-muhammad-adil mentioned this pull request Feb 9, 2017
@rubensousa
Copy link
Owner

If you managed to do it, I prefer keeping the API with Drawable and DrawableRes only :)

@ch-muhammad-adil
Copy link
Contributor Author

Yeah! I think its all good now. :)

@rubensousa
Copy link
Owner

Released on 1.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants