Skip to content

Instantly share code, notes, and snippets.

@Dhaval2404
Created May 5, 2020 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dhaval2404/8d6dd2671f6c13e6a6d563594507c2b6 to your computer and use it in GitHub Desktop.
Save Dhaval2404/8d6dd2671f6c13e6a6d563594507c2b6 to your computer and use it in GitHub Desktop.
Android Studio Template
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME} #end
import androidx.recyclerview.widget.RecyclerView
#parse("File Header.java")
class ${NAME} : BaseAdapter<${MODEL_CLASS}, {BINDING_CLASS}, ${NAME}.${VIEWHOLDER_CLASS}>() {
override fun getLayout() = R.layout.${LAYOUT_FILE_NAME}
override fun getViewHolder(binding: ${VIEWHOLDER_CLASS}) =
${VIEWHOLDER_CLASS}(binding)
override fun onBindViewHolder(holder: ${VIEWHOLDER_CLASS}, position: Int) {
val item = getItem(position)
}
inner class ${VIEWHOLDER_CLASS}(val binding:${VIEWHOLDER_CLASS}) :
RecyclerView.ViewHolder(binding.root) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment