diff --git a/DragAndDropSample/DragAndDropSample.iOS/DragAndDropSample.iOS.csproj b/DragAndDropSample/DragAndDropSample.iOS/DragAndDropSample.iOS.csproj
index 3faf936..977245a 100644
--- a/DragAndDropSample/DragAndDropSample.iOS/DragAndDropSample.iOS.csproj
+++ b/DragAndDropSample/DragAndDropSample.iOS/DragAndDropSample.iOS.csproj
@@ -12,7 +12,7 @@
Resources
DragAndDropSample.iOS
NSUrlSessionHandler
- manual
+ automatic
true
@@ -26,6 +26,11 @@
x86_64
None
true
+ 14.5
+ false
+ false
+ false
+ true
none
@@ -47,9 +52,10 @@
4
false
ARM64
- iPhone Developer
+ Apple Development: Jean-Marie Alfonsi (NVUSN2Q6P2)
true
Entitlements.plist
+ VS: WildCard Development
none
diff --git a/DragAndDropSample/DragAndDropSample.iOS/Info.plist b/DragAndDropSample/DragAndDropSample.iOS/Info.plist
index c51e3bf..b2cd6cc 100644
--- a/DragAndDropSample/DragAndDropSample.iOS/Info.plist
+++ b/DragAndDropSample/DragAndDropSample.iOS/Info.plist
@@ -1,42 +1,42 @@
-
-
- UIDeviceFamily
-
- 1
- 2
-
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- MinimumOSVersion
- 13.2
- CFBundleDisplayName
- DragAndDropSample
- CFBundleIdentifier
- com.sharpnado.DragAndDropSample
- CFBundleVersion
- 1.0
- UILaunchStoryboardName
- LaunchScreen
- CFBundleName
- Sharpnado.DragAndDropCollection.Sample
- XSAppIconAssets
- Assets.xcassets/AppIcon.appiconset
- UIStatusBarStyle
- UIStatusBarStyleLightContent
- UIViewControllerBasedStatusBarAppearance
-
-
+
+ UIDeviceFamily
+
+ 1
+ 2
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ MinimumOSVersion
+ 13.2
+ CFBundleDisplayName
+ Sharpnado HLV
+ CFBundleIdentifier
+ com.sharpnado.hlvsample
+ CFBundleVersion
+ 1.0
+ UILaunchStoryboardName
+ LaunchScreen
+ CFBundleName
+ Sharpnado.DragAndDropCollection.Sample
+ XSAppIconAssets
+ Assets.xcassets/AppIcon.appiconset
+ UIStatusBarStyle
+ UIStatusBarStyleLightContent
+ UIViewControllerBasedStatusBarAppearance
+
+
+
diff --git a/DragAndDropSample/DragAndDropSample/ViewModels/GridPageViewModel.cs b/DragAndDropSample/DragAndDropSample/ViewModels/GridPageViewModel.cs
index a98198d..f09de59 100644
--- a/DragAndDropSample/DragAndDropSample/ViewModels/GridPageViewModel.cs
+++ b/DragAndDropSample/DragAndDropSample/ViewModels/GridPageViewModel.cs
@@ -64,6 +64,10 @@ public int CurrentIndex
public ICommand OnScrollEndCommand { get; private set; }
+ public ICommand OnDragStarted { get; private set; }
+
+ public ICommand OnDragEnded { get; private set; }
+
public TaskLoaderNotifier> SillyPeopleLoaderNotifier { get; }
public ListMode Mode
@@ -102,6 +106,20 @@ private void InitCommands()
() => System.Diagnostics.Debug.WriteLine("SillyInfiniteGridPeopleVm: OnScrollBeginCommand"));
OnScrollEndCommand = new Command(
() => System.Diagnostics.Debug.WriteLine("SillyInfiniteGridPeopleVm: OnScrollEndCommand"));
+
+ OnDragStarted = new Command(
+ (info) =>
+ {
+ var dragInfo = (DragAndDropInfo)info;
+ System.Diagnostics.Debug.WriteLine($"OnDragStarted( from: {dragInfo.From}, to: {dragInfo.To} )");
+ });
+
+ OnDragEnded = new Command(
+ (info) =>
+ {
+ var dragInfo = (DragAndDropInfo)info;
+ System.Diagnostics.Debug.WriteLine($"OnDragEnded( from: {dragInfo.From}, to: {dragInfo.To} )");
+ });
}
private async Task> LoadSillyPeoplePageAsync(int pageNumber, int pageSize, bool isRefresh)
diff --git a/DragAndDropSample/DragAndDropSample/Views/GridPage.xaml b/DragAndDropSample/DragAndDropSample/Views/GridPage.xaml
index 0851c3d..697f117 100644
--- a/DragAndDropSample/DragAndDropSample/Views/GridPage.xaml
+++ b/DragAndDropSample/DragAndDropSample/Views/GridPage.xaml
@@ -127,6 +127,8 @@
CollectionPadding="10,30,10,75"
ColumnCount="2"
CurrentIndex="{Binding CurrentIndex}"
+ DragAndDropEndedCommand="{Binding OnDragEnded}"
+ DragAndDropStartedCommand="{Binding OnDragStarted}"
DragAndDropTrigger="Pan"
EnableDragAndDrop="{Binding Source={x:Reference DragAndDropSwitch}, Path=IsToggled}"
InfiniteListLoader="{Binding SillyPeoplePaginator}"
diff --git a/Sharpnado.HorizontalListView.Droid/Renderers/HorizontalList/AndroidHorizontalListViewRenderer.DragAnDropItemTouchHelperCallback.cs b/Sharpnado.HorizontalListView.Droid/Renderers/HorizontalList/AndroidHorizontalListViewRenderer.DragAnDropItemTouchHelperCallback.cs
index dc09b52..9ed8c1b 100644
--- a/Sharpnado.HorizontalListView.Droid/Renderers/HorizontalList/AndroidHorizontalListViewRenderer.DragAnDropItemTouchHelperCallback.cs
+++ b/Sharpnado.HorizontalListView.Droid/Renderers/HorizontalList/AndroidHorizontalListViewRenderer.DragAnDropItemTouchHelperCallback.cs
@@ -86,6 +86,11 @@ public override void OnSelectedChanged(RecyclerView.ViewHolder viewHolder, int a
draggableViewCell.IsDragAndDropping = true;
_draggedViewCell = draggableViewCell;
}
+
+ _onDragAndDropStart?.Execute(new DragAndDropInfo(
+ viewHolder.AdapterPosition,
+ -1,
+ ((ViewHolder)viewHolder).BindingContext));
}
else if (actionState == ItemTouchHelper.ActionStateIdle)
{
@@ -122,14 +127,9 @@ public override bool OnMove(
_to = target.AdapterPosition;
- // System.Diagnostics.Debug.WriteLine($">>>>> OnMove( from: {viewHolder.AdapterPosition}, to: {target.AdapterPosition} )");
+ // System.Diagnostics.Debug.WriteLine($">>>>> OnMove( from: {_from}, to: {_to} )");
_recycleViewAdapter.OnItemMoving(viewHolder.AdapterPosition, target.AdapterPosition);
- _onDragAndDropStart?.Execute(new DragAndDropInfo(
- _from,
- _to,
- ((ViewHolder)viewHolder).BindingContext));
-
return true;
}
diff --git a/Sharpnado.HorizontalListView.sln b/Sharpnado.HorizontalListView.sln
index d4844d3..7fb721b 100644
--- a/Sharpnado.HorizontalListView.sln
+++ b/Sharpnado.HorizontalListView.sln
@@ -5,9 +5,9 @@ VisualStudioVersion = 16.0.30621.155
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sharpnado.HorizontalListView", "Sharpnado.HorizontalListView\Sharpnado.HorizontalListView.csproj", "{76625DCB-B2F9-4E7E-AE80-B657AE9D2566}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sharpnado.HorizontalListView.Droid", "Sharpnado.HorizontalListView.Droid\Sharpnado.HorizontalListView.Droid.csproj", "{5C880A51-9E8A-42A9-9FA5-10BC7D3E9FFC}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sharpnado.HorizontalListView.Droid", "Sharpnado.HorizontalListView.Droid\Sharpnado.HorizontalListView.Droid.csproj", "{92E0ECFC-C8C0-4C03-BA61-A2701390D7DE}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sharpnado.HorizontalListView.iOS", "Sharpnado.HorizontalListView.iOS\Sharpnado.HorizontalListView.iOS.csproj", "{E71F3053-056C-4381-9638-048ED73BDFF6}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sharpnado.HorizontalListView.iOS", "Sharpnado.HorizontalListView.iOS\Sharpnado.HorizontalListView.iOS.csproj", "{798BAFAE-13C4-4E85-A62A-E535403411FE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{8CB48033-BE95-414B-9B59-16038B284788}"
EndProject
@@ -42,21 +42,21 @@ Global
{76625DCB-B2F9-4E7E-AE80-B657AE9D2566}.Release|Any CPU.Build.0 = Release|Any CPU
{76625DCB-B2F9-4E7E-AE80-B657AE9D2566}.Release|iPhone.ActiveCfg = Release|Any CPU
{76625DCB-B2F9-4E7E-AE80-B657AE9D2566}.Release|iPhone.Build.0 = Release|Any CPU
- {5C880A51-9E8A-42A9-9FA5-10BC7D3E9FFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5C880A51-9E8A-42A9-9FA5-10BC7D3E9FFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5C880A51-9E8A-42A9-9FA5-10BC7D3E9FFC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {5C880A51-9E8A-42A9-9FA5-10BC7D3E9FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5C880A51-9E8A-42A9-9FA5-10BC7D3E9FFC}.Release|Any CPU.Build.0 = Release|Any CPU
- {5C880A51-9E8A-42A9-9FA5-10BC7D3E9FFC}.Release|iPhone.ActiveCfg = Release|Any CPU
- {5C880A51-9E8A-42A9-9FA5-10BC7D3E9FFC}.Release|iPhone.Build.0 = Release|Any CPU
- {E71F3053-056C-4381-9638-048ED73BDFF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E71F3053-056C-4381-9638-048ED73BDFF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E71F3053-056C-4381-9638-048ED73BDFF6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
- {E71F3053-056C-4381-9638-048ED73BDFF6}.Debug|iPhone.Build.0 = Debug|Any CPU
- {E71F3053-056C-4381-9638-048ED73BDFF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E71F3053-056C-4381-9638-048ED73BDFF6}.Release|Any CPU.Build.0 = Release|Any CPU
- {E71F3053-056C-4381-9638-048ED73BDFF6}.Release|iPhone.ActiveCfg = Release|Any CPU
- {E71F3053-056C-4381-9638-048ED73BDFF6}.Release|iPhone.Build.0 = Release|Any CPU
+ {92E0ECFC-C8C0-4C03-BA61-A2701390D7DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {92E0ECFC-C8C0-4C03-BA61-A2701390D7DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {92E0ECFC-C8C0-4C03-BA61-A2701390D7DE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {92E0ECFC-C8C0-4C03-BA61-A2701390D7DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {92E0ECFC-C8C0-4C03-BA61-A2701390D7DE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {92E0ECFC-C8C0-4C03-BA61-A2701390D7DE}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {92E0ECFC-C8C0-4C03-BA61-A2701390D7DE}.Release|iPhone.Build.0 = Release|Any CPU
+ {798BAFAE-13C4-4E85-A62A-E535403411FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {798BAFAE-13C4-4E85-A62A-E535403411FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {798BAFAE-13C4-4E85-A62A-E535403411FE}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {798BAFAE-13C4-4E85-A62A-E535403411FE}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {798BAFAE-13C4-4E85-A62A-E535403411FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {798BAFAE-13C4-4E85-A62A-E535403411FE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {798BAFAE-13C4-4E85-A62A-E535403411FE}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {798BAFAE-13C4-4E85-A62A-E535403411FE}.Release|iPhone.Build.0 = Release|Any CPU
{55F41B9B-D1D7-42A3-8E77-A12A42E8A808}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{55F41B9B-D1D7-42A3-8E77-A12A42E8A808}.Debug|Any CPU.Build.0 = Debug|Any CPU
{55F41B9B-D1D7-42A3-8E77-A12A42E8A808}.Debug|iPhone.ActiveCfg = Debug|Any CPU
@@ -75,13 +75,14 @@ Global
{A07EEB14-ECD1-4D9F-8819-FC1B1FC06001}.Release|iPhone.Build.0 = Release|Any CPU
{57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
+ {57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator
{57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Debug|iPhone.ActiveCfg = Debug|iPhone
{57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Debug|iPhone.Build.0 = Debug|iPhone
+ {57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Debug|iPhone.Deploy.0 = Debug|iPhone
{57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
{57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
{57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Release|iPhone.ActiveCfg = Release|iPhone
{57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Release|iPhone.Build.0 = Release|iPhone
- {57551E87-1A59-4AF0-8012-BA65C96BA8DC}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Sharpnado.HorizontalListView/Properties/AssemblyInfo.cs b/Sharpnado.HorizontalListView/Properties/AssemblyInfo.cs
index eb01d52..b5ba401 100644
--- a/Sharpnado.HorizontalListView/Properties/AssemblyInfo.cs
+++ b/Sharpnado.HorizontalListView/Properties/AssemblyInfo.cs
@@ -1,19 +1,19 @@
//------------------------------------------------------------------------------
//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
+// Ce code a été généré par un outil.
+// Version du runtime :4.0.30319.42000
//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
+// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
+// le code est régénéré.
//
//------------------------------------------------------------------------------
-[assembly: System.Reflection.AssemblyVersion("1.8.2")]
-[assembly: System.Reflection.AssemblyFileVersion("1.8.2")]
+[assembly: System.Reflection.AssemblyDescription("Xamarin Forms HorizontalListView, including carousel, vertical and grid layout.")]
[assembly: System.Reflection.AssemblyCompany("Sharpnado")]
[assembly: System.Reflection.AssemblyProduct("Sharpnado.HorizontalListView")]
[assembly: System.Reflection.AssemblyCopyright("Copyright © Sharpnado 2020")]
-[assembly: System.Reflection.AssemblyDescription("Xamarin Forms HorizontalListView, including carousel, vertical and grid layout.")]
+[assembly: System.Reflection.AssemblyFileVersion("1.8.2")]
+[assembly: System.Reflection.AssemblyVersion("1.8.2")]
[assembly: System.Reflection.AssemblyTitle("Sharpnado.HorizontalListView")]
diff --git a/Sharpnado.HorizontalListView/ViewModels/DragAndDropInfo.cs b/Sharpnado.HorizontalListView/ViewModels/DragAndDropInfo.cs
index 0612cc2..559f8e5 100644
--- a/Sharpnado.HorizontalListView/ViewModels/DragAndDropInfo.cs
+++ b/Sharpnado.HorizontalListView/ViewModels/DragAndDropInfo.cs
@@ -2,10 +2,10 @@ namespace Sharpnado.HorizontalListView.ViewModels
{
public class DragAndDropInfo
{
- public DragAndDropInfo(int to, int @from, object content)
+ public DragAndDropInfo(int from, int to, object content)
{
+ From = from;
To = to;
- From = @from;
Content = content;
}