Skip to content

Instantly share code, notes, and snippets.

@yongjhih
Created May 31, 2020 13:10
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 yongjhih/e1c5542eb314305cb4118979a065cbc2 to your computer and use it in GitHub Desktop.
Save yongjhih/e1c5542eb314305cb4118979a065cbc2 to your computer and use it in GitHub Desktop.
abstract class TypedViewHolder<T, V : View>(parent: ViewGroup, val view: V)
: BindViewHolder<T>(
LinearLayout(parent.context).apply {
layoutParams = RecyclerView.LayoutParams(
RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT)
addView(view)
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment