[NUI] Add ChangeLayoutChildOrder to LayoutGroup
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 5 Nov 2021 10:59:45 +0000 (19:59 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 9 Nov 2021 05:57:53 +0000 (14:57 +0900)
ChangeLayoutChildOrder is added to LayoutGroup to change the order of the child
layout in the layout group.

This PR has been made to resolve the following issue.
https://github.sec.samsung.net/dotnet/NUIBackend/issues/87

src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs

index 9ec42de..adc9d2d 100755 (executable)
@@ -165,6 +165,22 @@ namespace Tizen.NUI
             RequestLayout();
         }
 
+        /// <summary>
+        /// Sets the order of the child layout in the layout group.
+        /// </summary>
+        /// <param name="child">the child layout in the layout group</param>
+        /// <param name="order">the order of the child layout in the layout group</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void ChangeLayoutChildOrder(LayoutItem child, int order)
+        {
+            if ((child != null) && (LayoutChildren.Count > order))
+            {
+                LayoutChildren.Remove(child);
+                LayoutChildren.Insert(order, child);
+                RequestLayout();
+            }
+        }
+
         // Attaches to View ChildAdded signal so called when a View is added to a view.
         private void AddChildToLayoutGroup(View child)
         {