Home » Android » android – Correct usage of a Spinner, following material design guidelines

android – Correct usage of a Spinner, following material design guidelines

Posted by: admin April 23, 2020 Leave a comment

Questions:

After reading the new design guidelines of Google’s material design, I didn’t found any clear solution for designing/displaying a spinner (http://developer.android.com/design/building-blocks/spinners.html) in material design.

The nearest would be something like this: http://material-design.storage.googleapis.com/publish/v_1/quantumexternal/0Bx4BSt6jniD7anplVHR3QkdNUHc/components_menus_behavior2.png – but I’m quite sure, there will be some better solution. Especially if it comes to spinner popups. Even so, I didn’t find any spinner/menu element out of the Box in Android studio – so I think this would be custom control.

The best example I found is the above linked menu which covers the functionality of an spinner element.

What would you recommend, to display such an control and being in the range of material design.

How to&Answers:

A spinner will be automatically themed correctly for the Material Guidelines when your App Theme inherits from Material.Theme (or Appcompat). You can then declare and populate your spinner like described here: http://developer.android.com/guide/topics/ui/controls/spinner.html

In Android Studio you can find the Spinner in the section “Widgets” at the bottom.

Answer:

I wrote an article here:

There is No Material Design Spinner for Android

covering usage, styling, data-binding, etc. of the material design “spinner”.