Improve the compatibility for the "destinationValue" parameter of AnimateTo and...
authorFeng Jin <feng16.jin@samsung.com>
Tue, 18 Apr 2017 16:15:37 +0000 (00:15 +0800)
committerFeng Jin <feng16.jin@samsung.com>
Fri, 21 Apr 2017 15:11:29 +0000 (23:11 +0800)
Change-Id: Ibf2c81902788d1829c77cad7b7070851c95eb0c4
Signed-off-by: Feng Jin <feng16.jin@samsung.com>
NUISamples/NUISamples/NUISamples.TizenTV/examples/hello-world.cs
src/Tizen.NUI/src/public/Animation.cs
src/Tizen.NUI/src/public/Property.cs

index 73e3771..9af16c1 100755 (executable)
@@ -75,7 +75,7 @@ namespace HelloWorldTest
             };
             _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 500);
             _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000);
-            _animation.AnimateBy(_text, "ScaleX", 3.0f, 1000, 1500);
+            _animation.AnimateBy(_text, "ScaleX", 3, 1000, 1500);
             _animation.AnimateBy(_text, "ScaleY", 4.0f, 1500, 2000);
             _animation.EndAction = Animation.EndActions.Discard;
             _animation.Finished += AnimationFinished;
index 26e7e5d..2e7e182 100755 (executable)
@@ -386,6 +386,17 @@ namespace Tizen.NUI
                 throw new System.Exception("second argument string property is invalid parameter!");
             }
 
+            PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
+            if(propertyType.Equals(PropertyType.Float))
+            {
+                System.Type type = relativeValue.GetType();
+                if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
+                {
+                    int num = (int)relativeValue;
+                    relativeValue = (float)num;
+                }
+            }
+
             PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
 
             if (alphaFunction != null)
@@ -419,6 +430,17 @@ namespace Tizen.NUI
                 throw new System.Exception("second argument string property is invalid parameter!");
             }
 
+            PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
+            if(propertyType.Equals(PropertyType.Float))
+            {
+                System.Type type = relativeValue.GetType();
+                if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
+                {
+                    int num = (int)relativeValue;
+                    relativeValue = (float)num;
+                }
+            }
+
             PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
 
             if (alphaFunction != null)
@@ -452,6 +474,17 @@ namespace Tizen.NUI
                 throw new System.Exception("second argument string property is invalid parameter!");
             }
 
+            PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
+            if(propertyType.Equals(PropertyType.Float))
+            {
+                System.Type type = destinationValue.GetType();
+                if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
+                {
+                    int num = (int)destinationValue;
+                    destinationValue = (float)num;
+                }
+            }
+
             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
 
             if (alphaFunction != null)
@@ -486,6 +519,17 @@ namespace Tizen.NUI
                 throw new System.Exception("second argument string property is invalid parameter!");
             }
 
+            PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex);
+            if(propertyType.Equals(PropertyType.Float))
+            {
+                System.Type type = destinationValue.GetType();
+                if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int)))
+                {
+                    int num = (int)destinationValue;
+                    destinationValue = (float)num;
+                }
+            }
+
             PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
 
             if (alphaFunction != null)
index af5873c..e643178 100755 (executable)
@@ -1054,7 +1054,6 @@ namespace Tizen.NUI
             return value;
         }
 
-
         /// <summary>
         /// Creates a Size2D property value.
         /// </summary>