I’m trying to duplicate the Overflow Menu dropdown functionality for other ActionBar items. I’m working on a manual implementation of this functionality as I think it has been left out of the environment (likely to force standardisation of UI’s). Does anybody know what style / style items are used for the drop down list when you click on the Overflow menu?
EDIT
The overflow button is actually a modified spinner. Here is the style information for it.
<style name="Widget.Holo.Spinner" parent="Widget.Spinner.DropDown">
<item name="android:background">@android:drawable/spinner_background_holo_dark</item>
<item name="android:dropDownSelector">@android:drawable/list_selector_holo_dark</item>
<item name="android:popupBackground">@android:drawable/menu_dropdown_panel_holo_dark</item>
<item name="android:dropDownVerticalOffset">0dip</item>
<item name="android:dropDownHorizontalOffset">0dip</item>
<item name="android:dropDownWidth">wrap_content</item>
<item name="android:popupPromptView">@android:layout/simple_dropdown_hint</item>
<item name="android:gravity">left|center_vertical</item>
</style>
Here is a roundup of what I’ve cobbled together:
Adding an onClick to an ActionBar item which: adds the above layout as a child to your Activities root ViewGroup gives you the illusion of a drop down.
Adding an onClick to each of the buffers which removes the view from the root ViewGroup allows the drop down to “exit” when you try and move focus.
The styling information for the drop down is:
The layout for each list item is:
This doesn’t give a perfect copy of the functionality of an overflow drop down but it’s pretty darn close. I am very interested if anyone else knows a way to reproduce this functionality in a more integrated way!