mirror of
https://github.com/AdrianKuta/Unbound-Drag-Drop.git
synced 2025-12-15 13:08:05 +01:00
Update README.md
This commit is contained in:
12
README.md
12
README.md
@@ -61,7 +61,7 @@ class MyDragDropCallback : DragDropHelper.Callback() {
|
||||
}
|
||||
```
|
||||
|
||||
#### Step2: Attach `DragDropHelper` to `RecyclerView`
|
||||
#### Step 2: Attach `DragDropHelper` to `RecyclerView`
|
||||
|
||||
In your Activity or Fragment, attach DragDropHelper to your RecyclerView.
|
||||
|
||||
@@ -71,6 +71,16 @@ val dragDropHelper = DragDropHelper(MyDragDropCallback())
|
||||
dragDropHelper.attachToRecyclerView(recyclerView)
|
||||
```
|
||||
|
||||
#
|
||||
### Step 3: Enable long click
|
||||
|
||||
Dragging is enabled only for views with long click enabled. To allow dragging and dropping of RecyclerView items, you need to set isLongClickable to true for each RecyclerView item.
|
||||
|
||||
```kotlin
|
||||
viewHolder.itemView.isLongClickable = true
|
||||
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
See example in `app` module.
|
||||
|
||||
Reference in New Issue
Block a user