[NUI] Delete unnecessary log (#2299)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Fri, 27 Nov 2020 02:56:08 +0000 (11:56 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 1 Dec 2020 08:56:39 +0000 (17:56 +0900)
- Delete the log commented
- Displays only one log when the value is invalid of color.
- View.Parent is deprecated, modify to use View.GetParent()

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs
src/Tizen.NUI/src/internal/Interop/Interop.Util.cs [deleted file]
src/Tizen.NUI/src/internal/Interop/NDalicPINVOKE.cs
src/Tizen.NUI/src/public/Color.cs
src/Tizen.NUI/src/public/Layouting/LayoutGroup.cs
src/Tizen.NUI/src/public/Layouting/LayoutItem.cs
src/Tizen.NUI/src/public/PropertyValue.cs
src/Tizen.NUI/src/public/WindowEvent.cs

index 49368dc..0fac846 100755 (executable)
@@ -10,8 +10,6 @@ namespace Tizen.NUI
         {
             static Stage()
             {
-                ulong ret = Interop.Util.GetNanoSeconds();
-                Tizen.Log.Error("NUI", "Stage : " + ret);
             }
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Stage_DEFAULT_BACKGROUND_COLOR_get")]
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Util.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Util.cs
deleted file mode 100755 (executable)
index 68dc4a9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Tizen.NUI
-{
-
-    internal static partial class Interop
-    {
-        internal static partial class Util
-        {
-            internal static ulong GetNanoSeconds()
-            {
-                return 0;
-            }
-        }
-    }
-}
\ No newline at end of file
index bbfce31..6da0791 100755 (executable)
@@ -224,7 +224,6 @@ namespace Tizen.NUI
         static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
         static NDalicPINVOKE()
         {
-            Tizen.Log.Error("NUI", "Create NDalicPINVOKE");
         }
 
         [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_BaseHandle")]
index 15f3919..2d43b9f 100755 (executable)
@@ -489,45 +489,9 @@ namespace Tizen.NUI
             float b = color.B;
             float a = color.A;
 
-            if (r < 0.0f)
+            if (IsInvalidValue(ref r) | IsInvalidValue(ref g) | IsInvalidValue(ref b) | IsInvalidValue(ref a))
             {
-                r = 0.0f;
-                NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
-            }
-            else if (r > 1.0f)
-            {
-                r = 1.0f;
-                NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
-            }
-            if (g < 0.0f)
-            {
-                g = 0.0f;
-                NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
-            }
-            else if (g > 1.0f)
-            {
-                g = 1.0f;
-                NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
-            }
-            if (b < 0.0f)
-            {
-                b = 0.0f;
-                NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
-            }
-            else if (b > 1.0f)
-            {
-                b = 1.0f;
-                NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
-            }
-            if (a < 0.0f)
-            {
-                a = 0.0f;
-                NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
-            }
-            else if (a > 1.0f)
-            {
-                a = 1.0f;
-                NUILog.Error("The value of Result is invalid! Should be between [0, 1].");
+                NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. Color is {color.R}, {color.G}, {color.B}, {color.A}");
             }
             color = new Color(r, g, b, a);
             return color;
@@ -535,17 +499,12 @@ namespace Tizen.NUI
 
         internal static float ValueCheck(float value)
         {
-            if (value < 0.0f)
+            float refValue = value;
+            if (IsInvalidValue(ref refValue))
             {
-                value = 0.0f;
-                NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
+                NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. float value is {value}");
             }
-            else if (value > 1.0f)
-            {
-                value = 1.0f;
-                NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
-            }
-            return value;
+            return refValue;
         }
 
         internal static float[] ValueCheck(float[] arr)
@@ -557,20 +516,31 @@ namespace Tizen.NUI
 
             for (int i = 0; i < arr.Length; i++)
             {
-                if (arr[i] < 0.0f)
+                float refValue = arr[i];
+                if (IsInvalidValue(ref refValue))
                 {
-                    arr[i] = 0.0f;
-                    NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
-                }
-                else if (arr[i] > 1.0f)
-                {
-                    arr[i] = 1.0f;
-                    NUILog.Error("The value of Parameters is invalid! Should be between [0, 1].");
+                    NUILog.Error($"The value of Result is invalid! Should be between [0, 1]. arr[] is {arr[i]}");
+                    arr[i] = refValue;
                 }
             }
             return arr;
         }
 
+        private static bool IsInvalidValue(ref float value)
+        {
+            if (value < 0.0f)
+            {
+                value = 0.0f;
+                return true;
+            }
+            else if (value > 1.0f)
+            {
+                value = 1.0f;
+                return true;
+            }
+            return false;
+        }
+
         /// This will not be public opened.
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
index b5f2db1..5b6da9e 100755 (executable)
@@ -138,9 +138,10 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void ChangeLayoutSiblingOrder(int order)
         {
-            if (Owner != null && Owner.Parent != null)
+            var ownerParent = Owner.GetParent() as View;
+            if (Owner != null && ownerParent != null)
             {
-                LayoutGroup parent = Owner.Parent.Layout as LayoutGroup;
+                var parent = ownerParent.Layout as LayoutGroup;
 
                 if (parent != null && parent.LayoutChildren.Count > order)
                 {
index e439b5b..9607a22 100755 (executable)
@@ -597,7 +597,8 @@ namespace Tizen.NUI
                                                          " right:" + _layoutPositionData.Right +
                                                          " bottom:" + _layoutPositionData.Bottom);
 
-                if (Owner.Parent != null && Owner.Parent.Layout != null && Owner.Parent.Layout.LayoutWithTransition)
+                var ownerParent = Owner.GetParent() as View;
+                if (ownerParent != null && ownerParent.Layout != null && ownerParent.Layout.LayoutWithTransition)
                 {
                     NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(_layoutPositionData);
                 }
index cc6ff7a..2f18181 100755 (executable)
@@ -344,7 +344,6 @@ namespace Tizen.NUI
             {
                 throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name);
             }
-            //NUILog.Debug(" got an property value of =" + type.Name);
             return value;
         }
 
index 3c4d1ce..1ee558f 100755 (executable)
@@ -565,13 +565,11 @@ namespace Tizen.NUI
 
         private WindowTransitionEffectSignal TransitionEffectEventSignal()
         {
-            //Tizen.Log.Fatal("NUITEST", "TransitionEffectEventSignal()!");
             if (transitionEffectSignal == null)
             {
                 transitionEffectSignal = new WindowTransitionEffectSignal(this);
                 if (NDalicPINVOKE.SWIGPendingException.Pending)
                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-                //Tizen.Log.Fatal("NUITEST", $"transitionEffectSignal is null, new here!");
             }
             return transitionEffectSignal;
         }
@@ -737,24 +735,19 @@ namespace Tizen.NUI
 
         private void OnTransitionEffect(IntPtr window, int state, int type)
         {
-            //Tizen.Log.Fatal("NUITEST", $"OnTransitionEffect() called");
             if (window == global::System.IntPtr.Zero)
             {
-                //Tizen.Log.Error("NUI", $"OnTransitionEffect() IntPtr window is null!");
                 return;
             }
 
             TransitionEffectArgs e = new TransitionEffectArgs();
 
             e.State = (EffectStates)state;
-            //Tizen.Log.Error("NUITEST", $"e.State={e.State}");
 
             e.Type = (EffectTypes)type;
-            //Tizen.Log.Error("NUITEST", $"e.Type={e.Type}");
 
             if (transitionEffectHandler != null)
             {
-                //Tizen.Log.Fatal("NUITEST", $"Execute transitionEffectHandler(this, e)!!!");
                 transitionEffectHandler(this, e);
             }
             return;