Skip to content

Commit 2651d56

Browse files
authored
Add doc for 1.8.1 Enable drag and drop animation, iOSDragAndDropOnPanGesture
1 parent fbe800b commit 2651d56

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ https://www.sharpnado.com/paginator-platform-independent/
389389
If you want to have both drag and drop enabled and still be able to tap the item, you need to use the ```TapCommand``` on the `HorizontalListView` instead of the ```xamEffects:Commands.Tap``` on the `DataTemplate` content.
390390
It's less nice since you won't have the nice color ripple, but it will work :)
391391

392-
The only thing you have to do to enable drag and drop is setting `EnableDragAndDrop` to `true`.
392+
The only thing you have to do to enable drag and drop is set `EnableDragAndDrop` to `true`.
393393

394394
The `DragAndDropStartCommand` and `DragAndDropEndedCommand` commands will pass as argument a `DragAndDropInfo` object:
395395

@@ -406,6 +406,40 @@ public class DragAndDropInfo
406406

407407
Contributor: Implemented by @jmmortega.
408408

409+
### Since 1.8.1
410+
411+
`EnableDragAndDrop` is now a bindable property, so you can enable it at runtime.
412+
413+
You can now also specify a custom animation when the `EnableDragAndDrop` is set to ture:
414+
415+
```csharp
416+
HorizontalListView.DragAndDropEnabledAnimationAsync = async (viewCell, token) =>
417+
{
418+
while (!token.IsCancellationRequested)
419+
{
420+
await viewCell.View.RotateTo(8);
421+
await viewCell.View.RotateTo(-8);
422+
}
423+
424+
await viewCell.View.RotateTo(0);
425+
};
426+
```
427+
428+
will result in:
429+
430+
<p align="center">
431+
<img src="Docs/drag_enabled_animation.gif" width="400" />
432+
</p>
433+
434+
You can decide to start the drag without long press on iOS thanks to the iOS specific property `iOSDragAndDropOnPanGesture`:
435+
436+
```xml
437+
<sho:HorizontalListView
438+
...
439+
iOSDragAndDropOnPanGesture="True" />
440+
```
441+
442+
409443
**Remark:** You don't have to inherit from `DraggableViewCell`, any `ViewCell` can be dragged.
410444

411445
### DraggableViewCell

0 commit comments

Comments
 (0)