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.
Co-authored-by: Jiyun Yang <ji.yang@samsung.com>
public static extern global::System.IntPtr 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 RemoveChild(global::System.Runtime.InteropServices.HandleRef jarg1, LayoutItem jarg2);
+ public static extern global::System.IntPtr 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 CalculateLayout(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, bool jarg4);
/// Callback when child is removed from container.<br />
/// </summary>
/// <param name="child">The Layout child.</param>
+ /// <exception cref="ArgumentNullException"> Thrown when child is null. </exception>
/// <since_tizen> 6 </since_tizen>
protected override void OnChildRemove(LayoutItem child)
{
+ if (null == child)
+ {
+ throw new ArgumentNullException(nameof(child));
+ }
// 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.RemoveChild(swigCPtr, child);
+ Interop.FlexLayout.RemoveChild(swigCPtr, child.Owner.SwigCPtr);
}
/// <summary>
// If child removed then set all siblings not being added to a ChangeOnRemove transition.
SetConditionsForAnimationOnLayoutGroup(TransitionCondition.ChangeOnRemove);
}
-
+ OnChildRemove(layoutItem);
RequestLayout();
}