Class PanGestureDetector
Definition
- Assembly:
- Tizen.NUI.dll
This class emits a signals when a pan gesture occurs.
public class PanGestureDetector : GestureDetector, IDynamicResourceHandler, INameScope, System.IDisposable
- Inheritance
- Implements
-
System.IDisposable
Constructors
View SourcePanGestureDetector()
Creates an initialized PanGestureDetector.
Declaration
public PanGestureDetector()
PanGestureDetector(PanGestureDetector)
The copy constructor.
Declaration
public PanGestureDetector(PanGestureDetector handle)
Parameters
Type | Name | Description |
---|---|---|
PanGestureDetector | handle | A reference to the copied handle |
Properties
View SourceDefaultThreshold
The default threshold is PI * 0.25 radians (or 45 degrees).
Declaration
public static Radian DefaultThreshold { get; }
Property Value
Type | Description |
---|---|
Radian |
DirectionDown
For a down pan (0.5 * PI Radians).
Declaration
public static Radian DirectionDown { get; }
Property Value
Type | Description |
---|---|
Radian |
DirectionHorizontal
For a left and right pan (PI Radians). Useful for AddDirection().
Declaration
public static Radian DirectionHorizontal { get; }
Property Value
Type | Description |
---|---|
Radian |
DirectionLeft
For a left pan (-PI Radians).
Declaration
public static Radian DirectionLeft { get; }
Property Value
Type | Description |
---|---|
Radian |
DirectionRight
For a right pan (0 Radians).
Declaration
public static Radian DirectionRight { get; }
Property Value
Type | Description |
---|---|
Radian |
DirectionUp
For an up pan (-0.5 * PI Radians).
Declaration
public static Radian DirectionUp { get; }
Property Value
Type | Description |
---|---|
Radian |
DirectionVertical
For an up and down pan (-0.5 * PI Radians). Useful for AddDirection().
Declaration
public static Radian DirectionVertical { get; }
Property Value
Type | Description |
---|---|
Radian |
LocalDisplacement
Retrieves the local displacement
Declaration
public Vector2 LocalDisplacement { get; }
Property Value
Type | Description |
---|---|
Vector2 |
LocalPosition
Retrieves the local position.
Declaration
public Vector2 LocalPosition { get; }
Property Value
Type | Description |
---|---|
Vector2 |
LocalVelocity
Retrieves the local velocity.
Declaration
public Vector2 LocalVelocity { get; }
Property Value
Type | Description |
---|---|
Vector2 |
Panning
Retrieves the panning flag.
Declaration
public bool Panning { get; }
Property Value
Type | Description |
---|---|
bool |
ScreenDisplacement
Retrieves the screen displacement.
Declaration
public Vector2 ScreenDisplacement { get; }
Property Value
Type | Description |
---|---|
Vector2 |
ScreenPosition
Retrieves the screen position.
Declaration
public Vector2 ScreenPosition { get; }
Property Value
Type | Description |
---|---|
Vector2 |
ScreenVelocity
Retrieves the screen velocity.
Declaration
public Vector2 ScreenVelocity { get; }
Property Value
Type | Description |
---|---|
Vector2 |
Methods
View SourceAddAngle(Radian, Radian)
The pan gesture is only emitted if the pan occurs in the direction specified by this method with a +/- threshold allowance.
If an angle of 0.0 degrees is specified and the threshold is 45 degrees then the acceptable direction range is from -45 to 45 degrees.
The angle added using this API is only checked when the gesture first starts, after that, this detector will emit the gesture regardless of what angle the pan is moving.
The user can add as many angles as they require.
Declaration
public void AddAngle(Radian angle, Radian threshold)
Parameters
Type | Name | Description |
---|---|---|
Radian | angle | The angle that pan should be allowed |
Radian | threshold | The threshold around that angle |
AddAngle(Radian)
The pan gesture is only emitted if the pan occurs in the direction specified by this method with a +/- threshold allowance. The default threshold (PI * 0.25) is used.
The angle added using this API is only checked when the gesture first starts, after that, this detector will emit the gesture regardless of what angle the pan is moving.
The user can add as many angles as they require.
Declaration
public void AddAngle(Radian angle)
Parameters
Type | Name | Description |
---|---|---|
Radian | angle | The angle that pan should be allowed |
AddDirection(Radian, Radian)
A helper method for adding bi-directional angles where the pan should take place.
In other words, if 0 is requested, then PI will also be added so that we have both left and right scrolling.
Declaration
public void AddDirection(Radian direction, Radian threshold)
Parameters
Type | Name | Description |
---|---|---|
Radian | direction | The direction of panning required |
Radian | threshold | The threshold |
AddDirection(Radian)
A helper method for adding bi-directional angles where the pan should take place.
In other words, if 0 is requested, then PI will also be added so that we have both left and right scrolling.
The default threshold (PI * 0.25) is used.
Declaration
public void AddDirection(Radian direction)
Parameters
Type | Name | Description |
---|---|---|
Radian | direction | The direction of panning required |
ClearAngles()
Clears any directional angles that are used by the gesture detector.
Declaration
public void ClearAngles()
Dispose(DisposeTypes)
override it to clean-up your own resources.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type |
Overrides
View SourceGetAngleCount()
Returns the count of angles that this pan gesture detector emits a signal.
Declaration
public uint GetAngleCount()
Returns
Type | Description |
---|---|
uint | The gesture detector has been initialized. |
GetMaximumMotionEventAge()
Retrieves the maximum age for the pan gesture motion as milliseconds.
Declaration
public uint GetMaximumMotionEventAge()
Returns
Type | Description |
---|---|
uint | The maximum age of motion events as milliseconds |
GetMaximumTouchesRequired()
Retrieves the maximum number of touches required for the pan gesture to be detected.
Declaration
public uint GetMaximumTouchesRequired()
Returns
Type | Description |
---|---|
uint | The maximum touches required |
GetMinimumTouchesRequired()
Retrieves the minimum number of touches required for the pan gesture to be detected.
Declaration
public uint GetMinimumTouchesRequired()
Returns
Type | Description |
---|---|
uint | The minimum touches required |
ReleaseSwigCPtr(HandleRef)
Declaration
protected override void ReleaseSwigCPtr(Runtime.InteropServices.HandleRef swigCPtr)
Parameters
Type | Name | Description |
---|---|---|
Tizen.System.Runtime.InteropServices.HandleRef | swigCPtr |
Overrides
View SourceRemoveAngle(Radian)
Removes the angle specified from the container. This will only remove the first instance of the angle found from the container.
Declaration
public void RemoveAngle(Radian angle)
Parameters
Type | Name | Description |
---|---|---|
Radian | angle | The angle to remove |
RemoveDirection(Radian)
Removes the two angles that make up the direction from the container.
Declaration
public void RemoveDirection(Radian direction)
Parameters
Type | Name | Description |
---|---|---|
Radian | direction | The direction to remove |
SetMaximumMotionEventAge(uint)
Set a maximum duration of motion event that is able to live on the pan gesture event queue. If duration exceed it, the motion event is discarded.
Declaration
public void SetMaximumMotionEventAge(uint maximumAgeMilliSecond)
Parameters
Type | Name | Description |
---|---|---|
uint | maximumAgeMilliSecond | Maximum age of motion events as milliseconds |
SetMaximumTouchesRequired(uint)
This is the maximum number of touches required for the pan gesture to be detected.
Declaration
public void SetMaximumTouchesRequired(uint maximum)
Parameters
Type | Name | Description |
---|---|---|
uint | maximum | Maximum touches required |
SetMinimumTouchesRequired(uint)
This is the minimum number of touches required for the pan gesture to be detected.
Declaration
public void SetMinimumTouchesRequired(uint minimum)
Parameters
Type | Name | Description |
---|---|---|
uint | minimum | Minimum touches required |
SetPanGestureProperties(PanGesture)
Allows setting of the pan properties that are returned in constraints.
Declaration
public static void SetPanGestureProperties(PanGesture pan)
Parameters
Type | Name | Description |
---|---|---|
PanGesture | pan | The pan gesture to set |
Events
View SourceDetected
This signal is emitted when the specified pan is detected on the attached view.
Declaration
public event DaliEventHandler<object, PanGestureDetector.DetectedEventArgs> Detected
Event Type
Type | Description |
---|---|
DaliEventHandler<object, PanGestureDetector.DetectedEventArgs> |