github mikepenz/FastAdapter v2.6.0

latest releases: v5.7.0, v5.6.0, v5.5.1...
6 years ago

library

  • fix a issue which would provide the wrong FastAdapter if the RecyclerView.ViewHolder is provided via a shared RecyclerView.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
  • the FastAdapter will now always set the item tag and the adapter tag to the ViewHolder.itemView (removed from the AbstractItem).
  • the Item is now set to a tag with a specific id (so no longer as general Tag
  • inside the ClickListenerHelper we now first retrieve the current FastAdapter 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
  • the ClickListenerHelper was renamed to EventHookUtil 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 naming withEventHook
  • 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

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 and withItemFilterListener are no longer available on the ItemAdapter. Use getItemFilter() on the adapter to get the ItemFilter and call the methods on this one
  • we no longer allow any filter extending Filter, you have to extend ItemFilter now to provide your custom implementation
  • ItemFilter, and ItemFilterListener and all related methods are now typed.
  • the Item itself is no longer set via the general Tag on the viewHolder.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 current FastAdapter, this is necessary for the ClickListenerHelper to correctly retrieve the item, even if we have a shared RecyclerViewPool
  • the FastAdapter now directly handles setting the Tag with the Item and with the FastAdapter references. This is no longer necessary inside the AbstractItem, or any custom implementation
  • the method onEvent inside the CustomEventHook was renamed to attachEvent as it seems a bit more meaningful
  • the attachEvent no longer passes the FastAdapter in, please use the provided method getFastAdapter() && getItem() to get the proper element in your event from the ViewHolder
  • the ClickListenerHelper was renamed to EventHookUtil 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 naming withEventHook

Don't miss a new FastAdapter release

NewReleases is sending notifications on new releases.