background
Google plus has a spinner-like view that shows a lot of items, but all of them appear below itself:
I need to mimic this in my own spinner (that's what I was told), but as of recently, Material-Design guidelines say (here) the Spinner should put its items on top of itself, and that's what the support library does for it.
The problem
I can't find a way to revert this behavior. I've tried changing the style of the Spinner, and also searched about this on the Internet (and here).
The questions
How do I let the spinner have its items below (or above instead, if needed), just as was done before Material Design, yet like on G+, so that they take full width?
Is the G+ Spinner a special kind? Does it have a name? Is it mentioned anywhere in the guidelines ? Maybe something that I can use instead of the normal spinner?
OK, the solution for the Spinner of how to put the items below itself, is to just add this:
Seems to work even on Kitkat, and not just on Lollipop, so my guess is that it should work on previous versions too.
However, I still would like to know how it works on G+, and if there are tutorials/samples for whatever it is that I see there.
I don't know, for example, how to make the window not appear like a window.
I've tried this:
but it doesn't help, as the right area is not covered by the spinner items.
I also tried using a TextView that looks like a spinner, and create a PopupMenu for it, but I still get the same issues:
It doesn't do anything using the styles.
Full solution
Since it's quite hard to customize the PopupMenu the way that I was instructed, I've made a full solution for it. Here are the relevant parts of it:
This will trigger showing the spinner's popup (and in fact act as a spinner) :
MainActivity.java private static final String[] ITEMS = {"Item 0", "Item 1"};
FullSizeFakeSpinner
That's it about the code, but there are also some drawable resources too:
There should be a "spinner" image file that's like "abc_spinner_mtrl_am_alpha" of the support library, and has the color that you wish to use. Not sure how to use tint for it on pre-Lollipop, so it's better to just create the file with the color that you use.
colors:
listview_white_selector.xml :
listview_white_selector.xml v21 :
spinner_selector.xml
spinner_selector.xml (v21)
listview_ripple_white_background_selector:
listview_ripple_background_selector:
spinner_drop_down_popup