I have epoxy controller implemented using databinding in kotlin.
What I need to do is update text when I click on any item and notify that as done in normal adapter. I got a project which does something like this https://github.com/xorum-io/epoxy_partial_update.git
But in this project they have created EpoxyModel and used function
override fun bind(view: View, previouslyBoundModel: EpoxyModel<*>) {
super.bind(view, previouslyBoundModel)
}
I don't want to create any Model object as I am using databinding in my project.
When I try to update any item and call function requestModelBuild of epoxycontroller application crashes.
com.airbnb.epoxy.ImmutableModelException: The model was changed between being bound and when models were rebuilt
Epoxy attribute fields on a model cannot be changed once the model is added to a controller. Check that these fields are not updated, or that the assigned objects are not mutated, outside of the buildModels method. The only exception is if the change is made inside an Interceptor callback. Consider using an interceptor if you need to change a model after it is added to the controller and before it is set on the adapter. If the model is already set on the adapter then you must call `requestModelBuild` instead to recreate all models.
Above is message that I get after crash.
Can anyone please help.