This NuGet library provides touch event notifications for Android and iOS via Xamarin.Forms.Effect mechanism as shown in one of the xamarin samples.
The code is copied from https://github.com/xamarin/xamarin-forms-samples/tree/master/Effects/TouchTrackingEffect and adapted to be used as a separate library. Xamarin explains how it works at https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/effects/touch-tracking.
Original copyright is owned by Xamarin Inc (see LICENSE and NOTICE).
public class App : Application
{
public App()
{
var label = new Label()
{
Text = "Touch Me",
Margin = new Thickness(20, 50),
};
var touchEffect = new TouchEffect();
touchEffect.TouchAction += (s, e) => label.Text = e.Type.ToString("f");
label.Effects.Add(touchEffect);
MainPage = new ContentPage()
{
Content = label
};
}
}
This project can be built using Visual Studio for Mac or Cake. It is recommended that you build this project by invoking the boostrap script:
./build.sh
There are a number of optional arguments that can be provided to the bootstrapper that will be parsed and passed on to Cake itself. See the Cake build file in order to identify all supported parameters.
./build.sh \
--task=Build \
--projectName=Float.XFormsTouch \
--configuration=Debug \
--nugetUrl=https://nuget.org \
--nugetToken=####
All content in this repository is shared under an Apache 2.0 license. See license.md for details.