library
- fix a issue which would provide the wrong
FastAdapter
if theRecyclerView.ViewHolder
is provided via a sharedRecyclerView.RecycledViewPool
- previously it could have happened that the wrong
FastAdapter
was 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
FastAdapter
will now always set the item tag and the adapter tag to theViewHolder.itemView
(removed from theAbstractItem
). - the
Item
is now set to a tag with a specific id (so no longer as generalTag
- inside the
ClickListenerHelper
we now first retrieve the currentFastAdapter
of 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
CustomEventHook
class and rename method.- no longer pass
FastAdapter
in as this can change at any point if the ViewHolder is re-used in a different RecyclerView
- no longer pass
- the
ClickListenerHelper
was renamed toEventHookUtil
and moved to the utils package. It is now a util as it no longer needs an instance and has just 3 public static methods. withItemEvent
is now deprecated in favour of the new namingwithEventHook
- move
ItemFilter
to 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
setNewList
methods which provides the functionality to retain the filter- FIX #432
extensions
- DragDropUtil onMove fixed THANKS @MFlisar
MIGRATION
- the
ItemFilter
was moved to it's own class - the
ItemFilterListener
was moved to it's own class- in addition the interface was adjusted to provide more flexibility
- the
withFilterPredicate
andwithItemFilterListener
are no longer available on theItemAdapter
. UsegetItemFilter()
on the adapter to get theItemFilter
and call the methods on this one - we no longer allow any filter extending
Filter
, you have to extendItemFilter
now to provide your custom implementation ItemFilter
, andItemFilterListener
and all related methods are now typed.- the
Item
itself is no longer set via the generalTag
on theviewHolder.itemView
, but instead you can now retrieve it via:(IItem) viewHolder.itemView.getTag(R.id.fastadapter_item)
- in addition the
itemView
now gets a tag set which has the reference to the currentFastAdapter
, this is necessary for theClickListenerHelper
to correctly retrieve the item, even if we have a sharedRecyclerViewPool
- the
FastAdapter
now directly handles setting theTag
with theItem
and with theFastAdapter
references. This is no longer necessary inside theAbstractItem
, or any custom implementation - the method
onEvent
inside theCustomEventHook
was renamed toattachEvent
as it seems a bit more meaningful - the
attachEvent
no longer passes theFastAdapter
in, please use the provided methodgetFastAdapter()
&&getItem()
to get the proper element in your event from theViewHolder
- the
ClickListenerHelper
was renamed toEventHookUtil
and moved to the utils package. It is now a util as it no longer needs an instance and has just 3 public static methods. withItemEvent
is now deprecated in favour of the new namingwithEventHook