Advertisement
Guest User

Untitled

a guest
Jun 12th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. open class BaseRecyclerViewHolder(@LayoutRes layoutRes: Int, viewGroup: ViewGroup) : RecyclerView.ViewHolder(inflate(layoutRes, viewGroup)) { // Use the private companion function inflate() for getting a view instance.
  2. companion object {
  3. fun inflate(@LayoutRes layoutRes: Int, viewGroup: ViewGroup): View {
  4. return LayoutInflater.from(viewGroup.context).inflate(layoutRes, viewGroup, false)
  5. }
  6. }
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement