Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Context menu similar to the new Play Music application (v5.0.0)

You might have noticed in the new Play Music application (from version 5.0.0 onwards) the three dots close to every song, popping up a context menu:

Play Music app with context menu open in one song

I prefer the looks of these points when compared to the old triangle, similar to a spinner. I know this shouldn't be that difficult to implement from scratch, my question is:

Is there any new standard way of implementing this pattern (much alike the new Navigation Drawer pattern on the top-left side)?

Thanks in advance.

like image 682
jcxavier Avatar asked May 24 '13 16:05

jcxavier


Video Answer


2 Answers

For a showing a popup list from a menu resource, use PopupMenu, (or PopupMenuCompat for API below 11).

For a more complex list where you specify the adapter yourself, use ListPopupWindow (or ListPopupWindowCompat API below 11).

like image 133
Krylez Avatar answered Nov 15 '22 02:11

Krylez


That is the ListPopupMenu basically all you have to do is create an imageview with that drawable and call the ListPopupMenu on the image click

like image 39
tyczj Avatar answered Nov 15 '22 02:11

tyczj