Skip to content

Instantly share code, notes, and snippets.

View yogacp's full-sized avatar
:octocat:
Exploring

Yoga C. Pranata yogacp

:octocat:
Exploring
View GitHub Profile
@yogacp
yogacp / AbstractAdapter.kt
Last active September 12, 2023 11:53
Recyclerview that use Abstract Adapter and viewbinding
/**
* Create the Abstract Adapter and the ViewHolder that we need to hold the item view
*/
abstract class AbstractAdapter<T : ViewBinding, ITEM> constructor(
protected var itemList: List<ITEM>,
private val bindingClass: (LayoutInflater, ViewGroup, Boolean) -> T
) : RecyclerView.Adapter<AbstractAdapter.Holder>() {
var binding: T? = null