@Test public void getItemCount() { adapter.setItems(Arrays.asList(new BadgeAssertion(), new BadgeAssertion(), new BadgeAssertion())); adapter.setPageLoading(false); assertThat(adapter.getItemCount()).isEqualTo(3); adapter.setPageLoading(true); assertThat(adapter.getItemCount()).isEqualTo(4); }
@Override public int getItemCount() { return items.size() + (isProgressVisible ? 1 : 0); }
AccomplishmentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public int getItemCount() { return items.size() + (isProgressVisible ? 1 : 0); } }
AccomplishmentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public int getItemCount() { return items.size() + (isProgressVisible ? 1 : 0); } AccomplishmentListAdapter(@NonNull String imageUrlPrefix, @NonNull Listener listener); }
AccomplishmentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public int getItemCount() { return items.size() + (isProgressVisible ? 1 : 0); } 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 int getItemCount() { return items.size() + (isProgressVisible ? 1 : 0); } 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);  }