[NUI] Fix TCT fails
authorJiyun Yang <ji.yang@samsung.com>
Fri, 19 Mar 2021 02:30:51 +0000 (11:30 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 19 Mar 2021 08:05:58 +0000 (17:05 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI.Components/Controls/Loading.cs
src/Tizen.NUI.Components/Controls/Pagination.cs
src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs

index 95e65f6..e017715 100755 (executable)
@@ -64,21 +64,22 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty FrameRateProperty = BindableProperty.Create(nameof(FrameRate), typeof(int), typeof(Loading), (int)(1000 / 16.6f), propertyChanged: (bindable, oldValue, newValue) =>
         {
-            Debug.Assert(((Loading)bindable).imageVisual != null);
+            var instance = (Loading)bindable;
+            Debug.Assert(instance.imageVisual != null);
 
-            inframeRate = (int)newValue;
-            if (0 != frameRate) //It will crash if 0
+            instance.frameRate = (int)newValue;
+            if (0 != instance.frameRate) //It will crash if 0
             {
-                ((Loading)bindable).imageVisual.FrameDelay = 1000.0f / frameRate;
+                instance.imageVisual.FrameDelay = instance.frameRate;
             }
         },
         defaultValueCreator: (bindable) =>
         {
-            Debug.Assert(((Loading)bindable).imageVisual != null);
-            return ((Loading)bindable).imageVisual.FrameDelay * 1000.0f;
+            return ((Loading)bindable).frameRate;
         });
 
         private AnimatedImageVisual imageVisual = null;
+        private int frameRate = (int)(1000 / 16.6f);
 
         internal new class Property
         {
index b537fb8..813b420 100755 (executable)
@@ -176,6 +176,7 @@ namespace Tizen.NUI.Components
         /// Gets or sets the count of the pages/indicators.
         /// </summary>
         /// <since_tizen> 8 </since_tizen>
+        /// <exception cref="ArgumentException">Thrown when the given value is negative.</exception>
         public int IndicatorCount
         {
             get
@@ -184,7 +185,12 @@ namespace Tizen.NUI.Components
             }
             set
             {
-                if (indicatorCount == value || value < 0)
+                if (value < 0)
+                {
+                    throw new ArgumentException($"Setting {nameof(IndicatorCount)} to negative is not allowed.");
+                }
+
+                if (indicatorCount == value)
                 {
                     return;
                 }
@@ -324,14 +330,12 @@ namespace Tizen.NUI.Components
                     selectedIndicatorColor = value;
                 }
 
-                if (selectedIndex == -1)
+                if (indicatorList.Count > selectedIndex)
                 {
-                    return;
+                    var indicator = indicatorList[selectedIndex];
+                    indicator.MixColor = selectedIndicatorColor;
+                    indicator.Opacity = selectedIndicatorColor.A;
                 }
-
-                ImageVisual indicator = indicatorList[selectedIndex];
-                indicator.MixColor = selectedIndicatorColor;
-                indicator.Opacity = selectedIndicatorColor.A;
             }
         }
 
index ddda07e..0e02d38 100755 (executable)
@@ -252,7 +252,6 @@ namespace Tizen.NUI.Components
                     Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
                 },
                 IndicatorSize = new Size(10, 10),
-                IndicatorSpacing = 10,
             });
 
             theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()