[NUI] Change default layout to AbsoluteLayout (#1543)
authorneostom432 <31119276+neostom432@users.noreply.github.com>
Wed, 22 Apr 2020 07:26:59 +0000 (16:26 +0900)
committerGitHub <noreply@github.com>
Wed, 22 Apr 2020 07:26:59 +0000 (16:26 +0900)
We used LayoutItem and LayoutGroup as default layout but many developer wants to use AbsoluteLayout as default.
So changed default layout to AbsoluteLayout.

src/Tizen.NUI/src/internal/Layouting/LayoutController.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs

index 93fbef9..1d54477 100755 (executable)
@@ -160,17 +160,10 @@ namespace Tizen.NUI
             for (uint i = 0; i < rootNode.ChildCount; i++)
             {
                 View view = rootNode.GetChildAt(i);
-                if (rootNode.Layout == null )
+                if (view.Layout == null )
                 {
-                    if (rootNode.GetType() == typeof(View))
-                    {
-                        rootNode.Layout = new LayoutGroup();
-                        AutomaticallyAssignLayouts(rootNode);
-                    }
-                    else
-                    {
-                        rootNode.Layout = new LayoutItem();
-                    }
+                    view.Layout = new AbsoluteLayout();
+                    AutomaticallyAssignLayouts(rootNode);
                 }
             }
         }
index e6b1495..a31513f 100755 (executable)
@@ -2156,7 +2156,7 @@ namespace Tizen.NUI.BaseComponents
                 if (value?.Owner != null)
                 {
                     // Previous owner of the layout gets a default layout as a replacement.
-                    value.Owner.Layout = new LayoutGroup();
+                    value.Owner.Layout = new AbsoluteLayout();
 
                     // Copy Margin and Padding to replacement LayoutGroup.
                     value.Owner.Layout.Margin = value.Margin;
index c138812..d752c74 100755 (executable)
@@ -175,16 +175,7 @@ namespace Tizen.NUI
                 {
                     // If child of this layout is a pure View then assign it a LayoutGroup
                     // If the child is derived from a View then it may be a legacy or existing container hence will do layouting itself.
-                    if (child.GetType() == typeof(View))
-                    {
-                        child.Layout = new LayoutGroup();
-                    }
-                    else
-                    {
-                        // Adding child as a leaf, layouting will not propagate past this child.
-                        // Legacy containers will be a LayoutItems too and layout their children how they wish.
-                        child.Layout = new LayoutItem();
-                    }
+                    child.Layout = new AbsoluteLayout();
                 }
             }
             else