[NUI] Fixed TCT failed issues (#1177)
authorzhouleonlei <56956725+zhouleonlei@users.noreply.github.com>
Wed, 11 Dec 2019 03:34:12 +0000 (11:34 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 11 Dec 2019 03:34:12 +0000 (12:34 +0900)
src/Tizen.NUI.Components/Controls/Button.cs
src/Tizen.NUI.Components/Controls/Popup.cs
src/Tizen.NUI.Components/Controls/Scrollbar.cs
src/Tizen.NUI.Components/Controls/Slider.cs
src/Tizen.NUI.Components/Controls/Switch.cs
src/Tizen.NUI.Components/Controls/Tab.cs
src/Tizen.NUI/src/public/Extents.cs

index da717b7..86ca05f 100755 (executable)
@@ -193,11 +193,14 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return Style.Text.Text?.GetValue(ControlState);
+                return Style?.Text?.Text?.GetValue(ControlState);
             }
             set
             {
-                Style.Text.Text = value;
+                if (null != Style?.Text)
+                {
+                    Style.Text.Text = value;
+                }
             }
         }
 
@@ -355,6 +358,7 @@ namespace Tizen.NUI.Components
                 }
             }
         }
+        private StringSelector textSelector = new StringSelector();
         /// <summary>
         /// Text string selector in Button.
         /// </summary>
@@ -363,16 +367,15 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (StringSelector)Style?.Text?.Text;
+                return textSelector;
             }
             set
             {
-                if (value != null)
-                {
-                    Style.Text.Text = value.Clone() as StringSelector;
-                }
+                textSelector.Clone(value);
             }
         }
+
+        private StringSelector translatableTextSelector = new StringSelector();
         /// <summary>
         /// Translateable text string selector in Button.
         /// </summary>
@@ -381,17 +384,16 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (StringSelector)Style?.Text?.TranslatableText;
+                return translatableTextSelector;
             }
             set
             {
-                if (value != null)
-                {
-                    Style.Text.TranslatableText = value.Clone() as StringSelector;
-                }
+                translatableTextSelector.Clone(value);
             }
         }
 
+
+        private ColorSelector textColorSelector = new ColorSelector();
         /// <summary>
         /// Text color selector in Button.
         /// </summary>
@@ -400,17 +402,15 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (ColorSelector)Style?.Text?.TextColor;
+                return textColorSelector;
             }
             set
             {
-                if(value != null)
-                {
-                    Style.Text.TextColor = value.Clone() as ColorSelector;
-                }
+                textColorSelector.Clone(value);
             }
         }
 
+        private FloatSelector pointSizeSelector = new FloatSelector();
         /// <summary>
         /// Text font size selector in Button.
         /// </summary>
@@ -419,17 +419,16 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (FloatSelector)Style?.Text?.PointSize;
+                return pointSizeSelector;
             }
             set
             {
-                if (value != null)
-                {
-                    Style.Text.PointSize = value.Clone() as FloatSelector;
-                }
+                pointSizeSelector.Clone(value);
             }
         }
 
+
+        private StringSelector iconURLSelector = new StringSelector();
         /// <summary>
         /// Icon image's resource url selector in Button.
         /// </summary>
@@ -438,17 +437,15 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (StringSelector)Style?.Icon?.ResourceUrl;
+                return iconURLSelector;
             }
             set
             {
-                if (value != null)
-                {
-                    Style.Icon.ResourceUrl = value.Clone() as StringSelector;
-                }
+                iconURLSelector.Clone(value);
             }
         }
 
+
         /// <summary>
         /// Flag to decide selected state in Button.
         /// </summary>
index 23bb672..f2645d4 100755 (executable)
@@ -81,7 +81,7 @@ namespace Tizen.NUI.Components
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Size?.Height ?? 0;
+            return (int)(instance.Style?.Buttons?.Size?.Height ?? 0);
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
@@ -122,7 +122,7 @@ namespace Tizen.NUI.Components
         defaultValueCreator: (bindable) =>
         {
             var instance = (Popup)bindable;
-            return instance.Style.Buttons?.Text?.FontFamily;
+            return instance.Style?.Buttons?.Text?.FontFamily.All;
         });
 
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
index 21ab5a4..32081ac 100755 (executable)
@@ -110,7 +110,7 @@ namespace Tizen.NUI.Components
                 instance.Style.Duration = (uint)newValue;
                 if (instance.scrollAniPlayer != null)
                 {
-                    instance.scrollAniPlayer.Duration = (int)newValue;
+                    instance.scrollAniPlayer.Duration = (int)instance.Style.Duration;
                 }
             }
         },
index 3f04ffd..fcdb913 100755 (executable)
@@ -422,6 +422,7 @@ namespace Tizen.NUI.Components
             }
         }
 
+        private StringSelector thumbImageURLSelector = new StringSelector();
         /// <summary>
         /// Gets or sets the resource url selector of the thumb image object.
         /// </summary>
@@ -430,17 +431,15 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (StringSelector)Style.Thumb?.ResourceUrl;
+                return thumbImageURLSelector;
             }
             set
             {
-                if (value != null)
-                {
-                    Style.Thumb.ResourceUrl = value.Clone() as StringSelector;
-                }
+                thumbImageURLSelector.Clone(value);
             }
         }
 
+
         /// <summary>
         /// Gets or sets the color of the background track image object.
         /// </summary>
index 9c58b78..d50c134 100755 (executable)
@@ -103,6 +103,7 @@ namespace Tizen.NUI.Components
             }
         }
 
+        private StringSelector switchBackgroundImageURLSelector = new StringSelector();
         /// <summary>
         /// Background image's resource url selector in Switch.
         /// </summary>
@@ -111,14 +112,11 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (StringSelector)Style.Track?.ResourceUrl;
+                return switchBackgroundImageURLSelector;
             }
             set
             {
-                if (value != null)
-                {
-                    Style.Track.ResourceUrl = value.Clone() as StringSelector;
-                }
+                switchBackgroundImageURLSelector.Clone(value);
             }
         }
 
@@ -148,6 +146,7 @@ namespace Tizen.NUI.Components
             }
         }
 
+        private StringSelector switchHandlerImageURLSelector = new StringSelector();
         /// <summary>
         /// Handler image's resource url selector in Switch.
         /// </summary>
@@ -156,17 +155,15 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (StringSelector)Style.Thumb?.ResourceUrl;
+                return switchHandlerImageURLSelector;
             }
             set
             {
-                if (value != null)
-                {
-                    Style.Thumb.ResourceUrl = value.Clone() as StringSelector;
-                }
+                switchHandlerImageURLSelector.Clone(value);
             }
         }
 
+
         /// <summary>
         /// Handler image's size in Switch.
         /// </summary>
index fec36f8..96fca90 100755 (executable)
@@ -305,6 +305,7 @@ namespace Tizen.NUI.Components
             }
         }
 
+        private ColorSelector textColorSelector = new ColorSelector();
         /// <summary>
         /// Text color selector in Tab.
         /// </summary>
@@ -313,19 +314,15 @@ namespace Tizen.NUI.Components
         {
             get
             {
-                return (ColorSelector)Style.Text.TextColor;
+                return textColorSelector;
             }
             set
             {
-                if (value != null)
-                {
-                    //CreateTextAttributes();
-                    Style.Text.TextColor = value.Clone() as ColorSelector;
-                    //RelayoutRequest();
-                }
+                textColorSelector.Clone(value);
             }
         }
 
+
         /// <summary>
         /// Add tab item by item data. The added item will be added to end of all items automatically.
         /// </summary>
index 7998ec4..824fc11 100755 (executable)
@@ -100,7 +100,7 @@ namespace Tizen.NUI
             Interop.Extents.Extents_start_set(swigCPtr, that.Start);
             Interop.Extents.Extents_end_set(swigCPtr, that.End);
             Interop.Extents.Extents_top_set(swigCPtr, that.Top);
-            Interop.Extents.Extents_bottom_set(swigCPtr, that.End);
+            Interop.Extents.Extents_bottom_set(swigCPtr, that.Bottom);
         }
 
         /// <summary>