Skip to content

Instantly share code, notes, and snippets.

@mallethugo
Created March 19, 2019 09:37
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 mallethugo/e3183fc9218a5703b4eea353460733af to your computer and use it in GitHub Desktop.
Save mallethugo/e3183fc9218a5703b4eea353460733af to your computer and use it in GitHub Desktop.
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
val itemView: View
return if (viewType == CHILD_TYPE) {
itemView = LayoutInflater.from(parent.context).inflate(R.layout.child_type_layout, parent, false)
ListItemViewHolder(itemView)
} else {
itemView = LayoutInflater.from(parent.context).inflate(R.layout.section_type_layout, parent, false)
ListSectionViewHolder(itemView)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment