Class GestureDetector
Definition
- Assembly:
- Tizen.NUI.dll
GestureDetectors analyses a stream of touch events and attempt to determine the intention of the user.
An view is attached to a gesture detector and if the detector recognises a pattern in its analysis, it will
trigger a detected event to the application.
This is the base class for different gesture detectors available and provides functionality that is common to all the gesture detectors.
public class GestureDetector : BaseHandle, IDynamicResourceHandler, INameScope, System.IDisposable
- Inheritance
- Derived
- Implements
-
System.IDisposable
Constructors
View SourceGestureDetector()
Constructor. Creates an uninitialized GestureDetector.
Declaration
public GestureDetector()
GestureDetector(GestureDetector)
The copy Constructor.
Declaration
public GestureDetector(GestureDetector handle)
Parameters
| Type | Name | Description |
|---|---|---|
| GestureDetector | handle | A reference to the copied handle |
Methods
View SourceAttach(View)
Attaches an view to the gesture. The detected event will be triggered when the gesture occurs on the attached view.
Declaration
public void Attach(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The view to attach to the gesture detector |
CancelAllOtherGestureDetectors()
Cancels all other gesture detectors that are currently recognizing gestures by HandleEvent(View view, Touch touch) api
Declaration
public void CancelAllOtherGestureDetectors()
Detach(View)
Detaches the attached view from the gesture detector.
Declaration
public void Detach(View view)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The view to detach from the gesture detector |
DetachAll()
Detaches all the views that have been attached to the gesture detector.
Declaration
public void DetachAll()
GetAttachedView(uint)
Returns an view by index. An empty handle if the index is not valid.
Declaration
public View GetAttachedView(uint index)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | index | The attached view's index |
Returns
| Type | Description |
|---|---|
| View | The attached view or an empty handle |
GetAttachedViewCount()
Returns the number of views attached to the gesture detector.
Declaration
public uint GetAttachedViewCount()
Returns
| Type | Description |
|---|---|
| uint | The count |
HandleEvent(View, Touch)
Handles the event for a given view and touch input. This method should only be called when SetGeometryHittestEnabled is set to true. It processes the touch input and attempts to recognize gestures based on the provided view and touch data.
Declaration
public bool HandleEvent(View view, Touch touch)
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The view associated with the gesture detector. |
| Touch | touch | The touch input data to analyze for gestures. |
Returns
| Type | Description |
|---|---|
| bool | True if the event was handled successfully, otherwise false. |
ReleaseSwigCPtr(HandleRef)
Declaration
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.InteropServices.HandleRef | swigCPtr |