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

Menu Padding & Icon Size #63

Open
WenLonG12345 opened this issue Sep 25, 2020 · 12 comments
Open

Menu Padding & Icon Size #63

WenLonG12345 opened this issue Sep 25, 2020 · 12 comments

Comments

@WenLonG12345
Copy link

Hi, thanks for this awesome library!
However, I got some question regarding to this library.

Can I know how to add padding on the menu?

@skydoves
Copy link
Owner

skydoves commented Sep 25, 2020

Hi, here is a solution now, but I will consider adding a new setPadding() function in the next release.

powerMenu.getMenuListView().setPadding(10, 10, 10, 10);

Thanks!

@WenLonG12345
Copy link
Author

Wow, I never expected a so fast response from you!
A very big thank you to you and you works is superb!
Looking forward to your future work 👍

@WenLonG12345
Copy link
Author

Hi, sorry to ask question again.

Can I know how to modify the icon size on PowerMenuItem?

@WenLonG12345 WenLonG12345 reopened this Sep 25, 2020
@WenLonG12345 WenLonG12345 changed the title Menu Padding Menu Padding & Icon Size Sep 25, 2020
@skydoves
Copy link
Owner

Hi,
In the default menu, we cannot change the icon size now (but we can in a CustomPowerMenu).
It seems to be added in the next release too.
Thanks for sharing your issue :)
I will let you know if the next version would be out.

@WenLonG12345
Copy link
Author

I will study the CustomPowerMenu and implement custom icon size.
Once again, a very big thank you to you, skydoves! 🥇

@skydoves
Copy link
Owner

Hey, @WenLonG12345
It's released a new version 2.1.5.
You can use setIconSize, setIconPadding, setIconColor, setPadding functions now.
Thanks!

@WenLonG12345
Copy link
Author

I implemented it and all of it works well!
Very thank you for your fast response and appreciate your works 👍

@WenLonG12345
Copy link
Author

image

Hi, another issue again is the icon padding,
setIconPadding seems added padding for all direction, do you have any idea how to fix this?

@WenLonG12345 WenLonG12345 reopened this Sep 28, 2020
@skydoves
Copy link
Owner

skydoves commented Oct 7, 2020

Hi, it's released a new version 2.1.6.
Thank you for sharing your issues :)

@WenLonG12345
Copy link
Author

WenLonG12345 commented Oct 8, 2020

Hi, it's nice to hear from you again!

By the way, I am using

App Compat

instead of

MaterialComponent

I had forced to switch my primary theme into MaterialComponent and the powermenu works!

and also, I found that MaterialComponent actually provides me more nicer padding and rounded curve.
Hence, I decided to switch to MaterialComponent and slowly migrate all my works into this awesome theme.

Thanks for your great work and it helps to solve my issue :)
Thank you 👍

@WenLonG12345
Copy link
Author

WenLonG12345 commented Oct 23, 2020

Hi, it is me again.

I had implement the new method "setPadding()" and it works fine.
However, after I implement setPadding(), the menu become scrollable.

I had test before and after applying setPadding() and I can confirm setPadding is the function that affect the scrolling behaviour.
Is there any solution for this?

9a4c141d-2a39-4770-a153-1d1c55cb85bf

@WenLonG12345 WenLonG12345 reopened this Oct 23, 2020
@sosodennis
Copy link

I also faced the same issue. Not only padding but setting the divider height. I think the menu height might not include such padding or divider height. Currently I use the following code as a fix:
PowerMenu powerMenu;
int menuDividerHeight = 3;
PowerMenu.Builder menuBuilder = new PowerMenu.Builder(mContext);
menuBuilder.setAnimation(MenuAnimation.DROP_DOWN);
menuBuilder.setMenuRadius(menuRadiusPx);
menuBuilder.setMenuShadow(menuShadowPx);
menuBuilder.setTextSize(menuTextSizePx);
menuBuilder.setWidth(estimatedMenuWidth);
menuBuilder.setDividerHeight(menuDividerHeight);
menuBuilder.setAutoDismiss(true);
menuBuilder.setMenuColor(Color.BLACK);
menuBuilder.setTextColor(Color.WHITE);
menuBuilder.setOnMenuItemClickListener(mContext);
menuBuilder.setTextGravity(Gravity.CENTER);
menuBuilder.setLifecycleOwner(mContext);
powerMenu = menuBuilder.build();
//Temporary fixing
powerMenu.setHeight(powerMenu.getContentViewHeight() + menuDividerHeight);

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

3 participants