/** * add a list of items to the end of the existing items * * @param list the items to add */ public ModelAdapter<Model, Item> add(List<Model> list) { List<Item> items = intercept(list); return addInternal(items); }
/** * add a list of items at the given position within the existing items * * @param position the global position * @param list the items to add */ public ModelAdapter<Model, Item> add(int position, List<Model> list) { List<Item> items = intercept(list); return addInternal(position, items); }
/** * add a list of items to the end of the existing items * will prior check if we are currently filtering * * @param items the items to add */ public ModelAdapter<?, Item> add(List<Item> items) { if (mOriginalItems != null && items.size() > 0) { if (mItemAdapter.isUseIdDistributor()) { mItemAdapter.getIdDistributor().checkIds(items); } mOriginalItems.addAll(items); publishResults(mConstraint, performFiltering(mConstraint)); return mItemAdapter; } else { return mItemAdapter.addInternal(items); } }
/** * add a list of items at the given position within the existing items * * @param position the global position * @param items the items to add */ public ModelAdapter<?, Item> add(int position, List<Item> items) { if (mOriginalItems != null && items.size() > 0) { if (mItemAdapter.isUseIdDistributor()) { mItemAdapter.getIdDistributor().checkIds(items); } mOriginalItems.addAll(getAdapterPosition(mItemAdapter.getAdapterItems().get(position)) - mItemAdapter.getFastAdapter().getPreItemCount(position), items); publishResults(mConstraint, performFiltering(mConstraint)); return mItemAdapter; } else { return mItemAdapter.addInternal(position, items); } }