Skip to content

Instantly share code, notes, and snippets.

@milhauscz
Last active April 21, 2021 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milhauscz/867092b927f2fec20c4f62195aabe21a to your computer and use it in GitHub Desktop.
Save milhauscz/867092b927f2fec20c4f62195aabe21a to your computer and use it in GitHub Desktop.
Example of a custom binding adapter for Material Spinner
@BindingAdapter("items")
fun bindItems(view: MaterialSpinner, items: List<ExampleItem>?) {
if (items == null) return
view.setAdapter(ExampleSpinnerArrayAdapter(view.context, items))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment