From 85b41782184984a0713a0520471215610d36dccc Mon Sep 17 00:00:00 2001 From: YeongJong Lee Date: Thu, 21 Jan 2021 15:34:18 +0900 Subject: [PATCH] [NUI] remove internal child properly when child view of FlexLayout is removed (#2523) In `FlexLayout`, when we add new view, the existing view shrink. but when removed they are in shrinked state. they should change back. To fix this issue, this patch remove internal child(child of yoga layout) when child view of `FlexLayout` is removed. For now, `OnChildRemove` API will work correctly. Thank you Aman Jeph for the report. --- src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs | 2 +- src/Tizen.NUI/src/public/Layouting/FlexLayout.cs | 2 +- src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs b/src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs index 892f8ac..f11daf0 100755 --- a/src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs +++ b/src/Tizen.NUI/src/internal/Layouting/Interop/Interop.FlexLayout.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI public static extern global::System.IntPtr FlexLayout_AddChildWithMargin( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, Tizen.NUI.FlexLayout.ChildMeasureCallback jarg4, int jarg5); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_RemoveChild")] - public static extern global::System.IntPtr FlexLayout_RemoveChild( global::System.Runtime.InteropServices.HandleRef jarg1, LayoutItem jarg2); + public static extern global::System.IntPtr FlexLayout_RemoveChild( global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FlexLayout_CalculateLayout")] public static extern global::System.IntPtr FlexLayout_CalculateLayout( global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, bool jarg4); diff --git a/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs b/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs index b3ccc94..bf7f758 100755 --- a/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs +++ b/src/Tizen.NUI/src/public/Layouting/FlexLayout.cs @@ -626,7 +626,7 @@ namespace Tizen.NUI { // When child View is removed from it's parent View (that is a Layout) then remove it from the layout too. // FlexLayout refers to the child as a View not LayoutItem. - Interop.FlexLayout.FlexLayout_RemoveChild(swigCPtr, child); + Interop.FlexLayout.FlexLayout_RemoveChild(swigCPtr, child.Owner.SwigCPtr); } /// diff --git a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs index f156cb4..6d28894 100755 --- a/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs +++ b/src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs @@ -119,7 +119,7 @@ namespace Tizen.NUI // If child removed then set all siblings not being added to a ChangeOnRemove transition. SetConditionsForAnimationOnLayoutGroup(TransitionCondition.ChangeOnRemove); } - + OnChildRemove(layoutItem); RequestLayout(); } -- 2.7.4