Paging31 RecyclerView를 간략하게 줄여보기 + paging3에 적용 abstract class BaseRecyclerViewAdapter(var items: List) : RecyclerView.Adapter(){ @LayoutRes abstract fun getLayoutResId(): Int var binding: Any? = null override fun onCreateViewHolder( parent: ViewGroup, viewType: Int ): BaseRecyclerViewAdapter.BaseViewHolder { return BaseViewHolder( LayoutInflater.from(parent.context).inflate( getLayoutResId(), parent, false ) ) } override fun getItemCount() =.. 2022. 7. 11. 이전 1 다음