tiper / MaterialSpinner

Implementation of a Material Spinner for Android with TextInputLayout functionalities
Apache License 2.0
130 stars 30 forks source link

Custom adapter for Material spinner #31

Open divya-navsoft opened 3 years ago

divya-navsoft commented 3 years ago

Hi @tiper really awesome library you've created. I want to add country image flag and country code as fetched from api and add custom adapter in the material spinner and show it when item selected. I have successfully created the custom adapter showing bottom dialog with image flag and code but when I'm selecting one item its only text that showing in Materialspinner. please help.

LunevNF commented 3 years ago

ohhh, from 8 jul 2020... facepalm

AlfredAbdo commented 3 years ago

Hi @tiper really awesome library you've created. I want to add country image flag and country code as fetched from api and add custom adapter in the material spinner and show it when item selected. I have successfully created the custom adapter showing bottom dialog with image flag and code but when I'm selecting one item its only text that showing in Materialspinner. please help.

I was trying to find a solution to this, but I don't know how you would properly inflate a view inside a TextInputLayout (or TextInputEditText); remember, the MaterialSpinner view extends TextInputLayout.

A possible solution would be to revert to using a Spinner, but for me, that would defeat the purpose of using this library (since I usually rely on the concept of Live Validation with TextInputLayouts to show required fields in a form-like fragment).

sebasira commented 3 years ago

Any updates on this? I'm with the same problem

LunevNF commented 3 years ago

Any updates on this? I'm with the same problem

No, you need to change this lib for result. So, in my project (beta-version) I place ImageView before spinner in horizontal linear layout and when I select some spinner item, I show target image. And in other place of app I use AppCompatAutoCompleteTextView with custom adapter, wich showing image in popuped row.