[NUI] Fix ConvertIdToView (#877)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Wed, 5 Jun 2019 06:13:24 +0000 (15:13 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 5 Jun 2019 06:13:24 +0000 (15:13 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/Container.cs
src/Tizen.NUI/src/public/Layer.cs

index 4a8e259..beaeb3a 100755 (executable)
@@ -4568,6 +4568,11 @@ namespace Tizen.NUI.BaseComponents
             return ret;
         }
 
+        internal override View FindCurrentChildById(uint id)
+        {
+            return FindChildById(id);
+        }
+
         internal void SetParentOrigin(Vector3 origin)
         {
             Interop.ActorInternal.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin));
@@ -5552,19 +5557,7 @@ namespace Tizen.NUI.BaseComponents
 
         private View ConvertIdToView(uint id)
         {
-            View view = null;
-            if (GetParent() is View)
-            {
-                View parentView = GetParent() as View;
-                view = parentView.FindChildById(id);
-            }
-
-            if (!view)
-            {
-                view = Window.Instance.GetRootLayer().FindChildById(id);
-            }
-
-            return view;
+            return GetParent()?.FindCurrentChildById(id);
         }
 
         private void OnBackgroundResourceLoaded(IntPtr view)
index 8a61ac8..44f38c4 100755 (executable)
@@ -135,5 +135,10 @@ namespace Tizen.NUI
             base.Dispose(type);
         }
 
+        internal virtual View FindCurrentChildById(uint id)
+        {
+            return null;
+        }
+
     }
 } // namespace Tizen.NUI
index 06a7438..447c89b 100755 (executable)
@@ -367,6 +367,11 @@ namespace Tizen.NUI
             return ret;
         }
 
+        internal override View FindCurrentChildById(uint id)
+        {
+            return FindChildById(id);
+        }
+
         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public View FindChildByName(string viewName)