/** * get the adapter (null safe) * * @return the FastAdapter used with this drawer */ protected FastAdapter<IDrawerItem> getAdapter() { if (mAdapter == null) { mAdapter = FastAdapter.with(Arrays.asList(mHeaderAdapter, mItemAdapter, mFooterAdapter), Arrays.<IAdapterExtension<IDrawerItem>>asList(mExpandableExtension)); mAdapter.withSelectable(true); mAdapter.withMultiSelect(false); mAdapter.withAllowDeselection(false); mAdapter.setHasStableIds(mHasStableIds); } return mAdapter; }
/** * creates a new FastAdapter with the provided adapters * if adapters is null, a default ItemAdapter is defined * * @param adapters the adapters which this FastAdapter should use * @return a new FastAdapter */ public static <Item extends IItem, A extends IAdapter> FastAdapter<Item> with(@Nullable Collection<A> adapters) { return with(adapters, null); }
mAdapter = FastAdapter.with(mItemAdapter); mAdapter.withSelectable(true); mAdapter.withAllowDeselection(false);
mFastAdapter = FastAdapter.with(Arrays.asList(headerAdapter, itemAdapter));
mFastAdapter = FastAdapter.with(Arrays.asList(mItemAdapter)); mFastAdapter.withSelectable(true); mFastAdapter.withMultiSelect(true);
fastAdapter = FastAdapter.with(Arrays.asList(itemAdapter)); fastAdapter.withSelectable(true);
mFastAdapter = FastAdapter.with(Arrays.asList(mHeaderAdapter, mItemAdapter), Arrays.<IAdapterExtension<IItem>>asList(mExpandableExtension));
fastAdapter = FastAdapter.with(itemAdapter); fastAdapter.withSelectable(true);
mFastAdapter = FastAdapter.with(mItemAdapter); mFastAdapter.withSelectable(true); mFastAdapter.withMultiSelect(true);
fastAdapter = FastAdapter.with(Arrays.asList(itemAdapter)); fastAdapter.withSelectable(true);
fastAdapter = FastAdapter.with(itemAdapter); fastAdapter.withSelectable(true);
private void initAdapterIfNeeded() { if (mFastAdapter == null || mRecyclerView.getAdapter() == null) { mItemAdapter = ItemAdapter.items(); mFastAdapter = FastAdapter.with(mItemAdapter); mRecyclerView.setAdapter(mFastAdapter); } }
fastAdapter = FastAdapter.with(Arrays.asList(headerAdapter, itemAdapter)); fastAdapter.withSelectable(true);
private void initAdapterIfNeeded() { if (mFastAdapter == null || mRecyclerView.getAdapter() == null) { mItemAdapter = ItemAdapter.items(); mFastAdapter = FastAdapter.with(mItemAdapter); mRecyclerView.setAdapter(mFastAdapter); } }
@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); }
mAdapter = FastAdapter.with(mItemAdapter); mRecyclerView.setAdapter(mAdapter);