A Spinner for Android with Design similar to Floating Input Layout https://material.io/design/components/text-fields.html
Like this for Web: https://material-components.github.io/material-components-web-catalog/#/component/select
Spinner should be provided.
Does the menu component meet your needs?
This is available now in 1.1.0-alpha06 via Exposed Dropdown Menus that are based on TextInputLayout!
To make the dropdown not editable the documentation suggests you set android:editable="false" on the AutoCompleteTextView. Android Studio sais it's deprecated and the app crashes when inflating the XML. I'm using com.google.android.material:material:1.1.0-alpha07. I don't want the user to be only able to select one of the entries in the dropdown. Not type something into the textbox.
Specifically Android studio tells me android:editable is deprecated: Use an <EditText> to make it editable witch makes no sence. I don't want to make it editable quite the contrary.
As a workaround I now put
my_dropdown.keyListener = null
in the onCreate where I also set the adapter. Setting the keyListener of the AutoCompleteTextView to null makes you unable to type anything.
This is kotlin code, but I'm sure you can figure out the matching Java code if you use java.
@shiomax See #465 for notes on deprecation warning
I'm sorry to be so blunt, but: This implementation is a joke, right?
Why the hell would you not use the native Spinner component? This implementation is useless for any serious use case 馃槥
Short comings:
and everything mentioned here: https://blog.usejournal.com/there-is-no-material-design-spinner-for-android-3261b7c77da8
I seriously hope you reconsider the current implementation.
Most helpful comment
This is available now in
1.1.0-alpha06via Exposed Dropdown Menus that are based onTextInputLayout!