/** * 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 FastAdapterDialog<Item> add(int position, List<Item> items) { mItemAdapter.add(position, items); return this; }
/** * add an item at the end of the existing items * * @param item the item to add */ public FastAdapterDialog<Item> add(Item item) { mItemAdapter.add(item); return this; }
/** * 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 FastAdapterBottomSheetDialog<Item> add(int position, List<Item> items) { mItemAdapter.add(position, items); return this; }
/** * add an item at the given position within the existing icons * * @param position the global position * @param item the item to add */ public FastAdapterDialog<Item> add(int position, Item item) { mItemAdapter.add(position, item); return this; }
/** * add a list of items to the end of the existing items * * @param items the items to add */ public FastAdapterBottomSheetDialog<Item> add(List<Item> items) { mItemAdapter.add(items); return this; }
/** * add an item at the end of the existing items * * @param item the item to add */ public FastAdapterBottomSheetDialog<Item> add(Item item) { mItemAdapter.add(item); return this; }
/** * add an array of items at the given position within the existing items * * @param position the global position * @param items the items to add */ @SafeVarargs public final FastAdapterBottomSheetDialog<Item> add(int position, Item... items) { mItemAdapter.add(position, items); return this; }
/** * add an array of items to the end of the existing items * * @param items the items to add */ @SafeVarargs public final FastAdapterDialog<Item> add(Item... items) { mItemAdapter.add(items); return this; }
/** * add an array of items at the given position within the existing items * * @param position the global position * @param items the items to add */ @SafeVarargs public final FastAdapterDialog<Item> add(int position, Item... items) { mItemAdapter.add(position, items); return this; }
/** * add an array of items to the end of the existing items * * @param items the items to add */ @SafeVarargs public final FastAdapterBottomSheetDialog<Item> add(Item... items) { mItemAdapter.add(items); return this; }
/** * add an item at the given position within the existing icons * * @param position the global position * @param item the item to add */ public FastItemAdapter<Item> add(int position, Item item) { getItemAdapter().add(position, item); return this; }
/** * 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 FastItemAdapter<Item> add(int position, List<Item> items) { getItemAdapter().add(position, items); return this; }
public FastAdapterBottomSheetDialog<Item> withItems(@NonNull Item... items) { initAdapterIfNeeded(); mItemAdapter.add(items); return this; }
/** * add an item at the end of the existing items * * @param item the item to add */ public FastItemAdapter<Item> add(Item item) { getItemAdapter().add(item); return this; }
/** * add an array of items to the end of the existing items * * @param items the items to add */ @SafeVarargs public final FastItemAdapter<Item> add(Item... items) { getItemAdapter().add(items); return this; }
/** * add a list of items to the end of the existing items * * @param items the items to add */ public FastItemAdapter<Item> add(List<Item> items) { getItemAdapter().add(items); return this; }
/** * add an array of items at the given position within the existing items * * @param position the global position * @param items the items to add */ @SafeVarargs public final FastItemAdapter<Item> add(int position, Item... items) { getItemAdapter().add(position, items); return this; }
@Override public void run() { //add some dummy data mItemAdapter.add(ImageDummyData.getSimpleImageItems()); //restore selections (this has to be done after the items were added mFastAdapter.withSavedInstanceState(savedInstanceState); } }, 50);
@Test public void getPosition() throws Exception { TestItem testItem = TestDataGenerator.genTestItem(1); itemAdapter.add(testItem); assertThat(adapter.getPosition(testItem)).isEqualTo(0); }
@Test public void testAddPreviouslyFilledAdapterPropagatesPossibleTypesToParentFastAdapter() { final TestItem testItem = new TestItem("example name"); ItemAdapter<TestItem> itemAdapter = new ItemAdapter<>(); itemAdapter.add(testItem); FastAdapter<TestItem> adapter = new FastAdapter<>(); adapter.addAdapter(0, itemAdapter); final ViewGroup dummyParent = new FrameLayout(RuntimeEnvironment.application); adapter.onCreateViewHolder(dummyParent, testItem.getType()); } }