Skip to content

Instantly share code, notes, and snippets.

@annchar
Last active June 26, 2018 04:46
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 annchar/ad5f1178006719bf146fc10d3227fbad to your computer and use it in GitHub Desktop.
Save annchar/ad5f1178006719bf146fc10d3227fbad to your computer and use it in GitHub Desktop.
var values: List<GroupDetail> = listOf()
set(items) {
field = items
notifyDataSetChanged()
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
with(holder) {
value.keys.filterIndexed { index, _ -> index == position }
.firstOrNull()?.let { key ->
textViewGroupName.text = "GROUP ${key.toUpperCase()}"
val groupList = value[key]
val groupBallItemAdapter = GroupBallItemAdapter()
groupBallItemAdapter.values = groupList ?: listOf()
recyclerViewGroupTeam.adapter = groupBallItemAdapter
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment