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

Reducing the size of menu items ui issue #120

Closed
HasanShaikh opened this issue May 23, 2017 · 8 comments
Closed

Reducing the size of menu items ui issue #120

HasanShaikh opened this issue May 23, 2017 · 8 comments

Comments

@HasanShaikh
Copy link

HasanShaikh commented May 23, 2017

I have two menu items for my boom menu.

I want to have the size of menu items same as the size of boom fab menu.
so i added this to my code.
` for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) {
TextOutsideCircleButton.Builder builder = new TextOutsideCircleButton.Builder()
.normalImageRes(floatmenuImage.get(i))
.normalColor(ContextCompat.getColor(this,floatmenuColor.get(i)))
.normalTextColor(ContextCompat.getColor(this,R.color.intro_slide_black))
.buttonRadius(Util.dp2px(30))
.normalText(floatmenu.get(i));

        bmb.addBuilder(builder);
    }`

here buttonRadius(Util.dp2px(30))) reduces the size of menu item but the image inside it does not fit at the center
device-2017-05-23-100917

And i have given my menu items color as orange and green, so the fab menu dot takes the same two colors.
But i want the fab menu dot colors to be white keeping my menu item colors orange and green.
device-2017-05-23-100649

Thanks

@Nightonke
Copy link
Owner

Emmm... If I didn't misunderstand, you are looking for method imageRect. Check wiki for more details.

@HasanShaikh
Copy link
Author

@Nightonke thanks for your answer.
I tried using image rect but it is not working.
Can you please help me out in solving the ui issue as i have shown in the above image?
and also how to change the dot colors of fab button.

@Nightonke
Copy link
Owner

You can change the color of dot by pieceColor method of builder.
What did you mean 'not working' by imageRect method? Can I check the code where you use imageRect?

@HasanShaikh
Copy link
Author

For my image ui issue in the above shown image.
you suggested me to check this na " Check https://github.com/Nightonke/BoomMenu/wiki/Simple-Circle-Button#image for more details."

but this is not solving my problem.
i have already pasted my code from which i am creating the menu items.

@Nightonke
Copy link
Owner

Could you send the image-resources to me for a test?

@HasanShaikh
Copy link
Author

HasanShaikh commented May 24, 2017

ya sure.
I am using same image for both the menu items.
Image which i have added is white so it is invisible in the comments window here.
ic_home_proptype

@Nightonke
Copy link
Owner

@HasanShaikh
Hey, as I said, method imageRect of builder can solve this problem:

static SimpleCircleButton.Builder getSimpleCircleButtonBuilder() {
    return new SimpleCircleButton.Builder()
            .normalImageRes(R.drawable.test)
            .buttonRadius(Util.dp2px(30))
            .imageRect(new Rect(Util.dp2px(10), Util.dp2px(10), Util.dp2px(50), Util.dp2px(50)));
}

And the effect:

@HasanShaikh
Copy link
Author

@Nightonke thank you so much its working fine now.

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

No branches or pull requests

2 participants