Fix warnings about CA2000 of NUI.Components. (#2157)
authorguowei.wang <guowei.wang@samsung.com>
Mon, 9 Nov 2020 05:42:51 +0000 (13:42 +0800)
committerGitHub <noreply@github.com>
Mon, 9 Nov 2020 05:42:51 +0000 (14:42 +0900)
Co-authored-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI.Components/Controls/DropDown.cs
src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleViewLayoutManager.cs
src/Tizen.NUI.Components/Controls/Loading.cs
src/Tizen.NUI.Components/Controls/Pagination.cs
src/Tizen.NUI.Components/PreloadStyle/OverlayAnimationButtonStyle.cs [changed mode: 0644->0755]

index fbbadbb..f336d19 100755 (executable)
@@ -529,7 +529,9 @@ namespace Tizen.NUI.Components
             if (null == scrollableBase || null == listBackgroundImage || null == dropDownMenuFullList) return;
             if (null == ListBackgroundImage.Size) return;
             // Resize and position scrolling list within the drop down list container.  Can be used to position list in relation to the background image.
-            scrollableBase.Size = ListBackgroundImage.Size - new Size((dropDownStyle.ListPadding.Start + dropDownStyle.ListPadding.End), (dropDownStyle.ListPadding.Top + dropDownStyle.ListPadding.Bottom), 0);
+            Size dropDownPaddingSize = new Size((dropDownStyle.ListPadding.Start + dropDownStyle.ListPadding.End), (dropDownStyle.ListPadding.Top + dropDownStyle.ListPadding.Bottom), 0);
+            scrollableBase.Size = ListBackgroundImage.Size - dropDownPaddingSize;
+            dropDownPaddingSize.Dispose();
             scrollableBase.Position2D = new Position2D(dropDownStyle.ListPadding.Start, dropDownStyle.ListPadding.Top);
 
             int listBackgroundImageX = 0;
index a7b3a01..f1c7a7e 100755 (executable)
@@ -220,6 +220,7 @@ namespace Tizen.NUI.Components
             Vector2 amounts = GetRectOfVisibleChildScrollAmount(parent, child);
             float dx = amounts[0];
             float dy = amounts[1];
+            amounts.Dispose();
             if (dx != 0 || dy != 0)
             {
                 if (dx != 0 && CanScrollHorizontally())
@@ -769,14 +770,14 @@ namespace Tizen.NUI.Components
             int childRight = (int)child.Right;
             int childBottom = (int)child.Bottom;
 
-            Extents offset = new Extents((ushort)Math.Min(0, childLeft - parentLeft),
-                                         (ushort)Math.Max(0, childRight - parentRight),
-                                         (ushort)Math.Min(0, childTop - parentTop),
-                                         (ushort)Math.Max(0, childBottom - parentBottom));
+            var offsetStart = Math.Min(0, childLeft - parentLeft);
+            var offsetEnd = Math.Max(0, childRight - parentRight);
+            var offsetTop = Math.Min(0, childTop - parentTop);
+            var offsetBottom = Math.Max(0, childBottom - parentBottom);
 
-            int dx = offset.Start != 0 ? offset.Start : Math.Min(childLeft - parentLeft, offset.End);
+            int dx = offsetStart != 0 ? offsetStart : Math.Min(childLeft - parentLeft, offsetEnd);
 
-            int dy = offset.Top != 0 ? offset.Top : Math.Min(childTop - parentTop, offset.Bottom);
+            int dy = offsetTop != 0 ? offsetTop : Math.Min(childTop - parentTop, offsetBottom);
 
             ret.X = -dx;
             ret.Y = -dy;
index 1096517..e45a586 100755 (executable)
@@ -265,7 +265,9 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void Play()
         {
-            this.DoAction(imageVisual.VisualIndex, Property.ACTION_PLAY, new PropertyValue(0));
+            PropertyValue attributes = new PropertyValue(0);
+            this.DoAction(imageVisual.VisualIndex, Property.ACTION_PLAY, attributes);
+            attributes.Dispose();
         }
 
         /// <summary>
@@ -275,7 +277,9 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void Pause()
         {
-            this.DoAction(imageVisual.VisualIndex, Property.ACTION_PAUSE, new PropertyValue(0));
+            PropertyValue attributes = new PropertyValue(0);
+            this.DoAction(imageVisual.VisualIndex, Property.ACTION_PAUSE, attributes);
+            attributes.Dispose();
         }
 
         /// <summary>
@@ -285,7 +289,9 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void Stop()
         {
-            this.DoAction(imageVisual.VisualIndex, Property.ACTION_STOP, new PropertyValue(0));
+            PropertyValue attributes = new PropertyValue(0);
+            this.DoAction(imageVisual.VisualIndex, Property.ACTION_STOP, attributes);
+            attributes.Dispose();
         }
     }
 }
index 2f25d75..0f6d5c5 100755 (executable)
@@ -476,7 +476,7 @@ namespace Tizen.NUI.Components
                 MixColor = (indicatorColor == null) ? new Color(1.0f, 1.0f, 1.0f, 0.5f) : indicatorColor,
                 Opacity = (indicatorColor == null) ? 0.5f : indicatorColor.A
             };
-            indicator.Position = new Position2D((int)(paginationStyle.IndicatorSize.Width + paginationStyle.IndicatorSpacing) * indicatorList.Count, 0);
+            indicator.Position = new Vector2((int)(paginationStyle.IndicatorSize.Width + paginationStyle.IndicatorSpacing) * indicatorList.Count, 0);
             container.AddVisual("Indicator" + indicatorList.Count, indicator);
             indicatorList.Add(indicator);
         }
@@ -510,7 +510,7 @@ namespace Tizen.NUI.Components
                 ImageVisual indicator = indicatorList[i];
                 indicator.URL = paginationStyle.IndicatorImageUrl.Normal;
                 indicator.Size = new Size2D((int)paginationStyle.IndicatorSize.Width, (int)paginationStyle.IndicatorSize.Height);
-                indicator.Position = new Position2D((int)(paginationStyle.IndicatorSize.Width + paginationStyle.IndicatorSpacing) * i, 0);
+                indicator.Position = new Vector2((int)(paginationStyle.IndicatorSize.Width + paginationStyle.IndicatorSpacing) * i, 0);
             }
 
             if (lastIndicatorImageUrl != null && indicatorCount > 0)
old mode 100644 (file)
new mode 100755 (executable)
index eb634dc..76598c9
@@ -33,7 +33,7 @@ namespace Tizen.NUI.Components
         public OverlayAnimationButtonStyle() : base()
         {
             CornerRadius = 10;
-            BackgroundColor = new Color(0.3f, 0.3f, 0.3f, 0.5f);
+            BackgroundColor = new Selector<Color> { All = new Color(0.3f, 0.3f, 0.3f, 0.5f) };
             // PositionUsesPivotPoint = true;
             IconRelativeOrientation = Button.IconOrientation.Top;
             Text = new TextLabelStyle
@@ -120,13 +120,22 @@ namespace Tizen.NUI.Components
             {
                 var keyFrames = new KeyFrames();
                 keyFrames.Add(0.0f, 0.0f);
-                keyFrames.Add(0.25f, 1.0f, new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear));
-                keyFrames.Add(1.0f, 0.0f, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut));
+                AlphaFunction linear = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear);
+                keyFrames.Add(0.25f, 1.0f, linear);
+                linear.Dispose();
+                AlphaFunction ease = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut);
+                keyFrames.Add(1.0f, 0.0f, ease);
+                ease.Dispose();
 
                 PressAnimation = new Animation(600);
                 PressAnimation.EndAction = Animation.EndActions.StopFinal;
                 PressAnimation.AnimateBetween(overlayImage, "Opacity", keyFrames);
-                PressAnimation.AnimateTo(overlayImage, "Scale", new Vector3(1, 1, 1), 0, 600, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut));
+                keyFrames.Dispose();
+                Vector3 vec = new Vector3(1, 1, 1);
+                AlphaFunction easeout = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOut);
+                PressAnimation.AnimateTo(overlayImage, "Scale", vec, 0, 600, easeout);
+                vec.Dispose();
+                easeout.Dispose();
             }
 
             if (PressAnimation.State == Animation.States.Playing)