Skip to content

Instantly share code, notes, and snippets.

@douglasiacovelli
Created October 8, 2018 01:58
Show Gist options
  • Select an option

  • Save douglasiacovelli/a830971f6b7d592c777f5bb176a26db8 to your computer and use it in GitHub Desktop.

Select an option

Save douglasiacovelli/a830971f6b7d592c777f5bb176a26db8 to your computer and use it in GitHub Desktop.
object BindingAdapters {
@BindingAdapter(values = ["selected", "options"], requireAll = false)
@JvmStatic
fun setOptionsAndSelected(view: MyCustomView, selected: Option?, options: List<Option>?) {
options?.let {
view.setOptions(it)
}
selected?.let {
view.setSelected(it)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment