From 3eab8626242e24670286bcd6515134999d57cbda Mon Sep 17 00:00:00 2001 From: JoogabYun <40262755+JoogabYun@users.noreply.github.com> Date: Thu, 29 Oct 2020 15:52:38 +0900 Subject: [PATCH] [NUI] Add DisallowInterceptTouchEvent (#2109) If child view doesn't want the parent's view to intercept the touch, you can set it to true. for example : parent.Add(child); parent.InterceptTouchEvent += OnInterceptTouchEvent; View view = child.GetParent() as View; view.DisallowInterceptTouchEvent = true; This prevents the parent from interceping touch. Co-authored-by: Jiyun Yang --- .../src/public/BaseComponents/ViewEvent.cs | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs index 2e89367..62513e7 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs @@ -252,6 +252,19 @@ namespace Tizen.NUI.BaseComponents } /// + /// If child view doesn't want the parent's view to intercept the touch, you can set it to true. + /// for example : + /// parent.Add(child); + /// parent.InterceptTouchEvent += OnInterceptTouchEvent; + /// View view = child.GetParent() as View; + /// view.DisallowInterceptTouchEvent = true; + /// This prevents the parent from interceping touch. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public bool DisallowInterceptTouchEvent {get; set;} + + + /// /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.
/// The touched signal is emitted when the touch input is received.
///
@@ -812,6 +825,12 @@ namespace Tizen.NUI.BaseComponents return true; } + // DisallowInterceptTouchEvent prevents the parent from intercepting touch. + if (DisallowInterceptTouchEvent) + { + return false; + } + TouchEventArgs e = new TouchEventArgs(); e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); @@ -823,11 +842,6 @@ namespace Tizen.NUI.BaseComponents consumed = _interceptTouchDataEventHandler(this, e); } - if (enableControlState && !consumed) - { - consumed = HandleControlStateOnTouch(e.Touch); - } - return consumed; } -- 2.7.4