roubachof / Sharpnado.CollectionView

A performant list view supporting: grid, horizontal and vertical layout, drag and drop, and reveal animations.
The Unlicense
244 stars 30 forks source link

Implemented dragging without longpress + drag direction #23

Closed themronion closed 3 years ago

themronion commented 3 years ago

1) Changed iOSDragAndDropOnPanGesture property to DragAndDropImmediately 2) Added HorizontalListViewMovementDirection enum and a bindable MovementDirection property

themronion commented 3 years ago

With PR like that I will retire soon :)

No, please don't. We need you and your libs!) Check it out. Haven't turned on my mac to test on ios after the changes, but should be fine

themronion commented 3 years ago

Also i was thinking of an elegant way how to leave the long press on the whole cell, but activate the pan only when the user clicks a concrete handler ( see #22), but couldn't figure it out. Any thoughts? If u have an idea i have the time to try it

roubachof commented 3 years ago

Looks good now :) Now I just need to find time to test it x)

themronion commented 3 years ago

Looks good now :) Now I just need to find time to test it x)

Don't hurry) i am using a "pirate" nuget from my branch on my project)

jws2103 commented 3 years ago

Hi @roubachof , What is the ETA to get this merged and published? I'd like to see the same behaviour for both iOS and Android. My requirement is to enable the drag and drop mode after long press and hold, which only works for iOS at the moment.

Jay

themronion commented 3 years ago

Hi @roubachof , What is the ETA to get this merged and published? I'd like to see the same behaviour for both iOS and Android. My requirement is to enable the drag and drop mode after long press and hold, which only works for iOS at the moment.

Jay

Hey Jay, while @roubachof is busy i can share with you my "pirate" nuget

jws2103 commented 3 years ago

Hi @roubachof , What is the ETA to get this merged and published? I'd like to see the same behaviour for both iOS and Android. My requirement is to enable the drag and drop mode after long press and hold, which only works for iOS at the moment. Jay

Hey Jay, while @roubachof is busy i can share with you my "pirate" nuget

Hi @themronion , Yes please. I will need your change for my project. Kind regards, Jay

jws2103 commented 3 years ago

Hi @roubachof , What is the ETA to get this merged and published? I'd like to see the same behaviour for both iOS and Android. My requirement is to enable the drag and drop mode after long press and hold, which only works for iOS at the moment. Jay

Hey Jay, while @roubachof is busy i can share with you my "pirate" nuget

Hi @themronion , Yes please. I will need your change for my project. Kind regards, Jay

@themronion , One quick question regarding the change, When you set DragAndDropTrigger to Pan, does it disable the scrolling for Android? Or do you have to disable it at the same time through the property binding?

Regards, Jay

themronion commented 3 years ago

@jws2103 i disable it manually. Actually a nice question, i haven't tested how it works with scrolling. Here you are: Sharpnado.Forms.HorizontalListView.1.8.2.nupkg.zip

jws2103 commented 3 years ago

Hi @themronion ,

Thank you for your nuget above.

I've found the issue in the sample after installing the package from the file you shared.

  1. Long press and hold to enable EnableDragAndDrop

Expected result: The drag and drop is activated with the pan gesture Actual result: It just scrolls through and the drag and drop isn't functional even if EnableDragAndDrop is true

Here's the link to the sample the issue occurs. https://drive.google.com/file/d/1GViNxfqDFRMuloeiTF_8l-rFqyqW3vuM/view?usp=sharing Would you please help resolve this?

Kind regards, Jay

themronion commented 3 years ago

@jws2103 create a separate project and install my nuget there

jws2103 commented 3 years ago

@jws2103 create a separate project and install my nuget there

@themronion, the sample I've shared is from your forked repository, which means all changes from the nuget you shared should be there. Do you still want me to install your nuget?

jws2103 commented 3 years ago

@themronion , our requirement has been changed as the long press hold to enable the drag & drop is breaking other features of the plugin for Android. I think your change works good and looking forward to be merged

roubachof commented 3 years ago

time to test

roubachof commented 3 years ago

working great so far ;)

roubachof commented 3 years ago

@themronion would you be interested in making a blog post on Sharpnado about your PR ?

themronion commented 3 years ago

Nah, i am on vacation now) I think this pr is not so huge to make a post about it)

roubachof commented 3 years ago

yup small changes but it's interesting to write about the whole process:

Always interesting for people that hesitate to make a pr :)

themronion commented 3 years ago

Can i answer briefly, so you can then put that info in the post? If yes then: 1) Sharpnado HLV is really the one and only open source plugin out here in the web that supports drag and drop. Unfortunately the XF team didn't prioritize the drag and drop support in a CollectionView so here comes the mighty Sharpnado :D 2) Our project is a taxi app and one of our requirements was to make a reorderable route. We have a list of points and we had to make them draggable and reorderable. After reordering the price is recalculated and the route is changed. We were satisfied with the current implementation that HLV provide, but decided to make it even more flexible when it comes to drag and dropping. Since the list of our route points has only one function (to be reordered) we decided why should we wait for the drag to start on Android. So we (i) implemented the Pan DragAndDropTrigger on Android. We went further and decided - since it is a vertical list the user must only drag vertically - hence i implemented the DragAndDropDirection. 3) That's an easy one. I am the only Xamarin programmer on my team, so who else? :)

Hope that will be enough)

roubachof commented 3 years ago

yeah of course ! Ty for the info, it's always interesting to see the use cases :)