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 fbbadbb46bb3581dc3534b25861e40f0e0b6990f..f336d1952c048f7b9dbea4be7593773a76418c73 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 a7b3a0124afa3c4eeb442af093726683a4311273..f1c7a7e469a8a6db33593d034ea14f750bba593e 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 10965172731ba85e7d1d0fdc2b2b85ea6befae05..e45a5865cc19fcd2300231982041c7444916380f 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 2f25d751736aad9c0c2c496b53f568d63302f528..0f6d5c5c3ba1495a1b794c03db5b6a57814eb405 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)