1

For my application I need something like a Quick Action. There are plenty of useful libraries on github since this seems not to be a feature that is officially available via the Android SDK.

But I just stumbled across something in the official gmail app:

enter image description here

This (the dropdown menu) is exactly what I need for my application. But I'm wondering what the the best way to achieve this functionality is. An own Quick Action implementation? Some weird Button+Spinner meet up? Are there any libraries or design guidelines that may help me on creating such a widget?

Community
  • 1
  • 1
Taig
  • 6,718
  • 4
  • 44
  • 65

3 Answers3

1

The proper way is to use contextual action items (action modes). That will show action items in the action bars when you long-press an item. If you have more than fit on the action bar, they will be displayed in the overflow just as with regular action items.

http://developer.android.com/design/patterns/selection.html

Nikolay Elenkov
  • 52,576
  • 10
  • 84
  • 84
0

That's the ActionBar overflow menu. The actions in there are normal MenuItem's configured to be organized on the overflow menu if there's not enough room to display them all

Here's the action bar documentation where you can find how to show/hide the MenuItem. Basically, you need to play around with the android:showAsAction xml attribute when defining your action bars.

 android:showAsAction=["ifRoom" | "never" | "withText" | "always" | "collapseActionView"]
Robert Estivill
  • 12,369
  • 8
  • 43
  • 64
0

The widget used in the shown gmail application is a PopupMenu (introduced in API 11). It's behavior is documented and explained in detail here.

Taig
  • 6,718
  • 4
  • 44
  • 65