Last active
March 23, 2020 18:12
-
-
Save dnnyg33/1e82e36bed926ed3e07de4e76c52987a to your computer and use it in GitHub Desktop.
File template for abstract EpoxyModel with KotlinEpoxyHolder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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