public class ItemAdapter<Item extends IItem> extends AbstractAdapter<Item> implements IItemAdapter<Item>
| Modifier and Type | Class and Description |
|---|---|
class |
ItemAdapter.ItemFilter
ItemFilter which extends the Filter api provided by Android
This calls automatically all required methods, just overwrite the filterItems method
|
IItemAdapter.Predicate<Item extends IItem>| Constructor and Description |
|---|
ItemAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int position,
Item... items)
add an array of items at the given position within the existing items
|
void |
add(int position,
java.util.List<Item> items)
add a list of items at the given position within the existing items
|
void |
add(Item... items)
add an array of items to the end of the existing items
|
void |
add(java.util.List<Item> items)
add a list of items to the end of the existing items
|
void |
clear()
removes all items of this adapter
|
void |
filter(java.lang.CharSequence constraint)
filters the items with the constraint using the provided Predicate
|
Item |
getAdapterItem(int position) |
int |
getAdapterItemCount()
defines the count of items of THIS adapter
|
java.util.List<Item> |
getAdapterItems() |
int |
getAdapterPosition(Item item)
Searches for the given item and calculates it's relative position
|
int |
getGlobalPosition(int position)
returns the global position if the relative position within this adapter was given
|
ItemAdapter.ItemFilter |
getItemFilter() |
int |
getOrder()
defines in which order this adapter should be hooked into the FastAdapter
|
void |
remove(int position)
removes an item at the given position within the existing icons
|
void |
removeRange(int position,
int itemCount)
removes a range of items starting with the given position within the existing icons
|
void |
set(int position,
Item item)
sets an item at the given position, overwriting the previous item
|
void |
set(java.util.List<Item> items)
set a new list of items and apply it to the existing list (clear - add) for this adapter
Note may consider using setNewList if the items list is a reference to the list which is used inside the adapter
|
void |
setNewList(java.util.List<Item> items)
sets a complete new list of items onto this adapter, using the new list.
|
<T> T |
setSubItems(IExpandable<T,Item> collapsible,
java.util.List<Item> subItems)
sets the subItems of the given collapsible
This method also makes sure identifiers are set if we use the IdDistributor
|
ItemAdapter<Item> |
withFilterPredicate(IItemAdapter.Predicate<Item> filterPredicate)
define the predicate used to filter the list inside the ItemFilter
|
ItemAdapter |
withUseIdDistributor(boolean useIdDistributor)
defines if the IdDistributor is used to provide an ID to all added items which do not yet define an id
|
getFastAdapter, getItem, getItemCount, getItemId, getItemViewType, mapPossibleType, mapPossibleTypes, onAttachedToRecyclerView, onBindViewHolder, onBindViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver, wrap, wrapbindViewHolder, createViewHolder, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemovedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFastAdapter, getItem, getItemCountpublic ItemAdapter withUseIdDistributor(boolean useIdDistributor)
useIdDistributor - false if the IdDistributor shouldn't be usedpublic ItemAdapter.ItemFilter getItemFilter()
public ItemAdapter<Item> withFilterPredicate(IItemAdapter.Predicate<Item> filterPredicate)
filterPredicate - the predicate used to filter the list inside the ItemFilterpublic void filter(java.lang.CharSequence constraint)
constraint - the string used to filter the listpublic int getOrder()
IAdapterpublic int getAdapterItemCount()
IAdaptergetAdapterItemCount in interface IAdapter<Item extends IItem>public java.util.List<Item> getAdapterItems()
getAdapterItems in interface IAdapter<Item extends IItem>public int getAdapterPosition(Item item)
getAdapterPosition in interface IAdapter<Item extends IItem>item - the item which is searched forpublic int getGlobalPosition(int position)
getGlobalPosition in interface IAdapter<Item extends IItem>position - the relative positionpublic Item getAdapterItem(int position)
getAdapterItem in interface IAdapter<Item extends IItem>position - the relative positionpublic <T> T setSubItems(IExpandable<T,Item> collapsible, java.util.List<Item> subItems)
setSubItems in interface IItemAdapter<Item extends IItem>collapsible - the collapsible which gets the subItems setsubItems - the subItems for this collapsible itempublic void set(java.util.List<Item> items)
set in interface IItemAdapter<Item extends IItem>items - the items to setpublic void setNewList(java.util.List<Item> items)
setNewList in interface IItemAdapter<Item extends IItem>items - the new items to set@SafeVarargs public final void add(Item... items)
add in interface IItemAdapter<Item extends IItem>items - the items to addpublic void add(java.util.List<Item> items)
add in interface IItemAdapter<Item extends IItem>items - the items to add@SafeVarargs
public final void add(int position,
Item... items)
add in interface IItemAdapter<Item extends IItem>position - the global positionitems - the items to addpublic void add(int position,
java.util.List<Item> items)
add in interface IItemAdapter<Item extends IItem>position - the global positionitems - the items to addpublic void set(int position,
Item item)
set in interface IItemAdapter<Item extends IItem>position - the global positionitem - the item to setpublic void remove(int position)
remove in interface IItemAdapter<Item extends IItem>position - the global positionpublic void removeRange(int position,
int itemCount)
removeRange in interface IItemAdapter<Item extends IItem>position - the global positionitemCount - the count of items which were removedpublic void clear()
clear in interface IItemAdapter<Item extends IItem>