v2.6.0
library
- fix a issue which would provide the wrong
FastAdapterif theRecyclerView.ViewHolderis provided via a sharedRecyclerView.RecycledViewPool- previously it could have happened that the wrong
FastAdapterwas provided via the listener, and if this one is used to get the item, the wrong item would be returned
- previously it could have happened that the wrong
- the
FastAdapterwill now always set the item tag and the adapter tag to theViewHolder.itemView(removed from theAbstractItem). - the
Itemis now set to a tag with a specific id (so no longer as generalTag - inside the
ClickListenerHelperwe now first retrieve the currentFastAdapterof this item, and use that one for getting the item itself - adjust extensions to support new structure
- set adapter initial also during creation of the VH so that we can directly access it while attaching the
CustomEvent - adjust
CustomEventHookclass and rename method.- no longer pass
FastAdapterin as this can change at any point if the ViewHolder is re-used in a different RecyclerView
- no longer pass
- the
ClickListenerHelperwas renamed toEventHookUtiland moved to the utils package. It is now a util as it no longer needs an instance and has just 3 public static methods. withItemEventis now deprecated in favour of the new namingwithEventHook- move
ItemFilterto it's own class to make it more flexible - some more simplifications
- add types to the ItemFilter
- adjust header helper to no miss the last positions
- add some annotations to the filter methods
- implement new
setNewListmethods which provides the functionality to retain the filter- FIX #432
extensions
- DragDropUtil onMove fixed THANKS @MFlisar
MIGRATION
- the
ItemFilterwas moved to it's own class - the
ItemFilterListenerwas moved to it's own class- in addition the interface was adjusted to provide more flexibility
- the
withFilterPredicateandwithItemFilterListenerare no longer available on theItemAdapter. UsegetItemFilter()on the adapter to get theItemFilterand call the methods on this one - we no longer allow any filter extending
Filter, you have to extendItemFilternow to provide your custom implementation ItemFilter, andItemFilterListenerand all related methods are now typed.- the
Itemitself is no longer set via the generalTagon theviewHolder.itemView, but instead you can now retrieve it via:(IItem) viewHolder.itemView.getTag(R.id.fastadapter_item) - in addition the
itemViewnow gets a tag set which has the reference to the currentFastAdapter, this is necessary for theClickListenerHelperto correctly retrieve the item, even if we have a sharedRecyclerViewPool - the
FastAdapternow directly handles setting theTagwith theItemand with theFastAdapterreferences. This is no longer necessary inside theAbstractItem, or any custom implementation - the method
onEventinside theCustomEventHookwas renamed toattachEventas it seems a bit more meaningful - the
attachEventno longer passes theFastAdapterin, please use the provided methodgetFastAdapter()&&getItem()to get the proper element in your event from theViewHolder - the
ClickListenerHelperwas renamed toEventHookUtiland moved to the utils package. It is now a util as it no longer needs an instance and has just 3 public static methods. withItemEventis now deprecated in favour of the new namingwithEventHook