Skip to content

Porting from 1.x to 2.x

Giorgio Antonioli edited this page Dec 12, 2017 · 2 revisions

The version 2.x introduces the following breaking changes:

  • Removed all the deprecated APIs from 1.x (factories and utils)
  • Removed all the XML default properties of a divider

Porting of the factories

All the factories have now a manager relative class:

  • DrawableFactoryDrawableManager
  • MarginFactoryInsetManager
  • SizeFactorySizeManager
  • TintFactoryTintManager
  • VisibilityFactoryVisibilityManager

The only difference in the implementation is about MarginFactory because InsetManager is more flexible and allows a different margin size before and after the item. To reproduce the behavior of MarginFactory, you need to return the same value for itemInsetBefore() and itemInsetAfter().

Porting of the default properties

The properties recycler_view_divider_size, recycler_view_divider_margin_size, recycler_view_divider_inset_before and recycler_view_divider_inset_after are now removed. So, in case you need to override the value of the default properties, the same result can be obtained using a RecyclerViewDivider.BuilderProvider as explained here.

Clone this wiki locally