@Test public void removeButtonShouldRemoveRowAndCallCallback() { final WaypointEntry entry = MockUtils.mockWayPointEntry(); getFirstViewHolder(new ArrayList<>(Collections.singletonList(entry))); assertThat(mWaypointsListViewHolder.getRemovableView().getVisibility(), equalTo(View.VISIBLE)); mWaypointsListViewHolder.getRemovableView() .performClick(); assertThat(mIsCallbackCalled, is(true)); assertThat(mWaypointListAdapter.getItemCount(), equalTo(0)); }
@Override public int getItemCount() { return mWaypointEntryList.size(); }
WaypointListAdapter extends RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder> { @Override public int getItemCount() { return mWaypointEntryList.size(); } }
WaypointListAdapter extends RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder> { @Override public int getItemCount() { return mWaypointEntryList.size(); } WaypointListAdapter(@NonNull final List<WaypointEntry> entries); }
WaypointListAdapter extends RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder> { @Override public int getItemCount() { return mWaypointEntryList.size(); } WaypointListAdapter(@NonNull final List<WaypointEntry> entries); @Override void onAttachedToRecyclerView(final RecyclerView recyclerView); @Override int getItemCount(); @Override WaypointsListViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType); @Override void onBindViewHolder(final WaypointsListViewHolder holder, final int position); void setListener(final WaypointList.Listener listener); }
WaypointListAdapter extends RecyclerView.Adapter<WaypointListAdapter.WaypointsListViewHolder> { @Override public int getItemCount() { return mWaypointEntryList.size(); } WaypointListAdapter(@NonNull final List<WaypointEntry> entries); @Override void onAttachedToRecyclerView(final RecyclerView recyclerView); @Override int getItemCount(); @Override WaypointsListViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType); @Override void onBindViewHolder(final WaypointsListViewHolder holder, final int position); void setListener(final WaypointList.Listener listener);  }