PowerMenu icon indicating copy to clipboard operation
PowerMenu copied to clipboard

Menu Padding & Icon Size

Open WenLonG12345 opened this issue 5 years ago • 12 comments

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?

WenLonG12345 avatar Sep 25 '20 06:09 WenLonG12345

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!

skydoves avatar Sep 25 '20 06:09 skydoves

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 avatar Sep 25 '20 07:09 WenLonG12345

Hi, sorry to ask question again.

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

WenLonG12345 avatar Sep 25 '20 07:09 WenLonG12345

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.

skydoves avatar Sep 25 '20 07:09 skydoves

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

WenLonG12345 avatar Sep 25 '20 07:09 WenLonG12345

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

skydoves avatar Sep 26 '20 11:09 skydoves

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

WenLonG12345 avatar Sep 28 '20 01:09 WenLonG12345

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 avatar Sep 28 '20 01:09 WenLonG12345

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

skydoves avatar Oct 07 '20 11:10 skydoves

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 avatar Oct 08 '20 04:10 WenLonG12345

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 avatar Oct 23 '20 03:10 WenLonG12345

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);

sosodennis avatar Feb 02 '21 08:02 sosodennis