/** * Constructor of an adapter for a list of items to bind and display in a recyclerView * * @param itemsList List of items */ public ItemsListAdapter(final List<ListItem> itemsList, final ImageLoader imageLoader, final Function4<View, String, String, String, Void> itemClick) { mItemsList = itemsList; mImageLoader = imageLoader; mItemClick = itemClick; }
void setClickAction(final Function4<View, String, String, String, Void> itemClick, final String id, final String title, @Nullable final String imageUrl) { itemView.setOnClickListener(view -> { try { itemClick.apply(view, id, title, imageUrl); } catch (final Exception e) { Timber.e(e); } }); }
/** * Matches when all observable sequences have an available * element and projects the elements by invoking the selector function. * * @param <R> the result type * @param selector * the function that will be invoked for elements in the source sequences. * @return the plan for the matching * @throws NullPointerException * if selector is null */ public <R> Plan<R> then(Function4<T1, T2, T3, T4, R> selector) { if (selector == null) { throw new NullPointerException(); } return new Plan4<T1, T2, T3, T4, R>(this, selector); }