[NUI] Make Pagination class public and fix CA warnings (#1777)
authorSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Thu, 9 Jul 2020 08:02:20 +0000 (17:02 +0900)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2020 08:02:20 +0000 (17:02 +0900)
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
src/Tizen.NUI.Components/Controls/Pagination.cs
src/Tizen.NUI.Components/PreloadStyle/DefaultTheme.cs
src/Tizen.NUI.Components/PreloadStyle/WearableTheme.cs
src/Tizen.NUI.Components/Style/PaginationStyle.cs
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/PaginationSample.cs

index a403af8..08c4587 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,9 +24,7 @@ namespace Tizen.NUI.Components
     /// <summary>
     /// Pagination shows the number of pages available and the currently active page.
     /// </summary>
-    /// <since_tizen> 6 </since_tizen>
-    /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 8 </since_tizen>
     public class Pagination: Control
     {
         private VisualView container;
@@ -41,9 +39,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of a Pagination.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-           /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-           [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public Pagination() : base()
         {
             Initialize();
@@ -52,9 +48,8 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of a Pagination using style.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <param name="style">The string to initialize the Pagination</param>
+        /// <since_tizen> 8 </since_tizen>
         public Pagination(string style) : base(style)
         {
             Initialize();
@@ -63,9 +58,8 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of a Pagination using style.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <param name="paginationStyle">The style object to initialize the Pagination</param>
+        /// <since_tizen> 8 </since_tizen>
         public Pagination(PaginationStyle paginationStyle) : base(paginationStyle)
         {
             Initialize();
@@ -74,16 +68,13 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Get style of pagination.
         /// </summary>
-        /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public new PaginationStyle Style => ViewStyle as PaginationStyle;
 
         /// <summary>
         /// Gets or sets the size of the indicator.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public Size IndicatorSize
         {
             get
@@ -104,14 +95,12 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets or sets the background resource of indicator.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public Selector<string> IndicatorImageURL
+        /// <since_tizen> 8 </since_tizen>
+        public Selector<string> IndicatorImageUrl
         {
             get
             {
-                return Style?.IndicatorImageURL;
+                return Style?.IndicatorImageUrl;
             }
             set
             {
@@ -119,7 +108,7 @@ namespace Tizen.NUI.Components
                 {
                     return;
                 }
-                Style.IndicatorImageURL = value;
+                Style.IndicatorImageUrl = value;
                 UpdateVisual();
             }
         }
@@ -127,9 +116,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets or sets the space of the indicator.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public int IndicatorSpacing
         {
             get
@@ -147,9 +134,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets or sets the count of the pages/indicators.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public int IndicatorCount
         {
             get
@@ -177,11 +162,7 @@ namespace Tizen.NUI.Components
                         container.RemoveVisual("Indicator" + i);
                     }
                     indicatorList.RemoveRange(value, indicatorCount - value);
-                    //if(value <= 0)
-                    //{
-                    //    container.RemoveVisual("SelectIndicator");
-                    //}
-                    //else
+
                     if (selectedIndex >= value)
                     {
                         selectedIndex = 0;
@@ -197,9 +178,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets or sets the index of the select indicator.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public int SelectedIndex
         {
             get
@@ -228,9 +207,8 @@ namespace Tizen.NUI.Components
         /// Retrieves the position of a indicator by index.
         /// </summary>
         /// <param name="index">Indicator index</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <returns>The position of a indicator by index.</returns>
+        /// <since_tizen> 8 </since_tizen>
         public Position GetIndicatorPosition(int index)
         {
             if (index < 0 || index >= indicatorList.Count)
@@ -244,13 +222,11 @@ namespace Tizen.NUI.Components
         /// You can override it to do your select out operation.
         /// </summary>
         /// <param name="selectOutIndicator">The indicator will be selected out</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         protected virtual void SelectOut(VisualMap selectOutIndicator)
         {
             if (!(selectOutIndicator is ImageVisual visual)) return;
-            visual.URL = Style?.IndicatorImageURL.Normal;
+            visual.URL = Style?.IndicatorImageUrl.Normal;
             visual.Opacity = 0.5f;
         }
 
@@ -258,22 +234,19 @@ namespace Tizen.NUI.Components
         /// You can override it to do your select in operation.
         /// </summary>
         /// <param name="selectInIndicator">The indicator will be selected in</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         protected virtual void SelectIn(VisualMap selectInIndicator)
         {
             if (!(selectInIndicator is ImageVisual visual)) return;
-            visual.URL = Style?.IndicatorImageURL.Selected;
+            visual.URL = Style?.IndicatorImageUrl.Selected;
             visual.Opacity = 1.0f;
         }
 
         /// <summary>
         /// you can override it to create your own default style.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <returns>The default pagination style.</returns>
+        /// <since_tizen> 8 </since_tizen>
         protected override ViewStyle CreateViewStyle()
         {
             return new PaginationStyle();
@@ -283,9 +256,7 @@ namespace Tizen.NUI.Components
         /// you can override it to clean-up your own resources.
         /// </summary>
         /// <param name="type">DisposeTypes</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         protected override void Dispose(DisposeTypes type)
         {
             if (disposed)
@@ -326,11 +297,11 @@ namespace Tizen.NUI.Components
             }
             ImageVisual indicator = new ImageVisual
             {
-                URL = Style.IndicatorImageURL.Normal,
+                URL = Style.IndicatorImageUrl.Normal,
                 Size = new Size2D((int)Style.IndicatorSize.Width, (int)Style.IndicatorSize.Height),
                 Opacity = 0.5f,
             };
-            indicator.Position = new Position2D((int)(Style.IndicatorSize.Width + Style.IndicatorSpacing) * indicatorList.Count, 0);
+            indicator.Position = new Vector2((int)(Style.IndicatorSize.Width + Style.IndicatorSpacing) * indicatorList.Count, 0);
             container.AddVisual("Indicator" + indicatorList.Count, indicator);
             indicatorList.Add(indicator);
         }
@@ -356,15 +327,15 @@ namespace Tizen.NUI.Components
         private void UpdateVisual()
         {
             if (null == Style.IndicatorSize) return;
-            if (null == Style.IndicatorImageURL) return;
+            if (null == Style.IndicatorImageUrl) return;
             if (indicatorCount < 0) return;
 
             for (int i = 0; i < indicatorList.Count; i++)
             {
                 ImageVisual indicator = indicatorList[i];
-                indicator.URL = Style.IndicatorImageURL.Normal;
+                indicator.URL = Style.IndicatorImageUrl.Normal;
                 indicator.Size = new Size2D((int)Style.IndicatorSize.Width, (int)Style.IndicatorSize.Height);
-                indicator.Position = new Position2D((int)(Style.IndicatorSize.Width + Style.IndicatorSpacing) * i, 0);
+                indicator.Position = new Vector2((int)(Style.IndicatorSize.Width + Style.IndicatorSpacing) * i, 0);
             }
         }
     }
index 8aba40e..c02534f 100755 (executable)
@@ -432,7 +432,7 @@ namespace Tizen.NUI.Components
         {
             return new PaginationStyle
             {
-                IndicatorImageURL = new Selector<string>()
+                IndicatorImageUrl = new Selector<string>()
                 {
                     Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
                     Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),
index 68ee411..35ffe80 100644 (file)
@@ -135,7 +135,7 @@ namespace Tizen.NUI.Components
         {
             return new PaginationStyle
             {
-                IndicatorImageURL = new Selector<string>()
+                IndicatorImageUrl = new Selector<string>()
                 {
                     Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
                     Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),
index 962391e..1b59161 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,9 +23,7 @@ namespace Tizen.NUI.Components
     /// <summary>
     /// PaginationStyle used to config the pagination represent.
     /// </summary>
-    /// <since_tizen> 6 </since_tizen>
-    /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 8 </since_tizen>
     public class PaginationStyle : ControlStyle
     {
         static PaginationStyle() { }
@@ -33,17 +31,14 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of a PaginationStyle.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public PaginationStyle() : base() { }
 
         /// <summary>
         /// Creates a new instance of a PaginationStyle using style.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <param name="style">Create PaginationStyle by style customized by user.</param>
+        /// <since_tizen> 8 </since_tizen>
         public PaginationStyle(PaginationStyle style) : base(style)
         {
             if (null == style) return;
@@ -54,33 +49,26 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets or sets the size of the indicator.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public Size IndicatorSize { get; set; }
 
         /// <summary>
         /// Gets or sets the resource of indicator.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public Selector<string> IndicatorImageURL { get; set; } = new Selector<string>();
+        /// <since_tizen> 8 </since_tizen>
+        public Selector<string> IndicatorImageUrl { get; set; } = new Selector<string>();
 
         /// <summary>
         /// Gets or sets the space of the indicator.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public int IndicatorSpacing { get; set; }
 
         /// <summary>
         /// Retrieves a copy of PaginationStyle.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <param name="bindableObject">The style that need to copy.</param>
+        /// <since_tizen> 8 </since_tizen>
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);
@@ -92,9 +80,9 @@ namespace Tizen.NUI.Components
                 {
                     IndicatorSize = new Size(paginationStyle.IndicatorSize.Width, paginationStyle.IndicatorSize.Height);
                 }
-                if (null != paginationStyle.IndicatorImageURL)
+                if (null != paginationStyle.IndicatorImageUrl)
                 {
-                    IndicatorImageURL?.Clone(paginationStyle.IndicatorImageURL);
+                    IndicatorImageUrl?.Clone(paginationStyle.IndicatorImageUrl);
                 }
                 IndicatorSpacing = paginationStyle.IndicatorSpacing;
             }
index 237e3c5..f6dda15 100755 (executable)
@@ -64,7 +64,7 @@ namespace Tizen.NUI.Samples
             {
                 IndicatorSize = new Size(26, 26),
                 IndicatorSpacing = 8,
-                IndicatorImageURL = new Selector<string>
+                IndicatorImageUrl = new Selector<string>
                 {
                     Normal = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_nor.png",
                     Selected = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_sel.png"
@@ -83,7 +83,7 @@ namespace Tizen.NUI.Samples
             {
                 IndicatorSize = new Size(15, 15),
                 IndicatorSpacing = 20,
-                IndicatorImageURL = new Selector<string>
+                IndicatorImageUrl = new Selector<string>
                 {
                     Normal = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_nor.png",
                     Selected = CommonResource.GetFHResourcePath() + "9. Controller/pagination_ic_sel.png"