Skip to content

Instantly share code, notes, and snippets.

@MuratVarol
Created December 30, 2019 11:45
Show Gist options
  • Save MuratVarol/74c5afe2f48fa3ad4b19f4dd0b450dc0 to your computer and use it in GitHub Desktop.
Save MuratVarol/74c5afe2f48fa3ad4b19f4dd0b450dc0 to your computer and use it in GitHub Desktop.
class AdapterBuilder<ModelType>(
private val itemList: List<ModelType>,
private val layoutId: Int,
private val viewModel: ViewModel?
) {
fun build(): BaseRecyclerAdapter<ModelType> {
val baseAdapter = BaseRecyclerAdapter(itemList, layoutId, viewModel)
baseAdapter.updateData(itemList)
return baseAdapter
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment