Closed mirzaalicdz closed 2 years ago
Hey @mirzaalicdz , Could you describe the details of your issue? And it would be also appreciated if you can attach your Builder class. Thanks!
Background Color of popup menu (Popup Window)... i have done with giving background color to item of menu...but still is missing popupWindow background color option
Requirement is ..i have to apply drawable recourse in which gradient is on the background of popup window but there is no such option except is have to apply color to item background ... and also when ever i'm apply round shape to menu item then popupwindow white backgrund displying
fun showPopUpMenu(context: Context, listener: OnMenuItemClickListener<PopUpMenuDataClass>, view: View) { powerMenu = CustomPowerMenu.Builder(context, PopUpMenuAdapter()) .addItem(PopUpMenuDataClass(AppCompatResources.getDrawable(context, R.drawable.ic_play)!!, context.getString(R.string.play))) .addItem(PopUpMenuDataClass(AppCompatResources.getDrawable(context, R.drawable.ic_playlist)!!, context.getString(R.string.addtoplaylist))) .addItem(PopUpMenuDataClass(AppCompatResources.getDrawable(context, R.drawable.ic_music_popup)!!, context.getString(R.string.convertomp3))) .addItem(PopUpMenuDataClass(AppCompatResources.getDrawable(context, R.drawable.ic_rename)!!, context.getString(R.string.rename))) .addItem(PopUpMenuDataClass(AppCompatResources.getDrawable(context, R.drawable.ic_add_to_favorites)!!, context.getString(R.string.addtofav))) .addItem(PopUpMenuDataClass(AppCompatResources.getDrawable(context, R.drawable.ic_delete)!!, context.getString(R.string.delete))) .addItem(PopUpMenuDataClass(AppCompatResources.getDrawable(context, R.drawable.ic_share_popup)!!, context.getString(R.string.share))) .setLifecycleOwner(viewLifecycleOwner).setAnimation(MenuAnimation.SHOWUP_TOP_RIGHT) .setMenuRadius(10f).setMenuShadow(10f).setOnMenuItemClickListener(listener).build() powerMenu.showAsAnchorRightBottom(view) }
That is intended because each PowerMenu
item should have its own background colors.
You can get and change the body of the window by using getMenuCard
or getMenuRoot
method.
check https://github.com/skydoves/PowerMenu/pull/64/files for hints on how to apply the style thought MaterialCardView
That would be also a great solution by using the setIsMaterial(true)
method on your builder. 👍
Thank you
Is your feature request related to a problem?
A clear and concise description of what the problem is.
Describe the solution you'd like:
A clear and concise description of what you want to happen.
Describe alternatives you've considered:
A clear description of any alternative solutions you've considered.