Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Create a Quick Action Menu

I need to create some type of quick action menu that appears to the right side of the clicked item (button) whenever the user clicks the button.

Here's an example of what I'm trying to achieve:

enter image description here

When the user clicks button1 I want the "sub quick action menu" to appear like it's shown in the image above. Is there anyway to do this 'natively' in android?

I have found this plugin but it only allows you to show the menu from the top or bottom of the button. https://github.com/lorensiuswlt/NewQuickAction3D

like image 518
Eric Bergman Avatar asked Aug 24 '26 09:08

Eric Bergman


1 Answers

As tyczj said, you could achieve that with a PopupMenu. The idea is that the popup menu will inflate a custom view with all the elements, having as background a 9 patch image.
Here's a blog post that shows how to do that. Hope it will help you.

like image 130
Andy Res Avatar answered Aug 26 '26 22:08

Andy Res



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!