Create a gist now

Instantly share code, notes, and snippets.

Using ItemClickSupport from TwoWayView
ItemClickSupport itemClick = ItemClickSupport.addTo(recyclerView);
itemclick.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(RecyclerView p, View c, int pos, long id) {
...
}
});
itemClick.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(RecyclerView p, View c, int pos, long id) {
...
}
});
@danksky
danksky commented Jul 19, 2015

Would love to see how OnItemClickListener could be implemented as an object. For instance,
itemClick.setOnItemClickListener(myItemClickListener);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment