{"id":13713084,"url":"https://github.com/softlion/XamarinFormsGesture","last_synced_at":"2025-05-06T23:30:32.986Z","repository":{"id":136903895,"uuid":"79249323","full_name":"softlion/XamarinFormsGesture","owner":"softlion","description":"Xamarin Form Gesture Effects","archived":false,"fork":false,"pushed_at":"2024-03-11T13:33:25.000Z","size":374,"stargazers_count":77,"open_issues_count":0,"forks_count":15,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-03T00:11:11.499Z","etag":null,"topics":["android","double-tap","gesture","ios","long-press","swipe","tap","uwp","xamarin-forms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softlion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-17T16:48:29.000Z","updated_at":"2025-03-26T14:25:27.000Z","dependencies_parsed_at":"2024-11-14T00:15:27.139Z","dependency_job_id":null,"html_url":"https://github.com/softlion/XamarinFormsGesture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlion%2FXamarinFormsGesture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlion%2FXamarinFormsGesture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlion%2FXamarinFormsGesture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlion%2FXamarinFormsGesture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softlion","download_url":"https://codeload.github.com/softlion/XamarinFormsGesture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252787165,"owners_count":21804209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","double-tap","gesture","ios","long-press","swipe","tap","uwp","xamarin-forms"],"created_at":"2024-08-02T23:01:27.206Z","updated_at":"2025-05-06T23:30:32.327Z","avatar_url":"https://github.com/softlion.png","language":"C#","funding_links":[],"categories":["UI"],"sub_categories":[],"readme":"# New version for MAUI here: https://github.com/vapolia/MauiGestures/\n\n### Below is version for Xamarin.Forms\n\n[![Build status](https://ci.appveyor.com/api/projects/status/8t8m8n0do3p0304n?svg=true)](https://ci.appveyor.com/project/softlion/xamarinformsgesture)\n\n[![NuGet](https://img.shields.io/nuget/v/Vapolia.XamarinFormsGesture.svg?style=for-the-badge)](https://www.nuget.org/packages/Vapolia.XamarinFormsGesture/)  \n[![NuGet](https://img.shields.io/nuget/vpre/Vapolia.XamarinFormsGesture.svg?style=for-the-badge)](https://www.nuget.org/packages/Vapolia.XamarinFormsGesture/)  \n![Nuget](https://img.shields.io/nuget/dt/Vapolia.XamarinFormsGesture)\n\n# Supported Platforms\n\niOS, Android, UWP\n\n# Xamarin Form Gesture Effects\n\nAdd \"advanced\" gestures to Xamarin Forms. Available on all views.\nMost gesture commands include the event position.\n\n```xaml\n    \u003cLabel Text=\"Click here\" IsEnabled=\"True\" ui:Gesture.TapCommand=\"{Binding OpenLinkCommand}\" /\u003e\n```\nOr in code:\n```csharp\n    var label = new Label();\n    Vapolia.Lib.Ui.Gesture.SetTapCommand(label, new Command(() =\u003e { /*your code*/ }));\n```\n\n# Quick start\nAdd the above nuget package to your Xamarin Forms project (only the netstandard one is enough).\n\nIn your platform projects (android,ios,uwp), before initializing xamarin forms, call `Vapolia.Lib.Effects.PlatformGestureEffect.Init();` to force the discovery of this extension by the Xamarin Forms plugin engine.\n\nThe views on which the gesture is applied should have the property **IsEnabled=\"True\"** and **InputTransparent=\"False\"** which activates user interaction on them.\n\n# Examples\n\nAdd Gesture.TapCommand on any supported xaml view:\n```xaml\n        \u003cStackLayout ui:Gesture.TapCommand=\"{Binding OpenLinkCommand}\"\u003e\n            \u003cLabel Text=\"1.Tap this to open an url\"  /\u003e\n        \u003c/StackLayout\u003e\n```\nDeclare the corresponding namespace:\n```xaml\n    \u003cContentPage xmlns=\"http://xamarin.com/schemas/2014/forms\"\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n             ...\n             xmlns:ui=\"clr-namespace:Vapolia.Lib.Ui;assembly=XamarinFormsGesture\"\n    \u003e\n```\nAnd in the viewmodel:\n   ```csharp     \n    public Command OpenLinkCommand =\u003e new Command(() =\u003e\n    {\n        //do something\n    });\n```\n# Supported Gestures\n\n *  `TapCommand (ICommand)`\n *  `DoubleTapCommand (ICommand)`\n *  `PanCommand (ICommand)`\n *  `LongPressCommand (ICommand)`\n *  `TapPointCommand (ICommand or Command\u003cPoint\u003e)` where point is the absolute tap position relative to the view\n *  `DoubleTapPoinCommand (ICommand or Command\u003cPoint\u003e)` where point is the absolute double tap position relative to the view\n *  `PanPointCommand (ICommand or Command\u003cPanEventArgs\u003e)` where point is the absolute position relative to the view\n *  `LongPressPointCommand (ICommand or Command\u003cPoint\u003e) ` where point is the absolute tap position relative to the view\n *  `SwipeLeftCommand`\n *  `SwipeRightCommand`\n *  `SwipeTopCommand`\n *  `SwipeBottomCommand`\n *  `PinchCommand (Command\u003cPinchEventArgs\u003e)` where `PinchEventArg` contains `StartingPoints`, `CurrentPoints`, `Center`, `Scale`, `RotationRadians`, `RotationDegrees`, `Status`\n \n Properties:\n \n * `IsPanImmediate` Set to true to receive the PanCommand or PanPointCommand event on touch down, instead of after a minimum move distance. Default to false.\n \n# Examples\n\n## Somme commands in XAML\n\n```xml\n\u003cStackLayout ui:Gesture.TapCommand=\"{Binding OpenCommand}\" IsEnabled=\"True\"\u003e\n    \u003cLabel Text=\"1.Tap this text to open an url\" /\u003e\n\u003c/StackLayout\u003e\n\n\u003cStackLayout ui:Gesture.DoubleTapPointCommand=\"{Binding OpenPointCommand}\" IsEnabled=\"True\"\u003e\n    \u003cLabel Text=\"2.Double tap this text to open an url\" /\u003e\n\u003c/StackLayout\u003e\n\n\u003cBoxView\n    ui:Gesture.PanPointCommand=\"{Binding PanPointCommand}\"\n    HeightRequest=\"200\" WidthRequest=\"300\"\n    InputTransparent=\"False\"\n    IsEnabled=\"True\"\n     /\u003e\n```\n\nIn the viewmodel:\n\n```csharp\npublic ICommand OpenCommand =\u003e new Command(async () =\u003e\n{\n   //...\n});\n\npublic ICommand OpenPointCommand =\u003e new Command\u003cPointEventArgs\u003e(point =\u003e\n{\n    PanX = point.X;\n    PanY = point.Y;\n    //...\n});\n\npublic ICommand PanPointCommand =\u003e new Command\u003cPanEventArgs\u003e(args =\u003e\n{\n    var point = args.Point;\n    PanX = point.X;\n    PanY = point.Y;\n    //...\n});\n\n``` \n\n## Exemple in C# on a Grid containing an horizontal slider (set value on tap)\n\n```csharp\n//Tap anywhere to set value\nGesture.SetTapPointCommand(this, new Command\u003cPointEventArgs\u003e(pt =\u003e\n{\n    var delta = (pt.X - Padding.Left) / (Width - Padding.Left - Padding.Right);\n    if(delta\u003c0 || delta\u003e1)\n        return;\n    Value = (int)Math.Round((Maximum - Minimum) * delta);\n}));\n```\n        \n\n# Limitations\n\nOnly commands are supported (PR welcome for events). No .NET events. \nSo you must use the MVVM pattern (https://developer.xamarin.com/guides/xamarin-forms/xaml/xaml-basics/data_bindings_to_mvvm/).\n\nSwipe commands are not supported on UWP due to a bug (event not received). If you find it, notify me!\nPinchCommand is not supported (yet) on UWP. PR welcome.\n\nIf your command is not receiving events, make sure that:\n- you used the correct handler. Ie: the `LongPressPointCommand` should be `new Command\u003cPointEventArgs\u003e(pt =\u003e ...)`\n- you set IsEnabled=\"True\" and InputTransparent=\"False\" on the element\n\nUWP requires fall creator update  \n\n# Breaking changes\n\nVersion 3.3.3 has breaking changes:\n- Point commands now gives a `PointEventArgs` instead of a Point. ie: `Command\u003cPointEventArgs\u003e`\n- Initialization namespace is unified across platforms: `Vapolia.Lib.Effects.PlatformGestureEffect.Init();`\n\nVersion 3.3.0 has breaking changes:  \n- Command names have changed\n- PanPointCommand returns an absolute position, not a relative position anymore. It also returns the gesture state. The gesture can also be cancelled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftlion%2FXamarinFormsGesture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftlion%2FXamarinFormsGesture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftlion%2FXamarinFormsGesture/lists"}