@Test public void getItemViewType_Should_UseLayoutIdAsViewType() { int viewType = adapter.getItemViewType(EXISTING_BINDER_ITEM_POSITION); assertSame(itemBinder.getLayoutId(), viewType); }
@Override public int getItemViewType(int position) { return getBinder(items.get(position)).getLayoutId(); }
WitchRecyclerViewAdapter extends RecyclerView.Adapter<EmptyViewHolder> { @Override public int getItemViewType(int position) { return getBinder(items.get(position)).getLayoutId(); } }
WitchRecyclerViewAdapter extends RecyclerView.Adapter<EmptyViewHolder> { @Override public int getItemViewType(int position) { return getBinder(items.get(position)).getLayoutId(); } WitchRecyclerViewAdapter(List<Item> items, List<Binder<? extends Item>> binders);  WitchRecyclerViewAdapter(List<Binder<? extends Item>> binders); }
WitchRecyclerViewAdapter extends RecyclerView.Adapter<EmptyViewHolder> { @Override public int getItemViewType(int position) { return getBinder(items.get(position)).getLayoutId(); } WitchRecyclerViewAdapter(List<Item> items, List<Binder<? extends Item>> binders);  WitchRecyclerViewAdapter(List<Binder<? extends Item>> binders); @Override int getItemViewType(int position); @Override @NonNull EmptyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType); @Override void onBindViewHolder(@NonNull EmptyViewHolder emptyViewHolder, int position); @Override int getItemCount(); List<Item> getItems(); void setItems(List<Item> items); }
WitchRecyclerViewAdapter extends RecyclerView.Adapter<EmptyViewHolder> { @Override public int getItemViewType(int position) { return getBinder(items.get(position)).getLayoutId(); } WitchRecyclerViewAdapter(List<Item> items, List<Binder<? extends Item>> binders);  WitchRecyclerViewAdapter(List<Binder<? extends Item>> binders); @Override int getItemViewType(int position); @Override @NonNull EmptyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType); @Override void onBindViewHolder(@NonNull EmptyViewHolder emptyViewHolder, int position); @Override int getItemCount(); List<Item> getItems(); void setItems(List<Item> items);  }