[NUI] Resolve CA1802 of StyleCop (#1667)
authorjaehyun0cho <jaehyun0cho@gmail.com>
Tue, 9 Jun 2020 07:12:07 +0000 (16:12 +0900)
committerGitHub <noreply@github.com>
Tue, 9 Jun 2020 07:12:07 +0000 (16:12 +0900)
To resolve CA1802 of StyleCop in Tizen.NUI.Components and
Tizen.NUI.Wearable, static readonly is replaced with const.

Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
src/Tizen.NUI.Components/Controls/FlexibleView/GridLayoutManager.cs
src/Tizen.NUI.Components/Controls/FlexibleView/LinearLayoutManager.cs
src/Tizen.NUI.Components/Controls/FlexibleView/OrientationHelper.cs
src/Tizen.NUI.Wearable/src/public/Title.cs

index e746be5..a0e415c 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI.Components
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class GridLayoutManager : LinearLayoutManager
     {
-        private static readonly int DEFAULT_SPAN_COUNT = -1;
+        private const int DEFAULT_SPAN_COUNT = -1;
 
         private int mSpanCount = DEFAULT_SPAN_COUNT;
 
index 7772a4f..ec01688 100755 (executable)
@@ -56,7 +56,7 @@ namespace Tizen.NUI.Components
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly int INVALID_OFFSET = -2147483648;
 
-        private static readonly float MAX_SCROLL_FACTOR = 1 / 3f;
+        private const float MAX_SCROLL_FACTOR = 1 / 3f;
 
         /// <summary>
         /// Current orientation.
@@ -1081,17 +1081,17 @@ namespace Tizen.NUI.Components
         // Helper class that keeps temporary state while {LayoutManager} is filling out the empty space.
         internal class LayoutState
         {
-            public static readonly int LAYOUT_START = -1;
+            public const int LAYOUT_START = -1;
 
-            public static readonly int LAYOUT_END = 1;
+            public const int LAYOUT_END = 1;
 
-            public static readonly int INVALID_LAYOUT = -1000;
+            public const int INVALID_LAYOUT = -1000;
 
-            public static readonly int ITEM_DIRECTION_HEAD = -1;
+            public const int ITEM_DIRECTION_HEAD = -1;
 
-            public static readonly int ITEM_DIRECTION_TAIL = 1;
+            public const int ITEM_DIRECTION_TAIL = 1;
 
-            public static readonly int SCROLLING_OFFSET_NaN = -10000;
+            public const int SCROLLING_OFFSET_NaN = -10000;
 
             // We may not want to recycle children in some cases (e.g. layout)
             public bool Recycle = true;
index 572b190..2b76fc5 100755 (executable)
@@ -27,10 +27,10 @@ namespace Tizen.NUI.Components
     // @see #createVerticalHelper(RecyclerView.LayoutManager)
     internal abstract class OrientationHelper
     {
-        public static readonly int HORIZONTAL = 0;
-        public static readonly int VERTICAL = 1;
+        public const int HORIZONTAL = 0;
+        public const int VERTICAL = 1;
 
-        private static readonly int INVALID_SIZE = -1;
+        private const int INVALID_SIZE = -1;
 
         protected FlexibleView.LayoutManager mLayoutManager;
 
index 5885c81..104ae6a 100755 (executable)
@@ -31,7 +31,7 @@ namespace Tizen.NUI.Components
     [EditorBrowsable(EditorBrowsableState.Never)]
     public class Title : TextLabel
     {
-        private static readonly string VERTEX_SHADER =
+        private const string VERTEX_SHADER =
                         "attribute mediump vec2 aPosition;\n" +
                         "varying mediump vec2 vTexCoord;\n" +
                         "uniform highp mat4 uMvpMatrix;\n" +
@@ -43,7 +43,7 @@ namespace Tizen.NUI.Components
                         "   vTexCoord = aPosition + vec2(0.5);\n" +
                         "}\n";
 
-        private static readonly string FRAGMENT_SHADER =
+        private const string FRAGMENT_SHADER =
                         "uniform lowp vec4 uColor;\n" +
                         "varying mediump vec2 vTexCoord;\n" +
                         "uniform sampler2D sTexture;\n" +