Skip to content

Instantly share code, notes, and snippets.

@klukwist
Created April 5, 2020 13:43
Show Gist options
  • Save klukwist/8654e9ea0bd58a21bb383a0a47cc3584 to your computer and use it in GitHub Desktop.
Save klukwist/8654e9ea0bd58a21bb383a0a47cc3584 to your computer and use it in GitHub Desktop.
class MainFragment : Fragment() {
private val adapter =
object : ProstoAdapter<ItemPersonBinding, Person>() {
override val viewModel = PersonItemViewModel()
override val layoutId = R.layout.item_person
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
mainRecyclerView.adapter = adapter
}
fun setNewPersonList(persons: List<Person>){
adapter.setData(personList)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment