Detecting rotate gestures

A common gesture for manipulating objects on the screen is to use the twist or rotate gesture. This is often more natural than entering a rotation value or dragging a cursor.

How to do it...

Another multifinger gesture that is very common is the rotate gesture. For a two-finger rotate, we can do something very similar to what we would do when implementing the ScaleGestureDetector instance. However, we do have to create a RotateGestureDetector instance ourselves as this is not currently provided by the framework. We will create RotateGestureDetector by preforming the following steps:

  1. First, we need an interface that represents our gesture detector's events:
    public interface IOnRotateGestureListener { bool OnRotateBegin(RotateGestureDetector ...

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.