Skip to content

Instantly share code, notes, and snippets.

@aggarwalpulkit596
Last active February 3, 2020 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aggarwalpulkit596/04ac0a2880b9577333874709f80cf9df to your computer and use it in GitHub Desktop.
Save aggarwalpulkit596/04ac0a2880b9577333874709f80cf9df to your computer and use it in GitHub Desktop.
ItemDetailsLoopup
class MyItemDetailsLookup(private val recyclerView: RecyclerView) :
ItemDetailsLookup<String>() {
override fun getItemDetails(event: MotionEvent): ItemDetails<String>? {
val view = recyclerView.findChildViewUnder(event.x, event.y)
if (view != null) {
return (recyclerView.getChildViewHolder(view) as NotesAdapter.ItemViewHolder).getItemDetails()
}
return null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment