@Test public void testNotifyDataSetActionSelectedWithoutRegisteredListeners() { final DataSetListeners listeners = new DataSetListeners(mock(DataSet.class)); listeners.notifyDataSetActionSelected(0, 0, null); }
public boolean notifyDataSetActionSelected(final int action, final int position, final Object payload) { if (actionListeners != null && !actionListeners.isEmpty()) { final long itemId = dataSet.getItemId(position); for (final OnDataSetActionListener listener : actionListeners) { if (listener.onDataSetActionSelected(action, position, itemId, payload)) { return true; } } } return false; }
DataSetListeners { public boolean notifyDataSetActionSelected(final int action, final int position, final Object payload) { if (actionListeners != null && !actionListeners.isEmpty()) { final long itemId = dataSet.getItemId(position); for (final OnDataSetActionListener listener : actionListeners) { if (listener.onDataSetActionSelected(action, position, itemId, payload)) { return true; } } } return false; } }
DataSetListeners { public boolean notifyDataSetActionSelected(final int action, final int position, final Object payload) { if (actionListeners != null && !actionListeners.isEmpty()) { final long itemId = dataSet.getItemId(position); for (final OnDataSetActionListener listener : actionListeners) { if (listener.onDataSetActionSelected(action, position, itemId, payload)) { return true; } } } return false; } DataSetListeners(@NonNull final DataSet dataSet); }
DataSetListeners { public boolean notifyDataSetActionSelected(final int action, final int position, final Object payload) { if (actionListeners != null && !actionListeners.isEmpty()) { final long itemId = dataSet.getItemId(position); for (final OnDataSetActionListener listener : actionListeners) { if (listener.onDataSetActionSelected(action, position, itemId, payload)) { return true; } } } return false; } DataSetListeners(@NonNull final DataSet dataSet); void registerOnDataSetListener(@NonNull final OnDataSetListener listener); void notifyDataSetChanged(); void notifyDataSetInvalidated(); void unregisterOnDataSetListener(@NonNull final OnDataSetListener listener); void registerOnDataSetActionListener(@NonNull final OnDataSetActionListener listener); boolean notifyDataSetActionSelected(final int action, final int position, final Object payload); void unregisterOnDataSetActionListener(@NonNull final OnDataSetActionListener listener); boolean isEmpty(); }
DataSetListeners { public boolean notifyDataSetActionSelected(final int action, final int position, final Object payload) { if (actionListeners != null && !actionListeners.isEmpty()) { final long itemId = dataSet.getItemId(position); for (final OnDataSetActionListener listener : actionListeners) { if (listener.onDataSetActionSelected(action, position, itemId, payload)) { return true; } } } return false; } DataSetListeners(@NonNull final DataSet dataSet); void registerOnDataSetListener(@NonNull final OnDataSetListener listener); void notifyDataSetChanged(); void notifyDataSetInvalidated(); void unregisterOnDataSetListener(@NonNull final OnDataSetListener listener); void registerOnDataSetActionListener(@NonNull final OnDataSetActionListener listener); boolean notifyDataSetActionSelected(final int action, final int position, final Object payload); void unregisterOnDataSetActionListener(@NonNull final OnDataSetActionListener listener); boolean isEmpty();  }