@Test public void testSanityCount() throws Exception { assertEquals(adapter.getItemCount(), 100); }
@Override public int getItemCount() { if (!isActiveCursor()) return 0; return cursor.getCount() + getFastAccessSize() + (hasHeaderView() ? 1 : 0) + (hasFooterView() ? 1 : 0); }
CursorRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public int getItemCount() { if (!isActiveCursor()) return 0; return cursor.getCount() + getFastAccessSize() + (hasHeaderView() ? 1 : 0) + (hasFooterView() ? 1 : 0); } }
CursorRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public int getItemCount() { if (!isActiveCursor()) return 0; return cursor.getCount() + getFastAccessSize() + (hasHeaderView() ? 1 : 0) + (hasFooterView() ? 1 : 0); } protected  CursorRecyclerViewAdapter(@NonNull Context context, @Nullable Cursor cursor); }
CursorRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public int getItemCount() { if (!isActiveCursor()) return 0; return cursor.getCount() + getFastAccessSize() + (hasHeaderView() ? 1 : 0) + (hasFooterView() ? 1 : 0); } protected  CursorRecyclerViewAdapter(@NonNull Context context, @Nullable Cursor cursor); @Nullable Cursor getCursor(); void setHeaderView(@Nullable View header); View getHeaderView(); void setFooterView(@Nullable View footer); boolean hasHeaderView(); boolean hasFooterView(); void changeCursor(Cursor cursor); Cursor swapCursor(Cursor newCursor); @Override int getItemCount(); int getCursorCount(); @SuppressWarnings("unchecked") @Override final void onViewRecycled(@NonNull ViewHolder holder); void onItemViewRecycled(VH holder); @Override @NonNull final ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType); abstract VH onCreateItemViewHolder(ViewGroup parent, int viewType); @Override final void onBindViewHolder(@NonNull ViewHolder viewHolder, int position, @NonNull List<Object> payloads); @SuppressWarnings("unchecked") @Override final void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position); abstract void onBindItemViewHolder(VH viewHolder, @NonNull Cursor cursor); @Override final int getItemViewType(int position); int getItemViewType(@NonNull Cursor cursor); @Override final long getItemId(int position); long getItemId(@NonNull Cursor cursor); }
CursorRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { @Override public int getItemCount() { if (!isActiveCursor()) return 0; return cursor.getCount() + getFastAccessSize() + (hasHeaderView() ? 1 : 0) + (hasFooterView() ? 1 : 0); } protected  CursorRecyclerViewAdapter(@NonNull Context context, @Nullable Cursor cursor); @Nullable Cursor getCursor(); void setHeaderView(@Nullable View header); View getHeaderView(); void setFooterView(@Nullable View footer); boolean hasHeaderView(); boolean hasFooterView(); void changeCursor(Cursor cursor); Cursor swapCursor(Cursor newCursor); @Override int getItemCount(); int getCursorCount(); @SuppressWarnings("unchecked") @Override final void onViewRecycled(@NonNull ViewHolder holder); void onItemViewRecycled(VH holder); @Override @NonNull final ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType); abstract VH onCreateItemViewHolder(ViewGroup parent, int viewType); @Override final void onBindViewHolder(@NonNull ViewHolder viewHolder, int position, @NonNull List<Object> payloads); @SuppressWarnings("unchecked") @Override final void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position); abstract void onBindItemViewHolder(VH viewHolder, @NonNull Cursor cursor); @Override final int getItemViewType(int position); int getItemViewType(@NonNull Cursor cursor); @Override final long getItemId(int position); long getItemId(@NonNull Cursor cursor);  }