[NUI] Fix to support simple MatchParent in RelativeLayout
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 29 Jun 2021 05:23:43 +0000 (14:23 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 29 Jun 2021 06:46:52 +0000 (15:46 +0900)
This reverts a part of d5ac94d24b3ca635034b57324e527e253e2ed789 to
support simple MatchParent in RelativeLayout.

For easier use, child fills its parent if child has MatchParent without
using RelativeLayout APIs.

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

index ed8ea33..9e00432 100755 (executable)
@@ -348,28 +348,7 @@ namespace Tizen.NUI
                 LayoutItem childLayout = LayoutChildren[i];
                 if (childLayout != null)
                 {
-                    var childWidthMeasureSpec = new MeasureSpecification(widthMeasureSpec.Size, widthMeasureSpec.Mode);
-                    var childHeightMeasureSpec = new MeasureSpecification(heightMeasureSpec.Size, heightMeasureSpec.Mode);
-
-                    // RelativeLayout's MatchParent children should not fill to the RelativeLayout.
-                    // Because the children's sizes and positions are calculated by RelativeLayout's APIs.
-                    // Therefore, not to fill the RelativeLayout, the mode is changed from Exactly to AtMost.
-                    if (childLayout.Owner.WidthSpecification == LayoutParamPolicies.MatchParent)
-                    {
-                        childWidthMeasureSpec.SetSize(new LayoutLength(widthMeasureSpec.Size));
-                        childWidthMeasureSpec.SetMode(MeasureSpecification.ModeType.AtMost);
-                    }
-
-                    // RelativeLayout's MatchParent children should not fill to the RelativeLayout.
-                    // Because the children's sizes and positions are calculated by RelativeLayout's APIs.
-                    // Therefore, not to fill the RelativeLayout, the mode is changed from Exactly to AtMost.
-                    if (childLayout.Owner.HeightSpecification == LayoutParamPolicies.MatchParent)
-                    {
-                        childHeightMeasureSpec.SetSize(new LayoutLength(heightMeasureSpec.Size));
-                        childHeightMeasureSpec.SetMode(MeasureSpecification.ModeType.AtMost);
-                    }
-
-                    MeasureChildWithMargins(childLayout, childWidthMeasureSpec, new LayoutLength(0), childHeightMeasureSpec, new LayoutLength(0));
+                    MeasureChildWithMargins(childLayout, widthMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0));
 
                     if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
                     {