[NUI] GestureOptions Binding
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 20 Jul 2021 04:41:12 +0000 (13:41 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 3 Aug 2021 01:50:50 +0000 (10:50 +0900)
src/Tizen.NUI/src/internal/Interop/Interop.GestureOptions.cs [new file with mode: 0644]
src/Tizen.NUI/src/public/Events/GestureOptions.cs [new file with mode: 0644]
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TouchGestureSample.cs

diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.GestureOptions.cs b/src/Tizen.NUI/src/internal/Interop/Interop.GestureOptions.cs
new file mode 100644 (file)
index 0000000..8bc01ac
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Tizen.NUI
+{
+    internal static partial class Interop
+    {
+        internal static partial class GestureOptions
+        {
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGesturePredictionMode")]
+            public static extern void SetPanGesturePredictionMode(int mode);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGesturePredictionAmount")]
+            public static extern void SetPanGesturePredictionAmount(uint amount);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureMaximumPredictionAmount")]
+            public static extern void SetPanGestureMaximumPredictionAmount(uint amount);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureMinimumPredictionAmount")]
+            public static extern void SetPanGestureMinimumPredictionAmount(uint amount);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGesturePredictionAmountAdjustment")]
+            public static extern void SetPanGesturePredictionAmountAdjustment(uint amount);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureSmoothingMode")]
+            public static extern void SetPanGestureSmoothingMode(int mode);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureSmoothingAmount")]
+            public static extern void SetPanGestureSmoothingAmount(float jaamountrg1);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureUseActualTimes")]
+            public static extern void SetPanGestureUseActualTimes(bool enable);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureInterpolationTimeRange")]
+            public static extern void SetPanGestureInterpolationTimeRange(int range);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureScalarOnlyPredictionEnabled")]
+            public static extern void SetPanGestureScalarOnlyPredictionEnabled(bool enable);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureTwoPointPredictionEnabled")]
+            public static extern void SetPanGestureTwoPointPredictionEnabled(bool enable);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureTwoPointInterpolatePastTime")]
+            public static extern void SetPanGestureTwoPointInterpolatePastTime(int time);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureTwoPointVelocityBias")]
+            public static extern void SetPanGestureTwoPointVelocityBias(float velocity);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureTwoPointAccelerationBias")]
+            public static extern void SetPanGestureTwoPointAccelerationBias(float acceleration);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureMultitapSmoothingRange")]
+            public static extern void SetPanGestureMultitapSmoothingRange(int range);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureMinimumDistance")]
+            public static extern void SetPanGestureMinimumDistance(int distance);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPanGestureMinimumPanEvents")]
+            public static extern void SetPanGestureMinimumPanEvents(int number);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPinchGestureMinimumDistance")]
+            public static extern void SetPinchGestureMinimumDistance(float distance);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPinchGestureMinimumTouchEvents")]
+            public static extern void SetPinchGestureMinimumTouchEvents(uint number);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetPinchGestureMinimumTouchEventsAfterStart")]
+            public static extern void SetPinchGestureMinimumTouchEventsAfterStart(uint number);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetRotationGestureMinimumTouchEvents")]
+            public static extern void SetRotationGestureMinimumTouchEvents(uint number);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetRotationGestureMinimumTouchEventsAfterStart")]
+            public static extern void SetRotationGestureMinimumTouchEventsAfterStart(uint number);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GestureOptions_SetLongPressMinimumHoldingTime")]
+            public static extern void SetLongPressMinimumHoldingTime(uint time);
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/public/Events/GestureOptions.cs b/src/Tizen.NUI/src/public/Events/GestureOptions.cs
new file mode 100644 (file)
index 0000000..9272fbf
--- /dev/null
@@ -0,0 +1,331 @@
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using Tizen.NUI.BaseComponents;
+using System.ComponentModel;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// This is a calss that sets the configuration options of Gestures
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public sealed class GestureOptions
+    {
+        private static readonly GestureOptions instance = new GestureOptions();
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        private GestureOptions()
+        {
+        }
+
+        /// <summary>
+        /// Gets the singleton of the GestureOptions object.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static GestureOptions Instance
+        {
+            get
+            {
+                return instance;
+            }
+        }
+
+        /// <summary>
+        /// Sets the prediction mode for pan gestures <br />
+        ///    * 0 - No prediction <br />
+        ///    * 1 - Prediction using average acceleration <br />
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="mode">The prediction mode</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGesturePredictionMode(int mode)
+        {
+            Interop.GestureOptions.SetPanGesturePredictionMode(mode);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the prediction amount of the pan gesture
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="amount">The prediction amount in milliseconds</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGesturePredictionAmount(uint amount)
+        {
+            Interop.GestureOptions.SetPanGesturePredictionAmount(amount);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the upper bound of the prediction amount for clamping
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="amount">The prediction amount in milliseconds</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureMaximumPredictionAmount(uint amount)
+        {
+            Interop.GestureOptions.SetPanGestureMaximumPredictionAmount(amount);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        ///  Sets the lower bound of the prediction amount for clamping
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="amount">The prediction amount in milliseconds</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureMinimumPredictionAmount(uint amount)
+        {
+            Interop.GestureOptions.SetPanGestureMinimumPredictionAmount(amount);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the amount of prediction interpolation to adjust when the pan velocity is changed
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="amount">The prediction amount in milliseconds</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGesturePredictionAmountAdjustment(uint amount)
+        {
+            Interop.GestureOptions.SetPanGesturePredictionAmountAdjustment(amount);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Called to set the prediction mode for pan gestures <br />
+        ///    * Valid modes: <br />
+        ///    * 0 - No smoothing <br />
+        ///    * 1 - average between last 2 values <br />
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="mode">The prediction mode</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureSmoothingMode(int mode)
+        {
+            Interop.GestureOptions.SetPanGestureSmoothingMode(mode);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the smoothing amount of the pan gesture
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="amount">The smotthing amount from 0.0f (none) to 1.0f (full)</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureSmoothingAmount(float amount)
+        {
+            Interop.GestureOptions.SetPanGestureSmoothingAmount(amount);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets whether to use actual times of the real gesture and frames or not.
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="enable">True = use actual times, False = use perfect values</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureUseActualTimes(bool enable)
+        {
+            Interop.GestureOptions.SetPanGestureUseActualTimes(enable);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the interpolation time range (ms) of past points to use (with weights) when interpolating.
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="range">Time range in ms</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureInterpolationTimeRange(int range)
+        {
+            Interop.GestureOptions.SetPanGestureInterpolationTimeRange(range);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets whether to use scalar only prediction, which when enabled, ignores acceleration.
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="enable">True = use scalar prediction only</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureScalarOnlyPredictionEnabled(bool enable)
+        {
+            Interop.GestureOptions.SetPanGestureScalarOnlyPredictionEnabled(enable);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets whether to use two point prediction. This combines two interpolated points to get more steady acceleration and velocity values.
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="enable">True = use two point prediction</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureTwoPointPredictionEnabled(bool enable)
+        {
+            Interop.GestureOptions.SetPanGestureTwoPointPredictionEnabled(enable);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the time in the past to interpolate the second point when using two point interpolation.
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="time">Time in past in ms</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureTwoPointInterpolatePastTime(int time)
+        {
+            Interop.GestureOptions.SetPanGestureTwoPointInterpolatePastTime(time);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the two point velocity bias. This is the ratio of first and second points to use for velocity.
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="velocity">0.0f = 100% first point. 1.0f = 100% of second point.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureTwoPointVelocityBias(float velocity)
+        {
+            Interop.GestureOptions.SetPanGestureTwoPointVelocityBias(velocity);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the two point acceleration bias. This is the ratio of first and second points to use for acceleration.
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="acceleration">0.0f = 100% first point. 1.0f = 100% of second point.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureTwoPointAccelerationBias(float acceleration)
+        {
+            Interop.GestureOptions.SetPanGestureTwoPointAccelerationBias(acceleration);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the range of time (ms) of points in the history to perform multitap smoothing with (if enabled).
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="range">Time in past in ms</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureMultitapSmoothingRange(int range)
+        {
+            Interop.GestureOptions.SetPanGestureMultitapSmoothingRange(range);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the minimum distance required to start a pan event
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="distance">Distance in pixels</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureMinimumDistance(int distance)
+        {
+            Interop.GestureOptions.SetPanGestureMinimumDistance(distance);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the minimum number of touch events required to start a pan
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="number">Number of touch events</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPanGestureMinimumPanEvents(int number)
+        {
+            Interop.GestureOptions.SetPanGestureMinimumPanEvents(number);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the minimum distance required to start a pinch event
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="distance">Distance in pixels</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetPinchGestureMinimumDistance(int distance)
+        {
+            Interop.GestureOptions.SetPinchGestureMinimumDistance(distance);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the minimum touch events required before a pinch can be started
+        /// </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 SetPinchGestureMinimumTouchEvents(uint number)
+        {
+            Interop.GestureOptions.SetPinchGestureMinimumTouchEvents(number);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the minimum touch events required after a pinch started
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="number">The number of touch events</param>
+        public void SetPinchGestureMinimumTouchEventsAfterStart(uint number)
+        {
+            Interop.GestureOptions.SetPinchGestureMinimumTouchEventsAfterStart(number);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the minimum touch events required before a rotation can be started
+        /// </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 SetRotationGestureMinimumTouchEvents(uint number)
+        {
+            Interop.GestureOptions.SetRotationGestureMinimumTouchEvents(number);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the minimum touch events required after a rotation started
+        /// </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 SetRotationGestureMinimumTouchEventsAfterStart(uint number)
+        {
+            Interop.GestureOptions.SetRotationGestureMinimumTouchEventsAfterStart(number);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Sets the minimum holding time required to be recognized as a long press gesture
+        /// </summary>
+        /// <remarks>This is a global configuration option. Affects all gestures.</remarks>
+        /// <param name="time">The time value in milliseconds</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetLongPressMinimumHoldingTime(uint time)
+        {
+            Interop.GestureOptions.SetLongPressMinimumHoldingTime(time);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+
+    }
+}
index e956f00..0ef323a 100755 (executable)
@@ -9,14 +9,10 @@ namespace Tizen.NUI.Samples
     public class TouchGestureSample : IExample
     {
         private View root;
-        GestureDetectorManager mGestureDetector;
-        private TextLabel frontView;
+        private View frontView;
         private TextLabel backView;
-
-        public void ChangeText()
-        {
-            backView.Text = "From OnTap BackView";
-        }
+        private TapGestureDetector tapGestureDetector;
+        private LongPressGestureDetector longPressGestureDetector;
 
         public void Activate()
         {
@@ -24,16 +20,21 @@ namespace Tizen.NUI.Samples
             root = new View();
 
 
-           frontView = new TextLabel
+           frontView = new View
             {
                 Size = new Size(300, 300),
-                Text = "Front View",
+                // Text = "Front View",
                 Position = new Position(150, 170),
-                PointSize = 11,
+                // PointSize = 11,
                 BackgroundColor = new Color(1.0f, 0.0f, 0.0f, 1.0f),
             };
             frontView.TouchEvent += OnFrontTouchEvent;
-
+            tapGestureDetector = new TapGestureDetector();
+            tapGestureDetector.Attach(frontView);
+            tapGestureDetector.Detected += (s, e) =>
+            {
+              Tizen.Log.Error("NUI", $"OnTap\n");
+            };
 
             backView = new TextLabel
             {
@@ -43,12 +44,21 @@ namespace Tizen.NUI.Samples
                 PointSize = 11,
                 BackgroundColor = new Color(1.0f, 1.0f, 0.0f, 1.0f),
             };
-
-            mGestureDetector = new GestureDetectorManager(backView, new MyGestureListener());
             backView.TouchEvent += OnBackTouchEvent;
 
-            backView.Add(frontView);
+            // The default the minimum holding 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.SetLongPressMinimumHoldingTime(300);
+
+            longPressGestureDetector = new LongPressGestureDetector();
+            longPressGestureDetector.Attach(backView);
+            longPressGestureDetector.Detected += (s, e) =>
+            {
+              Tizen.Log.Error("NUI", $"OnLongPress\n");
+            };
 
+            backView.Add(frontView);
             root.Add(backView);
             window.Add(root);
         }
@@ -56,45 +66,16 @@ namespace Tizen.NUI.Samples
         private bool OnFrontTouchEvent(object source, View.TouchEventArgs e)
         {
             Tizen.Log.Error("NUI", $"OnFrontTouchEvent {e.Touch.GetState(0)}\n");
-            return true;
+            return false;
         }
 
 
         private bool OnBackTouchEvent(object source, View.TouchEventArgs e)
         {
             Tizen.Log.Error("NUI", $"OnBackTouchEvent {e.Touch.GetState(0)}\n");
-            mGestureDetector.FeedTouchEvent(source, e, this);
             return false;
         }
 
-        class MyGestureListener : GestureDetectorManager.GestureListener
-        {
-          public override void OnTap(object sender, TapGestureDetector.DetectedEventArgs e, object userData)
-          {
-            Tizen.Log.Error("NUI", $"OnTap \n");
-            if(userData != null)
-            {
-              TouchGestureSample sample = (TouchGestureSample) userData;
-              sample.ChangeText();
-            }
-          }
-
-          public override void OnPan(object sender, PanGestureDetector.DetectedEventArgs e, object userData)
-          {
-            Tizen.Log.Error("NUI", $"OnPan \n");
-          }
-
-          public override void OnPinch(object sender, PinchGestureDetector.DetectedEventArgs e, object userData)
-          {
-            Tizen.Log.Error("NUI", $"OnPinch \n");
-          }
-
-          public override void OnLongPress(object sender, LongPressGestureDetector.DetectedEventArgs e, object userData)
-          {
-            Tizen.Log.Error("NUI", $"OnLongPress \n");
-          }
-        }
-
         public void Deactivate()
         {
             if (root != null)