Skip to content

Commit b7962d0

Browse files
committed
Update README.md
1 parent df6a255 commit b7962d0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Compose LazyList reorder
2+
23
[![](https://jitpack.io/v/aclassen/ComposeReorderable.svg)](https://jitpack.io/#aclassen/ComposeReorderable)
34

45
A Jetpack Compose modifier enabling reordering in a LazyList.
@@ -19,7 +20,6 @@ dependencies {
1920
}
2021
```
2122

22-
2323
## How to use
2424

2525
Add a `Reorderable` to your composition:
@@ -53,8 +53,8 @@ Make an item reorderable by adding at least one drag modifier to the item:
5353
Modifier.detectReorderAfterLongPress(state, { item.key })
5454
```
5555

56-
57-
If you want to use a non keyed item list `detectReorder` and `detectReorderAfterLongPress` will not work , use the `detectListReorder` modifier instead.
56+
If you want to use a non keyed item list `detectReorder` and `detectReorderAfterLongPress` will not work , use the `detectListReorder`
57+
modifier instead.
5858

5959
Add this modifier to your LazyList , this will make the items reorderable after long press.
6060

@@ -67,11 +67,14 @@ LazyRow(
6767
)
6868
```
6969

70-
Use `draggedItem` for a default dragged effect or create your own.
70+
Use the item index, instead of the key , to find the offset `state.offsetOf(idx)`
71+
72+
You can use `draggedItem` for a default dragged effect or create your own.
7173

7274
## Notes
73-
When dragging, the existing item will be modified.
74-
Because if this reason it`s important that the item must be part of the LazyList visible items all the time.
75+
76+
When dragging, the existing item will be modified. Because if this reason it`s important that the item must be part of the LazyList visible
77+
items all the time.
7578

7679
This can be problematic if no drop target can be found during scrolling.
7780

0 commit comments

Comments
 (0)