[NUI] Clean code for NUI Layouting (#6238)
authorSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Fri, 26 Jul 2024 07:13:05 +0000 (16:13 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 31 Jul 2024 01:55:57 +0000 (10:55 +0900)
- Make intention revealing names for Some variables.
 Choosing names that reveal intent can make it much easier to understand.

Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
src/Tizen.NUI/src/public/Layouting/GridLayout.cs
src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs

index 87a2290..6f62728 100755 (executable)
@@ -418,8 +418,8 @@ namespace Tizen.NUI
                 int row = child.Row.Start;
                 int columnEnd = child.Column.End;
                 int rowEnd = child.Row.End;
-                float l = hLocations[column] + Padding.Start + view.Margin.Start;
-                float t = vLocations[row] + Padding.Top + view.Margin.Top;
+                float childLeft = hLocations[column] + Padding.Start + view.Margin.Start;
+                float childTop = vLocations[row] + Padding.Top + view.Margin.Top;
                 float width = hLocations[columnEnd] - hLocations[column] - ColumnSpacing - view.Margin.Start - view.Margin.End;
                 float height = vLocations[rowEnd] - vLocations[row] - RowSpacing - view.Margin.Top - view.Margin.Bottom;
                 bool needMeasuredWidth = false;
@@ -431,7 +431,7 @@ namespace Tizen.NUI
                 }
                 else
                 {
-                    l += (width - child.LayoutItem.MeasuredWidth.Size.AsDecimal()) * halign.ToFloat();
+                    childLeft += (width - child.LayoutItem.MeasuredWidth.Size.AsDecimal()) * halign.ToFloat();
                     width = child.LayoutItem.MeasuredWidth.Size.AsDecimal();
                 }
 
@@ -441,7 +441,7 @@ namespace Tizen.NUI
                 }
                 else
                 {
-                    t += (height - child.LayoutItem.MeasuredHeight.Size.AsDecimal()) * valign.ToFloat();
+                    childTop += (height - child.LayoutItem.MeasuredHeight.Size.AsDecimal()) * valign.ToFloat();
                     height = child.LayoutItem.MeasuredHeight.Size.AsDecimal();
                 }
 
@@ -489,7 +489,7 @@ namespace Tizen.NUI
                     }
                 }
 
-                child.LayoutItem.Layout(new LayoutLength(l), new LayoutLength(t), new LayoutLength(l + width), new LayoutLength(t + height));
+                child.LayoutItem.Layout(new LayoutLength(childLeft), new LayoutLength(childTop), new LayoutLength(childLeft + width), new LayoutLength(childTop + height));
             }
         }
 
index a6768ad..ee259b1 100755 (executable)
@@ -110,29 +110,29 @@ namespace Tizen.NUI
 
                     if (LayoutWithTransition)
                     {
-                        var win = Window.Get(Owner);
+                        var currentWindow = Window.Get(Owner);
 
                         if (!childLayout.IsReplaceFlag())
                         {
-                            if (win == null)
+                            if (currentWindow == null)
                             {
                                 NUIApplication.GetDefaultWindow().LayoutController.AddToRemovalStack(childLayout);
                             }
                             else
                             {
-                                win.LayoutController.AddToRemovalStack(childLayout);
+                                currentWindow.LayoutController.AddToRemovalStack(childLayout);
                             }
                         }
 
                         childLayout.ConditionForAnimation = childLayout.ConditionForAnimation | TransitionCondition.Remove;
                         // Add LayoutItem to the transition stack so can animate it out.
-                        if (win == null)
+                        if (currentWindow == null)
                         {
                             NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
                         }
                         else
                         {
-                            win.LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
+                            currentWindow.LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
                         }
                     }
 
@@ -696,8 +696,8 @@ namespace Tizen.NUI
         {
             return (Binding.BindableObject bindable, object value) =>
             {
-                int @enum = (int)value;
-                return enumMin <= @enum && @enum <= enumMax;
+                int validEnum = (int)value;
+                return enumMin <= validEnum && validEnum <= enumMax;
             };
         }
     }