Skip to content

Instantly share code, notes, and snippets.

View yamidragut's full-sized avatar

Estefanía Sarasola Elvira yamidragut

View GitHub Profile
@yamidragut
yamidragut / ListAdapterTemplate
Last active March 17, 2020 20:30
RecyclerView ListAdapter with androidx and binding based in the one of Arif Khan: https://android.jlelse.eu/recylerview-list-adapter-template-in-kotlin-6b9814201458
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
class ${NAME}(private val onItemClickListener: (${Model_Class}) -> Unit) :
ListAdapter<${Model_Class}, ${NAME}.ItemViewHolder>(DiffCallback()) {