/** * removes all items of this adapter */ public FastAdapterDialog<Item> clear() { mItemAdapter.clear(); return this; } }
/** * removes all items of this adapter */ public FastAdapterBottomSheetDialog<Item> clear() { mItemAdapter.clear(); return this; } }
/** * removes all items of this adapter */ public FastItemAdapter<Item> clear() { getItemAdapter().clear(); return this; }
@Test public void clear() throws Exception { itemAdapter.set(TestDataGenerator.genTestItemList(100)); assertThat(itemAdapter.getAdapterItemCount()).isEqualTo(100); itemAdapter.clear(); assertThat(itemAdapter.getAdapterItemCount()).isEqualTo(0); }
@Test public void clear() throws Exception { itemAdapter.set(TestDataGenerator.genTestItemList(100)); assertThat(itemAdapter.getAdapterItemCount()).isEqualTo(100); itemAdapter.clear(); assertThat(itemAdapter.getAdapterItemCount()).isEqualTo(0); }
@Override protected void onPostExecute(String s) { //remove loader mItemAdapter.clear(); //Add the header if (builder.aboutShowIcon != null && (builder.aboutShowVersion != null || builder.aboutShowVersionName != null || builder.aboutShowVersionCode)) { //add this cool thing to the headerView of our listView mItemAdapter.add(new HeaderItem().withLibsBuilder(builder).withAboutVersionName(versionName).withAboutVersionCode(versionCode).withAboutIcon(icon)); } //add the libs List<LibraryItem> libraryItems = new ArrayList<>(); for (Library library : libraries) { libraryItems.add(new LibraryItem().withLibrary(library).withLibsBuilder(builder)); } mItemAdapter.add(libraryItems); super.onPostExecute(s); //finished loading if (LibsConfiguration.getInstance().getLibTaskCallback() != null) { LibsConfiguration.getInstance().getLibTaskCallback().onLibTaskFinished(mItemAdapter); } //forget the context ctx = null; } }
mItemAdapter.clear();