In the app Astrid Tasks, there is a button. When you press the button, a drop down menu comes up.
It's basically a spinner but in a drop-down-list form.
Does anyone know how to do something similar? Is this a widget I just don't see?
In the app Astrid Tasks, there is a button. When you press the button, a drop down menu comes up.
It's basically a spinner but in a drop-down-list form.
Does anyone know how to do something similar? Is this a widget I just don't see?
As the original author of this (I'm one of the primary Android developers for Astrid) I'd be happy to share how Astrid does it. I'll post the basics here, but you can find more details at our github repo (https://github.com/todoroo/astrid). The basic idea is to extend GreenDroid's QuickActionWidget as hanry suggests. The subclass looks something like:
The layout file my_layout.xml is pretty simple:
Then, you can just add a simple helper method to the popover class to add views (i.e. rows, with optional listeners) to the main body of the popover:
After creating an instance of the popup, you can show it by calling
This is a somewhat simplified version -- in practice, we attach some addition information, listeners, etc. to those views to make them actually do things when clicked. If you want, you can check out the full code at https://github.com/todoroo/astrid -- the class is com.todoroo.astrid.ui.MainMenuPopover.
Thanks for using Astrid!