Skip to content

Instantly share code, notes, and snippets.

@lucasr
Last active March 5, 2016 03:41
Show Gist options
  • Save lucasr/e7417474278ca0dd7783 to your computer and use it in GitHub Desktop.
Save lucasr/e7417474278ca0dd7783 to your computer and use it in GitHub Desktop.
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
Copy link

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