[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetLongPressMinimumHoldingTime")]
public static extern void SetLongPressMinimumHoldingTime(uint time);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetTapMaximumAllowedTime")]
+ public static extern void SetDoubleTapTimeout(uint ms);
}
}
}
/// </summary>
/// <remarks>This is a global configuration option. Affects all gestures.</remarks>
/// <param name="number">The number of touch events</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
public void SetPinchGestureMinimumTouchEventsAfterStart(uint number)
{
Interop.GestureOptions.SetPinchGestureMinimumTouchEventsAfterStart(number);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
-
+ /// <summary>
+ /// Sets the duration in milliseconds between the first tap's up event and the second tap's down event to be recognized as a duoble-tap gesture.
+ /// </summary>
+ /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+ /// <param name="ms">The time value in milliseconds</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetDoubleTapTimeout(uint ms)
+ {
+ Interop.GestureOptions.SetDoubleTapTimeout(ms);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
}
}
frontView = new View
{
Size = new Size(300, 300),
- // Text = "Front View",
Position = new Position(150, 170),
- // PointSize = 11,
BackgroundColor = new Color(1.0f, 0.0f, 0.0f, 1.0f),
};
frontView.TouchEvent += OnFrontTouchEvent;
+
+ // The default the maximum allowed time is 500ms.
+ // If you want to change this time, do as below.
+ // But keep in mind this is a global option. Affects all gestures.
+ GestureOptions.Instance.SetDoubleTapTimeout(300);
tapGestureDetector = new TapGestureDetector();
tapGestureDetector.Attach(frontView);
+ tapGestureDetector.SetMaximumTapsRequired(2);
tapGestureDetector.Detected += (s, e) =>
{
- Tizen.Log.Error("NUI", $"OnTap\n");
+ Tizen.Log.Error("NUI", $"OnTap {e.TapGesture.NumberOfTaps}\n");
};
backView = new TextLabel