- 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
public interface ItemFilterListener<Item> {
void itemsFiltered(@Nullable CharSequence constraint, @Nullable List<Item> results);
void onReset();
}
- 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 favor of the new namingwithEventHook
- the
ItemTouchCallback
has a new methoditemTouchDropped
just implement it and keep it empty, if you do not need it. - If you implemented your own
Item
using theIItem
interface instead theAbstractItem
you will now also have to implementfailedToRecycle
- removed the
RecyclerViewCacheUtil
as it would no longer work with the latest RecyclerView
WARNING
- If you use the MaterialDrawer or the AboutLibraries you will need a compatible release of those for it to work
- The FACTORY within the items is no longer required and replaced by a much simpler approach. Remove the old FACTORY and it's methods, and implement the
getViewHolder
method
@Override
public ViewHolder getViewHolder(View v) {
return new ViewHolder(v);
}
- If you implemented your own
Item
using theIItem
interface instead theAbstractItem
you will now also have to implementattachToWindow
anddetachFromWindow
- The reflection based
GenericItemAdapter
CTOR (with the 2 classes as overload) was removed. Please use the CTOR using aFunction
- This release brings minor changes to the
IItem
interface. Please update MaterialDrawer and AboutLibraries too if you use them. - Starting with this version there is now the
core
and thecommons
dependency. Which make theFastAdapter
even slimmer if you want to use the basics.
QUICK UPGRADE
- The
List payloads
param in theonBindViewHolder
method was changed toList<Object> payloads
- The FastAdapter is now split into smaller dependencies
com.mikepenz:fastadapter
: just contains the basics (noFastItemAdapter
for example)com.mikepenz:fastadapter-commons
: this one contains theFastItemAdapter
and more useful common helper classes (please make sure to update the imports as these classes moved tocom.mikepenz.fastadapter.commons.*
)com.mikepenz:fastadapter-extensions
: comes with additional utils and helpers which bring allow more complex and advanced implementations
- This release brings new interfaces, and many changes to the expandable behavior. There is now also a
unbindView
method you have to implement for yourIItem
s.
SHORT OVERVIEW
- If you have items implemented by using the interface you have to implement the new methods (unbindView)
- If you have expandable items make sure to adjust the generic type definitions as metioned below. Check out the
AbstractExpandableItem
to simplify this for you - If you use the
MaterialDrawer
, theAboutLibraries
in your project, please make sure to update them so the changed interfaces do not cause conflicts
DETAILED
- New
unbindView
method was added to theIItem
--> This method is called when the current item is no longer set and before theViewHolder
is used for the next item - You should move your view resetting logic here, or for example glide image loading canceling
IExpandable
generic types changes- it is now required to define the type which will be used for the subItems. This can be an implementation or
ISubItem
. We now require this, as we will keep the references between childs, and parents. - this allows more optimizations, and many additional usecases
- New
ISubItem
interface added - items serving as subitems, have to implement this.
- New
AbstractExpandableItem
added, which combinesIExpandable
andISubItem
with anAbstractItem
to simplify your life - A new
SubItemUtil
was introduced which simplifies some use cases when working with expandable / collapsing lists
Extensions
- new
EndlessRecyclerOnTopScrollListener
available - new
IExtendedDraggable
andDragDropUtil
introduced - new
RangeSelectorHelper
introduced
- This release bring a breaking interface change. Your items now have to implement
bindView(ViewHolder holder, List payloads)
instead ofbindView(VH holder)
. - The additional payload can be used to implement a more performant view updating when only parts of the item have changed. Please also refer to the
DiffUtils
which may provide the payload.
- Dropping support for API < 14. New
MinSdkVersion
is 14
- the
IExpandable
interface has a new methodisAutoExpanding
which needs to be implemented (default valuetrue
). This allows to disable the auto toggling ofExpandable
items in theFastAdapter
which is a problem for custom behaviors. Like issue #157
- with v1.4.0 by default a FastAdapter is now
withSelectable(false)
(for normal lists) if you have selection enabled in your list, addwithSelectable(true)
to yourFastAdapter
,FastItemAdapter
or `GenericFastItemAdapter``