Skip to content

Releases: airbnb/epoxy

2.7.0

18 Oct 04:26
Compare
Choose a tag to compare
  • New If a @ModelView generated model has a custom base class the generated model will now inherit constructors from the base class (#315)

  • New Use the EpoxyDataBindingPattern annotation to specify a naming pattern for databinding layouts. This removes the need to declare every databinding layout explicitly (Wiki - #319)

  • New If a view with @ModelView implements an interface then the generated model will implement a similar interface, enabling polymorphism with models. Wiki

  • Improvement PagingEpoxyController now has getters to access the underlying data lists (Thanks to @pcqpcq - #317)

  • Improvement EpoxyModelGroup now supports partial rebinds (#316)

2.6.0

11 Oct 20:00
Compare
Choose a tag to compare

2.5.1

02 Oct 22:46
Compare
Choose a tag to compare
  • Fixed The wrong import was being generated for models using a view holder in 2.5.0 (#294)
  • Fixed Fix generated code failing to compile if a subclass of View.OnClickListener is used as an attribute (#296)

2.5.0

15 Sep 00:51
Compare
Choose a tag to compare
  • New Feature Epoxy now generates a Kotlin DSL to use when building models in your EpoxyController! See the wiki for details
  • New Feature You can use the autoLayout parameter in @ModelView instead of needing to create a layout resource for defaultLayout. Epoxy will then create your view programmatically (#282).

Breaking

  • The onSwipeProgressChanged callback in EpoxyTouchHelper had a Canvas parameter added (#280). You will need to update any of your usages to add this. Sorry for the inconvenience; this will hopefully help you add better swipe animations.

2.4.0

04 Sep 17:49
Compare
Choose a tag to compare
  • Improvement If you are setting options on a @ModelProp and have no other annotation parameters you can now omit the explicit options = param name (#268)

  • Improvement If you are using @TextProp you can now specify a default string via a string resource (#269)

  • Fixed EpoxyModelGroup was not binding model click listeners correctly (#267)

  • Fixed A model created with @ModelView could fail to compile if it had nullable prop overloads (#274)

Potentially Breaking Fix

A model created with @ModelView with a click listener had the wrong setter name for the model click listener overload (#275)

If you were setting this you will need to update the setter name. If you were setting the click listener to null you may now have to cast it.

2.3.0

16 Aug 00:32
Compare
Choose a tag to compare
  • New An AfterPropsSet annotation for use in @ModelView classes. This allows initialization work to be done after all properties are bound from the model. (#242)
  • New Annotations TextProp and CallbackProp as convenient replacements for ModelProp. (#260)
  • New Easy support for dragging and swiping via the EpoxyTouchHelper class. https://github.com/airbnb/epoxy/wiki/Touch-Support
  • Change Added the method getRootView to the view holder class in EpoxyModelGroup and made the bind methods on EpoxyModelGroup non final. This allows access to the root view of the group.
  • Change Generated models will now inherit class annotations from the base class (#255 Thanks geralt-encore!)

2.2.0

19 Jun 20:42
Compare
Choose a tag to compare
  • Main Feature Models can now be completely generated from a custom view via annotations on the view. This should completely remove the overhead of creating a model manually in many cases! For more info, see the wiki

  • New Lowered the minimum SDK from 16 to 14.

  • New Models that have a View.OnLongClickListener as an EpoxyAttribute will now have an overloaded setter on the generated model that allows you to set a long click listener that will return the model, view, and adapter position. This is very similar to the View.OnClickListener support added in 2.0.0, but for long click listeners. Upgrade Note If you were setting a long click listener value to null anywhere you will need to now cast that to View.OnLongClickListener because of the new overloaded method.

  • New id overload on EpoxyModel to define a model id with multiple strings

  • New Option in EpoxyAttribute to not include the attribute in the generated toString method (Thanks to @geralt-encore!)

  • New @AutoModel models are now inherited from usages in super classes (Thanks to @geralt-encore!)

  • Fixed Generated getters could recursively call themselves (Thanks to @geralt-encore!)

2.1.0

10 May 18:50
Compare
Choose a tag to compare
  • New: Support for Android Data Binding! Epoxy will now generate an EpoxyModel directly from a Data Binding xml layout, and handle all data binding details automatically. Thanks to @geralt-encore for helping with this! See more details in the wiki.
  • New: Support for Litho. Epoxy will now generate an EpoxyModel for Litho Layout Specs. See more details in the wiki.
  • New: Support for implicitly adding AutoModels to an EpoxyController, this let's you drop the extra .addTo(this) line. More details and instructions here

2.0.0

10 Apr 16:37
Compare
Choose a tag to compare
  • 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.

1.7.5

21 Feb 19:27
Compare
Choose a tag to compare
  • New: Models inherit layouts specified in superclass @EpoxyModelClass annotations #119
  • New: Support module configuration options #124