Item - Defines the type of items this `FastAdapter` manages (in case of multiple different types, use `IItem`)public class FastAdapter<Item extends IItem>
extends <any>
RecyclerView.
It also comes with IAdapterExtension allowing to further modify its behaviour.
Additionally it allows to attach various different listener's, and also EventHooks on per item and view basis.
See the sample application for more details
| Modifier and Type | Class and Description |
|---|---|
static class |
FastAdapter.RelativeInfo<Item extends IItem>
an internal class to return the IItem and relativePosition and its adapter at once.
|
static class |
FastAdapter.ViewHolder<Item extends IItem>
A ViewHolder provided from the FastAdapter to allow handling the important event's within the ViewHolder
instead of the item
|
| Constructor and Description |
|---|
FastAdapter()
default CTOR
|
| Modifier and Type | Method and Description |
|---|---|
IAdapter<Item> |
adapter(int order)
Tries to get an adapter by a specific order
|
<A extends IAdapter<Item>> |
addAdapter(int index,
A adapter)
add's a new adapter at the specific position
|
<E extends IAdapterExtension<Item>> |
addExtension(E extension) |
protected void |
cacheSizes()
we cache the sizes of our adapters so get accesses are faster
|
void |
clearTypeInstance()
clears the internal mapper - be sure, to remap everything before going on
|
java.util.List<Item> |
deleteAllSelectedItems()
Deprecated.
deprecated in favor of
SelectExtension.deleteAllSelectedItems(), Retrieve it via getExtension(Class) |
void |
deselect()
Deprecated.
deprecated in favor of
SelectExtension.deselect() , Retrieve it via getExtension(Class) |
void |
deselect(int position)
Deprecated.
deprecated in favor of
SelectExtension.deselect(int) , Retrieve it via getExtension(Class) |
void |
deselect(int position,
java.util.Iterator<java.lang.Integer> entries)
Deprecated.
deprecated in favor of
SelectExtension.deselect(int, Iterator), Retrieve it via getExtension(Class) |
void |
deselect(java.lang.Iterable<java.lang.Integer> positions)
Deprecated.
deprecated in favor of
SelectExtension.deselect(Iterable) , Retrieve it via getExtension(Class) |
FastAdapter<Item> |
enableVerboseLog()
enables the verbose log for the adapter
|
IAdapter<Item> |
getAdapter(int position)
Gets the adapter for the given position
|
java.util.List<EventHook<Item>> |
getEventHooks() |
<T extends IAdapterExtension<Item>> |
getExtension(java.lang.Class<? super T> clazz) |
java.util.Collection<IAdapterExtension<Item>> |
getExtensions() |
static <Item extends IItem> |
getHolderAdapterItem(RecyclerView.ViewHolder holder)
convenient helper method to get the Item from a holder
|
static <Item extends IItem> |
getHolderAdapterItem(RecyclerView.ViewHolder holder,
int position)
convenient helper method to get the Item from a holder
|
static <Item extends IItem> |
getHolderAdapterItemTag(RecyclerView.ViewHolder holder)
convenient helper method to get the Item from a holder via the defined tag
|
int |
getHolderAdapterPosition(RecyclerView.ViewHolder holder)
helper method to get the position from a holder
overwrite this if you have an adapter adding additional items inbetwean
|
Item |
getItem(int position)
gets the IItem by a position, from all registered adapters
|
<any> |
getItemById(long identifier)
gets the IItem given an identifier, from all registered adapters
|
int |
getItemCount()
calculates the total ItemCount over all registered adapters
|
long |
getItemId(int position)
finds the int ItemId from the IItem which exists at the given position
|
int |
getItemViewType(int position)
finds the int ItemViewType from the IItem which exists at the given position
|
OnClickListener<Item> |
getOnClickListener() |
int |
getPosition(Item item)
Searches for the given item and calculates its global position
|
int |
getPosition(long identifier)
Searches for the given item and calculates its global position
|
int |
getPreItemCount(int position)
calculates the item count up to a given (excluding this) adapter (defined by the global position of the item)
|
int |
getPreItemCountByOrder(int order)
calculates the item count up to a given (excluding this) order number
|
FastAdapter.RelativeInfo<Item> |
getRelativeInfo(int position)
Internal method to get the Item as ItemHolder which comes with the relative position within its adapter
Finds the responsible adapter for the given position
|
java.util.Set<Item> |
getSelectedItems()
Deprecated.
deprecated in favor of
SelectExtension.getSelectedItems() , Retrieve it via getExtension(Class) |
SelectExtension<Item> |
getSelectExtension()
Deprecated.
deprecated in favor of
getExtension(Class) |
java.util.Set<java.lang.Integer> |
getSelections()
Deprecated.
deprecated in favor of
SelectExtension.getSelections() , Retrieve it via getExtension(Class) |
Item |
getTypeInstance(int type)
gets the TypeInstance remembered within the FastAdapter for an item
|
ITypeInstanceCache<Item> |
getTypeInstanceCache() |
ClickEventHook<Item> |
getViewClickListener() |
LongClickEventHook<Item> |
getViewLongClickListener() |
TouchEventHook<Item> |
getViewTouchListener() |
boolean |
isSelectable() |
void |
notifyAdapterDataSetChanged()
wraps notifyDataSetChanged
|
void |
notifyAdapterItemChanged(int position)
wraps notifyItemChanged
|
void |
notifyAdapterItemChanged(int position,
java.lang.Object payload)
wraps notifyItemChanged
|
void |
notifyAdapterItemInserted(int position)
wraps notifyItemInserted
|
void |
notifyAdapterItemMoved(int fromPosition,
int toPosition)
wraps notifyItemMoved
|
void |
notifyAdapterItemRangeChanged(int position,
int itemCount)
wraps notifyItemRangeChanged
|
void |
notifyAdapterItemRangeChanged(int position,
int itemCount,
java.lang.Object payload)
wraps notifyItemRangeChanged
|
void |
notifyAdapterItemRangeInserted(int position,
int itemCount)
wraps notifyItemRangeInserted
|
void |
notifyAdapterItemRangeRemoved(int position,
int itemCount)
wraps notifyItemRangeRemoved
|
void |
notifyAdapterItemRemoved(int position)
wraps notifyItemRemoved
|
void |
onAttachedToRecyclerView(RecyclerView recyclerView) |
void |
onBindViewHolder(RecyclerView.ViewHolder holder,
int position)
Binds the data to the created ViewHolder and sets the listeners to the holder.itemView
Note that you should use the `onBindViewHolder(RecyclerView.ViewHolder holder, int position, List payloads`
as it allows you to implement a more efficient adapter implementation
|
void |
onBindViewHolder(RecyclerView.ViewHolder holder,
int position,
java.util.List<java.lang.Object> payloads)
Binds the data to the created ViewHolder and sets the listeners to the holder.itemView
|
RecyclerView.ViewHolder |
onCreateViewHolder(android.view.ViewGroup parent,
int viewType)
Creates the ViewHolder by the viewType
|
void |
onDetachedFromRecyclerView(RecyclerView recyclerView) |
boolean |
onFailedToRecycleView(RecyclerView.ViewHolder holder)
is called when the ViewHolder is in a transient state.
|
void |
onViewAttachedToWindow(RecyclerView.ViewHolder holder)
is called in onViewAttachedToWindow when the view is detached from the window
|
void |
onViewDetachedFromWindow(RecyclerView.ViewHolder holder)
is called in onViewDetachedFromWindow when the view is detached from the window
|
void |
onViewRecycled(RecyclerView.ViewHolder holder)
Unbinds the data to the already existing ViewHolder and removes the listeners from the holder.itemView
|
Triple<java.lang.Boolean,Item,java.lang.Integer> |
recursive(AdapterPredicate<Item> predicate,
boolean stopOnMatch)
util function which recursively iterates over all items and subItems of the given adapter.
|
Triple<java.lang.Boolean,Item,java.lang.Integer> |
recursive(AdapterPredicate<Item> predicate,
int globalStartPosition,
boolean stopOnMatch)
util function which recursively iterates over all items and subItems of the given adapter.
|
static <Item extends IItem> |
recursiveSub(IAdapter<Item> lastParentAdapter,
int lastParentPosition,
IExpandable parent,
AdapterPredicate<Item> predicate,
boolean stopOnMatch)
Util function which recursively iterates over all items of a `IExpandable` parent if and only if it is `expanded` and has `subItems`
This is usually only used in
|
void |
registerTypeInstance(Item item)
register a new type into the TypeInstances to be able to efficiently create thew ViewHolders
|
android.os.Bundle |
saveInstanceState(android.os.Bundle savedInstanceState)
add the values to the bundle for saveInstanceState
|
android.os.Bundle |
saveInstanceState(android.os.Bundle savedInstanceState,
java.lang.String prefix)
add the values to the bundle for saveInstanceState
|
void |
select()
Deprecated.
deprecated in favor of
SelectExtension.select() , Retrieve it via getExtension(Class) |
void |
select(boolean considerSelectableFlag)
Deprecated.
deprecated in favor of
SelectExtension.select(boolean) , Retrieve it via getExtension(Class) |
void |
select(int position)
Deprecated.
deprecated in favor of
SelectExtension.select(int), Retrieve it via getExtension(Class) |
void |
select(int position,
boolean fireEvent)
Deprecated.
deprecated in favor of
SelectExtension.select(int, boolean) , Retrieve it via getExtension(Class) |
void |
select(int position,
boolean fireEvent,
boolean considerSelectableFlag)
Deprecated.
deprecated in favor of
SelectExtension.select(int, boolean, boolean) , Retrieve it via getExtension(Class) |
void |
select(java.lang.Iterable<java.lang.Integer> positions)
Deprecated.
deprecated in favor of
SelectExtension.select(Iterable) , Retrieve it via getExtension(Class) |
void |
setTypeInstanceCache(ITypeInstanceCache<Item> mTypeInstanceCache)
Sets an type instance cache to this fast adapter instance.
|
void |
toggleSelection(int position)
Deprecated.
deprecated in favor of
SelectExtension.toggleSelection(int) , Retrieve it via getExtension(Class) |
static <Item extends IItem,A extends IAdapter> |
with(A adapter)
creates a new FastAdapter with the provided adapters
if adapters is null, a default ItemAdapter is defined
|
static <Item extends IItem,A extends IAdapter> |
with(java.util.Collection<A> adapters)
creates a new FastAdapter with the provided adapters
if adapters is null, a default ItemAdapter is defined
|
static <Item extends IItem,A extends IAdapter> |
with(java.util.Collection<A> adapters,
java.util.Collection<IAdapterExtension<Item>> extensions)
creates a new FastAdapter with the provided adapters
if adapters is null, a default ItemAdapter is defined
|
FastAdapter<Item> |
withAllowDeselection(boolean allowDeselection)
If false, a user can't deselect an item via click (you can still do this programmatically)
|
FastAdapter<Item> |
withAttachDefaultListeners(boolean mAttachDefaultListeners)
if set to `false` will not attach any listeners to the list.
|
FastAdapter<Item> |
withEventHook(EventHook<Item> eventHook)
adds a new event hook for an item
NOTE: this has to be called before adding the first items, as this won't be called anymore after the ViewHolders were created
|
FastAdapter<Item> |
withEventHooks(java.util.Collection<? extends EventHook<Item>> eventHooks)
adds new event hooks for an item
NOTE: this has to be called before adding the first items, as this won't be called anymore after the ViewHolders were created
|
FastAdapter<Item> |
withItemEvent(EventHook<Item> eventHook)
Deprecated.
please use `withEventHook`
|
FastAdapter<Item> |
withLegacyBindViewMode(boolean legacyBindViewMode)
set to true if you want the FastAdapter to forward all calls from onBindViewHolder(final RecyclerView.ViewHolder holder, int position) to onBindViewHolder(final RecyclerView.ViewHolder holder, int position, List payloads)
|
FastAdapter<Item> |
withMultiSelect(boolean multiSelect)
Enable this if you want multiSelection possible in the list
|
FastAdapter<Item> |
withOnBindViewHolderListener(OnBindViewHolderListener onBindViewHolderListener)
allows you to set an custom OnBindViewHolderListener which is used to bind the view.
|
FastAdapter<Item> |
withOnClickListener(OnClickListener<Item> onClickListener)
Define the OnClickListener which will be used for a single item
|
FastAdapter<Item> |
withOnCreateViewHolderListener(OnCreateViewHolderListener onCreateViewHolderListener)
allows you to set a custom OnCreateViewHolderListener which will be used before and after the ViewHolder is created
You may check the OnCreateViewHolderListenerImpl for the default behavior
|
FastAdapter<Item> |
withOnLongClickListener(OnLongClickListener<Item> onLongClickListener)
Define the OnLongClickListener which will be used for a single item
|
FastAdapter<Item> |
withOnPreClickListener(OnClickListener<Item> onPreClickListener)
Define the OnPreClickListener which will be used for a single item and is called after all internal methods are done
|
FastAdapter<Item> |
withOnPreLongClickListener(OnLongClickListener<Item> onPreLongClickListener)
Define the OnLongClickListener which will be used for a single item and is called after all internal methods are done
|
FastAdapter<Item> |
withOnTouchListener(OnTouchListener<Item> onTouchListener)
Define the TouchListener which will be used for a single item
|
FastAdapter<Item> |
withSavedInstanceState(android.os.Bundle savedInstanceState)
re-selects all elements stored in the savedInstanceState
IMPORTANT! Call this method only after all items where added to the adapters again.
|
FastAdapter<Item> |
withSavedInstanceState(android.os.Bundle savedInstanceState,
java.lang.String prefix)
re-selects all elements stored in the savedInstanceState
IMPORTANT! Call this method only after all items where added to the adapters again.
|
FastAdapter<Item> |
withSelectable(boolean selectable)
set if no item is selectable
|
FastAdapter<Item> |
withSelectionListener(ISelectionListener<Item> selectionListener)
set a listener that get's notified whenever an item is selected or deselected
|
FastAdapter<Item> |
withSelectOnLongClick(boolean selectOnLongClick)
Disable this if you want the selection on a single tap
|
FastAdapter<Item> |
withSelectWithItemUpdate(boolean selectWithItemUpdate)
select between the different selection behaviors.
|
public FastAdapter<Item> enableVerboseLog()
public void setTypeInstanceCache(ITypeInstanceCache<Item> mTypeInstanceCache)
mTypeInstanceCache - a custom `TypeInstanceCache` implementationpublic ITypeInstanceCache<Item> getTypeInstanceCache()
public static <Item extends IItem,A extends IAdapter> FastAdapter<Item> with(A adapter)
adapter - the adapters which this FastAdapter should usepublic static <Item extends IItem,A extends IAdapter> FastAdapter<Item> with(java.util.Collection<A> adapters)
adapters - the adapters which this FastAdapter should usepublic static <Item extends IItem,A extends IAdapter> FastAdapter<Item> with(java.util.Collection<A> adapters, java.util.Collection<IAdapterExtension<Item>> extensions)
adapters - the adapters which this FastAdapter should usepublic <A extends IAdapter<Item>> FastAdapter<Item> addAdapter(int index, A adapter)
index - the index where the new adapter should be addedadapter - the new adapter to be addedpublic IAdapter<Item> adapter(int order)
order - the order (position) to search the adapter atpublic <E extends IAdapterExtension<Item>> FastAdapter<Item> addExtension(E extension)
extension - public java.util.Collection<IAdapterExtension<Item>> getExtensions()
public <T extends IAdapterExtension<Item>> T getExtension(java.lang.Class<? super T> clazz)
clazz - the extension class, to retrieve its instance@Deprecated public FastAdapter<Item> withItemEvent(EventHook<Item> eventHook)
eventHook - the event hook to be added for an itempublic java.util.List<EventHook<Item>> getEventHooks()
public FastAdapter<Item> withEventHook(EventHook<Item> eventHook)
eventHook - the event hook to be added for an itempublic FastAdapter<Item> withEventHooks(java.util.Collection<? extends EventHook<Item>> eventHooks)
eventHooks - the event hooks to be added for an itempublic FastAdapter<Item> withOnClickListener(OnClickListener<Item> onClickListener)
onClickListener - the OnClickListener which will be used for a single itempublic OnClickListener<Item> getOnClickListener()
public FastAdapter<Item> withOnPreClickListener(OnClickListener<Item> onPreClickListener)
onPreClickListener - the OnPreClickListener which will be called after a single item was clicked and all internal methods are donepublic FastAdapter<Item> withOnLongClickListener(OnLongClickListener<Item> onLongClickListener)
onLongClickListener - the OnLongClickListener which will be used for a single itempublic FastAdapter<Item> withOnPreLongClickListener(OnLongClickListener<Item> onPreLongClickListener)
onPreLongClickListener - the OnLongClickListener which will be called after a single item was clicked and all internal methods are donepublic FastAdapter<Item> withOnTouchListener(OnTouchListener<Item> onTouchListener)
onTouchListener - the TouchListener which will be used for a single itempublic FastAdapter<Item> withOnCreateViewHolderListener(OnCreateViewHolderListener onCreateViewHolderListener)
onCreateViewHolderListener - the OnCreateViewHolderListener (you may use the OnCreateViewHolderListenerImpl)public FastAdapter<Item> withOnBindViewHolderListener(OnBindViewHolderListener onBindViewHolderListener)
onBindViewHolderListener - the OnBindViewHolderListenerpublic FastAdapter<Item> withSelectWithItemUpdate(boolean selectWithItemUpdate)
selectWithItemUpdate - true if notifyItemChanged should be called upon selectpublic FastAdapter<Item> withMultiSelect(boolean multiSelect)
multiSelect - true to enable multiSelectpublic FastAdapter<Item> withSelectOnLongClick(boolean selectOnLongClick)
selectOnLongClick - false to do select via single clickpublic FastAdapter<Item> withAllowDeselection(boolean allowDeselection)
allowDeselection - true if a user can deselect an already selected item via clickpublic FastAdapter<Item> withSelectable(boolean selectable)
selectable - true if items are selectablepublic FastAdapter<Item> withLegacyBindViewMode(boolean legacyBindViewMode)
legacyBindViewMode - true if you want to activate it (default = false)public FastAdapter<Item> withAttachDefaultListeners(boolean mAttachDefaultListeners)
mAttachDefaultListeners - false if you want no listeners attached to the item (default = true)public FastAdapter<Item> withSelectionListener(ISelectionListener<Item> selectionListener)
selectionListener - the listener that will be notified about selection changespublic boolean isSelectable()
public FastAdapter<Item> withSavedInstanceState(android.os.Bundle savedInstanceState)
savedInstanceState - If the activity is being re-initialized after
previously being shut down then this Bundle contains the data it most
recently supplied in Note: Otherwise it is null.public FastAdapter<Item> withSavedInstanceState(android.os.Bundle savedInstanceState, java.lang.String prefix)
savedInstanceState - If the activity is being re-initialized after
previously being shut down then this Bundle contains the data it most
recently supplied in Note: Otherwise it is null.prefix - a prefix added to the savedInstance key so we can store multiple statespublic void registerTypeInstance(Item item)
item - an IItem which will be shown in the listpublic Item getTypeInstance(int type)
type - the int type of the itempublic void clearTypeInstance()
public int getHolderAdapterPosition(RecyclerView.ViewHolder holder)
holder - the viewHolder of the itempublic RecyclerView.ViewHolder onCreateViewHolder(android.view.ViewGroup parent,
int viewType)
parent - the parent view (the RecyclerView)viewType - the current viewType which is boundpublic void onBindViewHolder(RecyclerView.ViewHolder holder,
int position)
holder - the viewHolder we bind the data onposition - the global positionpublic void onBindViewHolder(RecyclerView.ViewHolder holder,
int position,
java.util.List<java.lang.Object> payloads)
holder - the viewHolder we bind the data onposition - the global positionpayloads - the payloads for the bindViewHolder event containing data which allows to improve view animatingpublic void onViewRecycled(RecyclerView.ViewHolder holder)
holder - the viewHolder we unbind the data frompublic void onViewDetachedFromWindow(RecyclerView.ViewHolder holder)
holder - the viewHolder for the view which got detachedpublic void onViewAttachedToWindow(RecyclerView.ViewHolder holder)
holder - the viewHolder for the view which got detachedpublic boolean onFailedToRecycleView(RecyclerView.ViewHolder holder)
holder - the viewHolder for the view which failed to recyclepublic void onAttachedToRecyclerView(RecyclerView recyclerView)
public void onDetachedFromRecyclerView(RecyclerView recyclerView)
public int getPosition(Item item)
item - the item which is searched forpublic int getPosition(long identifier)
identifier - the identifier of an item which is searched forpublic Item getItem(int position)
position - the global positionpublic <any> getItemById(long identifier)
identifier - the identifier of the searched itempublic FastAdapter.RelativeInfo<Item> getRelativeInfo(int position)
position - the global positionpublic IAdapter<Item> getAdapter(int position)
position - the global positionpublic int getItemViewType(int position)
position - the global positionpublic long getItemId(int position)
position - the global positionpublic int getItemCount()
public int getPreItemCountByOrder(int order)
order - the number up to which the items are countedpublic int getPreItemCount(int position)
position - the global position of an adapter itempublic android.os.Bundle saveInstanceState(android.os.Bundle savedInstanceState)
savedInstanceState - If the activity is being re-initialized after
previously being shut down then this Bundle contains the data it most
recently supplied in Note: Otherwise it is null.public android.os.Bundle saveInstanceState(android.os.Bundle savedInstanceState,
java.lang.String prefix)
savedInstanceState - If the activity is being re-initialized after
previously being shut down then this Bundle contains the data it most
recently supplied in Note: Otherwise it is null.prefix - a prefix added to the savedInstance key so we can store multiple statesprotected void cacheSizes()
public ClickEventHook<Item> getViewClickListener()
withAttachDefaultListeners(boolean)public LongClickEventHook<Item> getViewLongClickListener()
withAttachDefaultListeners(boolean)public TouchEventHook<Item> getViewTouchListener()
withAttachDefaultListeners(boolean)@Deprecated public SelectExtension<Item> getSelectExtension()
getExtension(Class)@Deprecated public java.util.Set<java.lang.Integer> getSelections()
SelectExtension.getSelections() , Retrieve it via getExtension(Class)@Deprecated public java.util.Set<Item> getSelectedItems()
SelectExtension.getSelectedItems() , Retrieve it via getExtension(Class)@Deprecated public void toggleSelection(int position)
SelectExtension.toggleSelection(int) , Retrieve it via getExtension(Class)position - the global position@Deprecated public void select(java.lang.Iterable<java.lang.Integer> positions)
SelectExtension.select(Iterable) , Retrieve it via getExtension(Class)positions - the global positions to select@Deprecated public void select(int position)
SelectExtension.select(int), Retrieve it via getExtension(Class)position - the global position@Deprecated
public void select(int position,
boolean fireEvent)
SelectExtension.select(int, boolean) , Retrieve it via getExtension(Class)position - the global positionfireEvent - true if the onClick listener should be called@Deprecated
public void select(int position,
boolean fireEvent,
boolean considerSelectableFlag)
SelectExtension.select(int, boolean, boolean) , Retrieve it via getExtension(Class)position - the global positionfireEvent - true if the onClick listener should be calledconsiderSelectableFlag - true if the select method should not select an item if its not selectable@Deprecated public void deselect()
SelectExtension.deselect() , Retrieve it via getExtension(Class)@Deprecated public void select()
SelectExtension.select() , Retrieve it via getExtension(Class)@Deprecated public void select(boolean considerSelectableFlag)
SelectExtension.select(boolean) , Retrieve it via getExtension(Class)considerSelectableFlag - true if the select method should not select an item if its not selectable@Deprecated public void deselect(java.lang.Iterable<java.lang.Integer> positions)
SelectExtension.deselect(Iterable) , Retrieve it via getExtension(Class)positions - the global positions to deselect@Deprecated public void deselect(int position)
SelectExtension.deselect(int) , Retrieve it via getExtension(Class)position - the global position@Deprecated
public void deselect(int position,
java.util.Iterator<java.lang.Integer> entries)
SelectExtension.deselect(int, Iterator), Retrieve it via getExtension(Class)position - the global positionentries - the iterator which is used to deselect all@Deprecated public java.util.List<Item> deleteAllSelectedItems()
SelectExtension.deleteAllSelectedItems(), Retrieve it via getExtension(Class)public void notifyAdapterDataSetChanged()
public void notifyAdapterItemInserted(int position)
position - the global positionpublic void notifyAdapterItemRangeInserted(int position,
int itemCount)
position - the global positionitemCount - the count of items insertedpublic void notifyAdapterItemRemoved(int position)
position - the global positionpublic void notifyAdapterItemRangeRemoved(int position,
int itemCount)
position - the global positionitemCount - the count of items removedpublic void notifyAdapterItemMoved(int fromPosition,
int toPosition)
fromPosition - the global fromPositiontoPosition - the global toPositionpublic void notifyAdapterItemChanged(int position)
position - the global positionpublic void notifyAdapterItemChanged(int position,
java.lang.Object payload)
position - the global positionpayload - additional payloadpublic void notifyAdapterItemRangeChanged(int position,
int itemCount)
position - the global positionitemCount - the count of items changedpublic void notifyAdapterItemRangeChanged(int position,
int itemCount,
java.lang.Object payload)
position - the global positionitemCount - the count of items changedpayload - an additional payloadpublic static <Item extends IItem> Item getHolderAdapterItem(RecyclerView.ViewHolder holder)
holder - the ViewHolder for which we want to retrieve the itempublic static <Item extends IItem> Item getHolderAdapterItem(RecyclerView.ViewHolder holder, int position)
holder - the ViewHolder for which we want to retrieve the itemposition - the position for which we want to retrieve the itempublic static <Item extends IItem> Item getHolderAdapterItemTag(RecyclerView.ViewHolder holder)
holder - the ViewHolder for which we want to retrieve the itempublic Triple<java.lang.Boolean,Item,java.lang.Integer> recursive(AdapterPredicate<Item> predicate, boolean stopOnMatch)
predicate - the predicate to run on every item, to check for a match or do some changes (e.g. select)stopOnMatch - defines if we should stop iterating after the first matchpublic Triple<java.lang.Boolean,Item,java.lang.Integer> recursive(AdapterPredicate<Item> predicate, int globalStartPosition, boolean stopOnMatch)
predicate - the predicate to run on every item, to check for a match or do some changes (e.g. select)globalStartPosition - the start position at which we star tto recursively iterate over the items. (This will not stop at the end of a sub hierarchy!)stopOnMatch - defines if we should stop iterating after the first matchpublic static <Item extends IItem> Triple<java.lang.Boolean,Item,java.lang.Integer> recursiveSub(IAdapter<Item> lastParentAdapter, int lastParentPosition, IExpandable parent, AdapterPredicate<Item> predicate, boolean stopOnMatch)
Item - the type of the `Item`lastParentAdapter - the last `IAdapter` managing the last (visible) parent item (that might also be a parent of a parent, ..)lastParentPosition - the global position of the last (visible) parent item, holding this sub item (that might also be a parent of a parent, ..)parent - the `IExpandableParent` to start frompredicate - the predicate to run on every item, to check for a match or do some changes (e.g. select)stopOnMatch - defines if we should stop iterating after the first match