@Test public void onBindViewHolderTest() { adapter.unRegisterAllItemBinders(); adapter.registerItemBinders(headerBinder, testItemBinder, commentBinder); when(headerViewHolder.getItemViewType()).thenReturn(0); when(testItemViewHolder.getItemViewType()).thenReturn(1); when(commentViewHolder.getItemViewType()).thenReturn(2); adapter.onBindViewHolder(headerViewHolder, 0); verify(headerBinder).bindViewHolder(headerViewHolder, null); adapter.onBindViewHolder(testItemViewHolder, 11); verify(testItemBinder).bindViewHolder(testItemViewHolder, null); adapter.onBindViewHolder(commentViewHolder, 51); verify(commentBinder).bindViewHolder(commentViewHolder, null); }
@RestrictTo(RestrictTo.Scope.LIBRARY) @Override public final void onBindViewHolder(@NonNull ItemViewHolder holder, int adapterPosition) { onBindViewHolder(holder, adapterPosition, new ArrayList<>()); }
MultiViewAdapter extends RecyclerView.Adapter<ItemViewHolder> { @RestrictTo(RestrictTo.Scope.LIBRARY) @Override public final void onBindViewHolder(@NonNull ItemViewHolder holder, int adapterPosition) { onBindViewHolder(holder, adapterPosition, new ArrayList<>()); } }
MultiViewAdapter extends RecyclerView.Adapter<ItemViewHolder> { @RestrictTo(RestrictTo.Scope.LIBRARY) @Override public final void onBindViewHolder(@NonNull ItemViewHolder holder, int adapterPosition) { onBindViewHolder(holder, adapterPosition, new ArrayList<>()); } MultiViewAdapter();   MultiViewAdapter(SpanSizeLookup spanSizeLookup, Cache spanSizeCache, Cache positionTypeCache,
      Cache viewTypeCache); }
MultiViewAdapter extends RecyclerView.Adapter<ItemViewHolder> { @RestrictTo(RestrictTo.Scope.LIBRARY) @Override public final void onBindViewHolder(@NonNull ItemViewHolder holder, int adapterPosition) { onBindViewHolder(holder, adapterPosition, new ArrayList<>()); } MultiViewAdapter();   MultiViewAdapter(SpanSizeLookup spanSizeLookup, Cache spanSizeCache, Cache positionTypeCache,
      Cache viewTypeCache); @SuppressWarnings("ConstantConditions") void addSection(@NonNull Section section); void clearAllSelections(); void collapseAllItems(); void collapseAllSections(); RecyclerView.ItemDecoration getItemDecoration(); ItemTouchHelper getItemTouchHelper(); @PositionType int getPositionType(RecyclerView parent, int adapterPosition); SectionPositionType getSectionPositionType(int adapterPosition); GridLayoutManager.SpanSizeLookup getSpanSizeLookup(); void registerItemBinders(ItemBinder... itemBinders); void removeAllSections(); void setExpansionMode(@NonNull Mode expansionMode); void setInfiniteLoadingHelper(@NonNull InfiniteLoadingHelper infiniteLoadingHelper); void setSectionExpansionMode(Mode sectionExpansionMode); void setSelectionMode(Mode selectionMode); void setSpanCount(int spanCount); void startActionMode(); void stopActionMode(); void unRegisterAllItemBinders(); @RestrictTo(RestrictTo.Scope.LIBRARY) final int getSpanSize(int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void drawDecoration(@NonNull Canvas canvas, @NonNull RecyclerView parent,
      @NonNull RecyclerView.State state, View child, int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void drawDecorationOver(@NonNull Canvas canvas, @NonNull RecyclerView parent,
      @NonNull RecyclerView.State state, View child, int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void getDecorationOffset(@NonNull Rect outRect, @NonNull View view,
      @NonNull RecyclerView parent, @NonNull RecyclerView.State state, int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void onItemDismiss(int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void onMove(int initialPosition, int targetPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) @Override @NonNull final ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType); @RestrictTo(RestrictTo.Scope.LIBRARY) @Override final void onBindViewHolder(@NonNull ItemViewHolder holder, int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) @SuppressWarnings("unchecked") @Override final void onBindViewHolder(ItemViewHolder holder, int adapterPosition,
      @NonNull List<Object> payloads); @RestrictTo(RestrictTo.Scope.LIBRARY) @Override final int getItemViewType(int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) @Override final int getItemCount(); }
MultiViewAdapter extends RecyclerView.Adapter<ItemViewHolder> { @RestrictTo(RestrictTo.Scope.LIBRARY) @Override public final void onBindViewHolder(@NonNull ItemViewHolder holder, int adapterPosition) { onBindViewHolder(holder, adapterPosition, new ArrayList<>()); } MultiViewAdapter();   MultiViewAdapter(SpanSizeLookup spanSizeLookup, Cache spanSizeCache, Cache positionTypeCache,
      Cache viewTypeCache); @SuppressWarnings("ConstantConditions") void addSection(@NonNull Section section); void clearAllSelections(); void collapseAllItems(); void collapseAllSections(); RecyclerView.ItemDecoration getItemDecoration(); ItemTouchHelper getItemTouchHelper(); @PositionType int getPositionType(RecyclerView parent, int adapterPosition); SectionPositionType getSectionPositionType(int adapterPosition); GridLayoutManager.SpanSizeLookup getSpanSizeLookup(); void registerItemBinders(ItemBinder... itemBinders); void removeAllSections(); void setExpansionMode(@NonNull Mode expansionMode); void setInfiniteLoadingHelper(@NonNull InfiniteLoadingHelper infiniteLoadingHelper); void setSectionExpansionMode(Mode sectionExpansionMode); void setSelectionMode(Mode selectionMode); void setSpanCount(int spanCount); void startActionMode(); void stopActionMode(); void unRegisterAllItemBinders(); @RestrictTo(RestrictTo.Scope.LIBRARY) final int getSpanSize(int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void drawDecoration(@NonNull Canvas canvas, @NonNull RecyclerView parent,
      @NonNull RecyclerView.State state, View child, int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void drawDecorationOver(@NonNull Canvas canvas, @NonNull RecyclerView parent,
      @NonNull RecyclerView.State state, View child, int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void getDecorationOffset(@NonNull Rect outRect, @NonNull View view,
      @NonNull RecyclerView parent, @NonNull RecyclerView.State state, int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void onItemDismiss(int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) final void onMove(int initialPosition, int targetPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) @Override @NonNull final ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType); @RestrictTo(RestrictTo.Scope.LIBRARY) @Override final void onBindViewHolder(@NonNull ItemViewHolder holder, int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) @SuppressWarnings("unchecked") @Override final void onBindViewHolder(ItemViewHolder holder, int adapterPosition,
      @NonNull List<Object> payloads); @RestrictTo(RestrictTo.Scope.LIBRARY) @Override final int getItemViewType(int adapterPosition); @RestrictTo(RestrictTo.Scope.LIBRARY) @Override final int getItemCount();  }