Responding to custom user gestures
There are other types of gestures that the user can perform, such as drawing letters or other shapes. These gestures may be more complex than a twist or drag, so we cannot just rely on simple finger tracking, but rather we need shape recognition.
How to do it...
We can store, recognize, and visualize shape gestures using a GestureLibrary
instance:
- We access a particular
GestureLibrary
by requesting one through theGestureLibraries
type:GestureLibrary library = GestureLibraries.FromPrivateFile(this, "gestures");
- When we want to load the gestures, or refresh the library, we invoke the
Load()
method:library.Load();
- Then, we can list all the gestures in the library using the
GestureEntries
property:string[] entries = ...
Get Xamarin Mobile Development for Android Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.