@Test public void onCreateViewHolder_withProgressViewType_returnsLoadingViewHolder() { final RecyclerView.ViewHolder viewHolder = adapter.onCreateViewHolder(mock(ViewGroup.class), AccomplishmentListAdapter.RowType.PROGRESS); assertThat(viewHolder).isInstanceOf(LoadingViewHolder.class); }
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case RowType.ITEM: return createItemViewHolder(parent); case RowType.PROGRESS: { return createProgressViewHolder(parent); } default: { throw new IllegalArgumentException(String.valueOf(viewType)); } } }
AccomplishmentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case RowType.ITEM: return createItemViewHolder(parent); case RowType.PROGRESS: { return createProgressViewHolder(parent); } default: { throw new IllegalArgumentException(String.valueOf(viewType)); } } } }
AccomplishmentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case RowType.ITEM: return createItemViewHolder(parent); case RowType.PROGRESS: { return createProgressViewHolder(parent); } default: { throw new IllegalArgumentException(String.valueOf(viewType)); } } } AccomplishmentListAdapter(@NonNull String imageUrlPrefix, @NonNull Listener listener); }
AccomplishmentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case RowType.ITEM: return createItemViewHolder(parent); case RowType.PROGRESS: { return createProgressViewHolder(parent); } default: { throw new IllegalArgumentException(String.valueOf(viewType)); } } } AccomplishmentListAdapter(@NonNull String imageUrlPrefix, @NonNull Listener listener); void setSharingEnabled(boolean enableSharing); @Override RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType); @Override int getItemViewType(int position); @Override void onBindViewHolder(RecyclerView.ViewHolder holder, int position); @Override int getItemCount(); void setItems(@NonNull List<BadgeAssertion> newItems); void setPageLoading(boolean visible); }
AccomplishmentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { switch (viewType) { case RowType.ITEM: return createItemViewHolder(parent); case RowType.PROGRESS: { return createProgressViewHolder(parent); } default: { throw new IllegalArgumentException(String.valueOf(viewType)); } } } AccomplishmentListAdapter(@NonNull String imageUrlPrefix, @NonNull Listener listener); void setSharingEnabled(boolean enableSharing); @Override RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType); @Override int getItemViewType(int position); @Override void onBindViewHolder(RecyclerView.ViewHolder holder, int position); @Override int getItemCount(); void setItems(@NonNull List<BadgeAssertion> newItems); void setPageLoading(boolean visible);  }