Skip to content

Instantly share code, notes, and snippets.

@dnnyg33
Last active March 23, 2020 18:12
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 dnnyg33/1e82e36bed926ed3e07de4e76c52987a to your computer and use it in GitHub Desktop.
Save dnnyg33/1e82e36bed926ed3e07de4e76c52987a to your computer and use it in GitHub Desktop.
File template for abstract EpoxyModel with KotlinEpoxyHolder
package ${PACKAGE_NAME}
import android.view.View
import com.airbnb.epoxy.EpoxyHolder
import com.airbnb.epoxy.EpoxyModelClass
import com.airbnb.epoxy.EpoxyModelWithHolder
@EpoxyModelClass(layout= R.layout.${LAYOUT_NAME})
abstract class ${NAME}EpoxyModel : EpoxyModelWithHolder<${NAME}EpoxyModel.ViewHolder>() {
@EpoxyAttribute
lateinit var viewModel: ViewModel//the data backing model
override fun bind(holder: ViewHolder) {
super.bind(holder)
val context = holder.context
}
class ViewHolder : KotlinEpoxyHolder() {
val titleView by bind<TextView>(R.id.title)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment