Skip to content

Commit cb321ad

Browse files
authored
Update README.md
1 parent 3b59fb7 commit cb321ad

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,14 @@ Use your adapter in an Activity or Fragment:
229229
val adapter = YourAdapter()
230230
binding.recyclerView.adapter = adapter
231231
adapter.submitList(yourList)
232-
adapter.setOnItemClickListener {
233-
// Do something
232+
233+
// `view` is the specific View within the item layout that was clicked.
234+
// This allows you to perform actions or access properties of the clicked View directly.
235+
adapter.setOnItemClickListener { item, view ->
236+
// Do something with item or view
237+
}
238+
adapter.setOnItemLongClickListener { item, view ->
239+
// Do something with item or view
234240
}
235241
```
236242

0 commit comments

Comments
 (0)