Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open class BaseRecyclerViewHolder(@LayoutRes layoutRes: Int, viewGroup: ViewGroup) : RecyclerView.ViewHolder(inflate(layoutRes, viewGroup)) { // Use the private companion function inflate() for getting a view instance.
- companion object {
- fun inflate(@LayoutRes layoutRes: Int, viewGroup: ViewGroup): View {
- return LayoutInflater.from(viewGroup.context).inflate(layoutRes, viewGroup, false)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement