Skip to content

2.0.0

Compare
Choose a tag to compare
@elihart elihart released this 10 Apr 16:37
· 345 commits to master since this release
  • New: The EpoxyController class helps you manage models even better. This should be used instead of the original EpoxyAdapter in most places. Read more about EpoxyController in the wiki.
  • Change: In the new EpoxyController, the diffing algorithm uses both equals and hashCode on each model to check for changes. This is a change from the EpoxyAdapter where only hashCode was used. Generated models have both hashCode and equals implemented properly already, but if you have any custom hashCode implementations in your models make sure you have equals implemented as well.
  • New: Models that have a View.OnClickListener as an EpoxyAttribute will now have an overloaded setter on the generated model that allows you to set a click listener that will return the model, view, and adapter position. Upgrade Note If you were setting a click listener value to null anywhere you will need to now cast that to View.OnClickListener because of the new overloaded method.
  • New: Attach an onBind/onUnbind listener directly to a model instead of overriding the onModelBound method. Generated models will have methods created to set this listener and handle the callback for you.
  • New: Support for creating models in Kotlin (Thanks to @geralt-encore! #144)
  • New: EpoxyModelWithView supports creating a View programmatically instead of inflating from XML.
  • New: EpoxyModelGroup supports grouping models together in arbitrary formations.
  • New: Instead of setting attribute options like @EpoxyAttribute(hash = false) you should now do @EpoxyAttribute(DoNotHash). You can also set other options like that.
  • New: Annotation processor options can now be set via gradle instead of with PackageEpoxyConfig
  • New: In an EpoxyController, if a model with the same id changes state Epoxy will include its previous state as a payload in the change notification. The new model will have its bind(view, previouslyBoundModel) method called so it can compare what changed since the previous model, and so it can update the view with only the data that changed.