Simple Android Kotlin Library to help create custom array adapters for adapter views like spinners
Read Customer Array Adapter for reasons, see sample code for too
implementation "co.enoobong:customarrayadapter:$custom_array_adapter_version"
- Make your model class that you intend to display in adapter implement
ModelDisplayName
. This will require you to override thedisplayName
property; which is the value that will be displayed in your adapter. - In your
Activity
orFragment
where you use theAdapterView
set it's adapter toCustomArrayAdapter(context, layoutResource, listOfValues)
eg
spinner.adapter = CustomArrayAdapter(context, android.R.layout.simple_spinner_item, values = listOfValues)
I'm more than welcome to contributions that improve the library and make it easier to use. If you are willing to contribute to the project feel free to make a fork and submit a pull request. You can hit me up on @IEnoobong on Twitter
Want to buy me Jollof-Rice? Send here's my link https://payme.ng/ienoobong Thanks