Last active
May 17, 2020 15:55
-
-
Save fraggjkee/981bf1924bf7bc9153578fedc7fb23d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindingAdapter("items") | |
fun setRecyclerViewItems( | |
recyclerView: RecyclerView, | |
items: List<RecyclerItem>? | |
) { | |
var adapter = (recyclerView.adapter as? RecyclerViewAdapter) | |
if (adapter == null) { | |
adapter = RecyclerViewAdapter() | |
recyclerView.adapter = adapter | |
} | |
adapter.updateData(items.orEmpty()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment