/** * overwrite the unregisterAdapterDataObserver to correctly forward all events to the FastAdapter * * @param observer */ @Override public void unregisterAdapterDataObserver(RecyclerView.AdapterDataObserver observer) { super.unregisterAdapterDataObserver(observer); if (mFastAdapter != null) { mFastAdapter.unregisterAdapterDataObserver(observer); } }
/** * overwrite the getItemId to correctly return the value from the FastAdapter * * @param position * @return */ @Override public long getItemId(int position) { return mFastAdapter.getItemId(position); }
/** * overwrite the getItemViewType to correctly return the value from the FastAdapter * * @param position * @return */ @Override public int getItemViewType(int position) { return mFastAdapter.getItemViewType(position); }
/** * internal mapper to remember and add possible types for the RecyclerView * * @param item */ public void mapPossibleType(Item item) { mFastAdapter.registerTypeInstance(item); }
/** * the onAttachedToRecyclerView is managed by the FastAdapter so forward this correctly * * @param recyclerView */ @Override public void onAttachedToRecyclerView(RecyclerView recyclerView) { mFastAdapter.onAttachedToRecyclerView(recyclerView); }
/** * the onDetachedFromRecyclerView is managed by the FastAdapter so forward this correctly * * @param recyclerView */ @Override public void onDetachedFromRecyclerView(RecyclerView recyclerView) { mFastAdapter.onDetachedFromRecyclerView(recyclerView); }
/** * the onFailedToRecycleView is managed by the FastAdapter so forward this correctly * * @param holder * @return */ @Override public boolean onFailedToRecycleView(RecyclerView.ViewHolder holder) { return mFastAdapter.onFailedToRecycleView(holder); }
/** * the onViewAttachedToWindow is managed by the FastAdapter so forward this correctly * * @param holder */ @Override public void onViewAttachedToWindow(RecyclerView.ViewHolder holder) { mFastAdapter.onViewAttachedToWindow(holder); }
/** * the setHasStableIds is managed by the FastAdapter so forward this correctly * * @param hasStableIds */ @Override public void setHasStableIds(boolean hasStableIds) { mFastAdapter.setHasStableIds(hasStableIds); }
/** * the onViewRecycled is managed by the FastAdapter so forward this correctly * * @param holder */ @Override public void onViewRecycled(RecyclerView.ViewHolder holder) { mFastAdapter.onViewRecycled(holder); }
/** * the onBindViewHolder is managed by the FastAdapter so forward this correctly * * @param holder * @param position * @param payloads */ @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List payloads) { mFastAdapter.onBindViewHolder(holder, position, payloads); }
/** * the onBindViewHolder is managed by the FastAdapter so forward this correctly * * @param holder * @param position */ @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { mFastAdapter.onBindViewHolder(holder, position); }
/** * the onCreateViewHolder is managed by the FastAdapter so forward this correctly * * @param parent * @param viewType * @return */ @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return mFastAdapter.onCreateViewHolder(parent, viewType); }
/** * make sure we return the count from the FastAdapter so we retrieve the count from all adapters * * @return */ @Override public int getItemCount() { return mFastAdapter.getItemCount(); }
/** * make sure we return the Item from the FastAdapter so we retrieve the item from all adapters * * @param position * @return */ @Override public Item getItem(int position) { return mFastAdapter.getItem(position); }