/** * static method to retrieve a new `ItemAdapter` * * @return a new ItemAdapter */ public static <Item extends IItem> ItemAdapter<Item> items() { return new ItemAdapter<>(); } }
@Before public void setUp() throws Exception { itemAdapter = new ItemAdapter<>(); adapter = FastAdapter.with(itemAdapter); }
/** * builder to build an adapter out of the given information ;D * * @param context the current context * @return a LibsRecyclerViewAdapter with the libraries */ public FastAdapter adapter(Context context) { Libs libs; if (fields == null) { libs = new Libs(context); } else { libs = new Libs(context, fields); } //apply modifications libs.modifyLibraries(libraryModification); //fetch the libraries and sort if a comparator was set ArrayList<Library> libraries = libs.prepareLibraries(context, internalLibraries, excludeLibraries, autoDetect, checkCachedDetection, sort); //prepare adapter ItemAdapter itemAdapter = new ItemAdapter(); List<LibraryItem> libraryItems = new ArrayList<>(); for (Library library : libraries) { libraryItems.add(new LibraryItem().withLibrary(library).withLibsBuilder(this)); } FastAdapter fastAdapter = FastAdapter.with(itemAdapter); //noinspection unchecked itemAdapter.add(libraryItems); return fastAdapter; }
@Before public void setUp() throws Exception { itemAdapter = new ItemAdapter<>(); expandableExtension = new ExpandableExtension<>(); adapter = FastAdapter.with(itemAdapter); adapter.addExtension(expandableExtension); //adapter.withPositionBasedStateManagement(true); }
@Before public void setUp() throws Exception { itemAdapter = new ItemAdapter<>(); adapter = FastAdapter.with(itemAdapter); selectExtension = new SelectExtension<>(); adapter.addExtension(selectExtension); //adapter.withPositionBasedStateManagement(true); }
@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()); } }
mItemAdapter = new ItemAdapter<>(); mAdapter = FastAdapter.with(mItemAdapter); mAdapter.withSelectable(true);
mItemAdapter = new ItemAdapter(); mAdapter = FastAdapter.with(mItemAdapter); mRecyclerView.setAdapter(mAdapter);
final ItemAdapter headerAdapter = new ItemAdapter(); final ItemAdapter itemAdapter = new ItemAdapter();
itemAdapter = new ItemAdapter<>(itemListImpl); fastAdapter = FastAdapter.with(itemAdapter); fastAdapter.withSelectable(true);
final ItemAdapter<SimpleItem> headerAdapter = new ItemAdapter<>(); ItemAdapter<SimpleItem> itemAdapter = new ItemAdapter<>();
final ItemAdapter headerAdapter = new ItemAdapter(); mAdapter = new MopubFastItemAdapter<>(); mAdapter.addAdapter(0, headerAdapter);
mItemAdapter = new ItemAdapter<>();
mItemAdapter = new ItemAdapter<>();