public abstract class AbstractWrapAdapter<Item extends IItem>
extends RecyclerView.Adapter
| Constructor and Description |
|---|
AbstractWrapAdapter(java.util.List<Item> items) |
| Modifier and Type | Method and Description |
|---|---|
RecyclerView.Adapter |
getAdapter() |
Item |
getItem(int position)
make sure we return the Item from the FastAdapter so we retrieve the item from all adapters
|
int |
getItemCount()
make sure we return the count from the FastAdapter so we retrieve the count from all adapters
|
long |
getItemId(int position)
overwrite the getItemId to correctly return the value from the FastAdapter
|
java.util.List<Item> |
getItems() |
int |
getItemViewType(int position)
overwrite the getItemViewType to correctly return the value from the FastAdapter
|
abstract int |
itemInsertedBeforeCount(int position)
this method calculates how many elements were already inserted before this position;
|
void |
onAttachedToRecyclerView(RecyclerView recyclerView)
the onAttachedToRecyclerView is managed by the FastAdapter so forward this correctly
|
void |
onBindViewHolder(RecyclerView.ViewHolder holder,
int position) |
void |
onBindViewHolder(RecyclerView.ViewHolder holder,
int position,
java.util.List payloads)
the onBindViewHolder is managed by the FastAdapter so forward this correctly
|
RecyclerView.ViewHolder |
onCreateViewHolder(android.view.ViewGroup parent,
int viewType)
the onCreateViewHolder is managed by the FastAdapter so forward this correctly
|
void |
onDetachedFromRecyclerView(RecyclerView recyclerView)
the onDetachedFromRecyclerView is managed by the FastAdapter so forward this correctly
|
boolean |
onFailedToRecycleView(RecyclerView.ViewHolder holder)
the onFailedToRecycleView is managed by the FastAdapter so forward this correctly
|
void |
onViewAttachedToWindow(RecyclerView.ViewHolder holder)
the onViewAttachedToWindow is managed by the FastAdapter so forward this correctly
|
void |
onViewDetachedFromWindow(RecyclerView.ViewHolder holder)
the onViewDetachedFromWindow is managed by the FastAdapter so forward this correctly
|
void |
onViewRecycled(RecyclerView.ViewHolder holder)
the onViewRecycled is managed by the FastAdapter so forward this correctly
|
void |
registerAdapterDataObserver(RecyclerView.AdapterDataObserver observer)
overwrite the registerAdapterDataObserver to correctly forward all events to the FastAdapter
|
void |
setHasStableIds(boolean hasStableIds)
the setHasStableIds is managed by the FastAdapter so forward this correctly
|
void |
setItems(java.util.List<Item> items) |
abstract boolean |
shouldInsertItemAtPosition(int position)
this method states if we should insert a custom element at the vien position
|
void |
unregisterAdapterDataObserver(RecyclerView.AdapterDataObserver observer)
overwrite the unregisterAdapterDataObserver to correctly forward all events to the FastAdapter
|
AbstractWrapAdapter |
wrap(RecyclerView.Adapter adapter)
Wrap the FastAdapter with this AbstractAdapter and keep its reference to forward all events correctly
|
public AbstractWrapAdapter(java.util.List<Item> items)
public java.util.List<Item> getItems()
public void setItems(java.util.List<Item> items)
public AbstractWrapAdapter wrap(RecyclerView.Adapter adapter)
adapter - the FastAdapter which contains the base logicpublic abstract boolean shouldInsertItemAtPosition(int position)
position - public abstract int itemInsertedBeforeCount(int position)
position - public void registerAdapterDataObserver(RecyclerView.AdapterDataObserver observer)
observer - public void unregisterAdapterDataObserver(RecyclerView.AdapterDataObserver observer)
observer - public int getItemViewType(int position)
position - public long getItemId(int position)
position - public RecyclerView.Adapter getAdapter()
public Item getItem(int position)
position - public int getItemCount()
public RecyclerView.ViewHolder onCreateViewHolder(android.view.ViewGroup parent,
int viewType)
parent - viewType - public void onBindViewHolder(RecyclerView.ViewHolder holder,
int position)
public void onBindViewHolder(RecyclerView.ViewHolder holder,
int position,
java.util.List payloads)
holder - position - public void setHasStableIds(boolean hasStableIds)
hasStableIds - public void onViewRecycled(RecyclerView.ViewHolder holder)
holder - public boolean onFailedToRecycleView(RecyclerView.ViewHolder holder)
holder - public void onViewDetachedFromWindow(RecyclerView.ViewHolder holder)
holder - public void onViewAttachedToWindow(RecyclerView.ViewHolder holder)
holder - public void onAttachedToRecyclerView(RecyclerView recyclerView)
recyclerView - public void onDetachedFromRecyclerView(RecyclerView recyclerView)
recyclerView -