Make TabView APIs public
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 14 Apr 2021 16:23:51 +0000 (01:23 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 7 May 2021 03:54:19 +0000 (12:54 +0900)
This is ACR patch to make TabView APIs public.

This pull request includes properties and methods of TabView, TabBar,
TabButton, TabButtonstyle and TabContent classes.

src/Tizen.NUI.Components/Controls/TabBar.cs
src/Tizen.NUI.Components/Controls/TabButton.cs
src/Tizen.NUI.Components/Controls/TabContent.cs
src/Tizen.NUI.Components/Controls/TabView.cs
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/TabViewSample.cs

index e9f8967..2028151 100755 (executable)
@@ -30,8 +30,10 @@ namespace Tizen.NUI.Components
     {
         /// <summary>
         /// Creates a new instance of TabButtonSelectedEventArgs.
+        /// The indices of tab buttons in TabBar are basically the order of adding to TabBar by <see cref="TabView.AddTab"/>.
+        /// So a tab button's index in TabBar can be changed whenever <see cref="TabView.AddTab"/> or <see cref="TabView.RemoveTab"/> is called.
         /// </summary>
-        /// <param name="index">The selected index.</param>
+        /// <param name="index">The index of the selected tab button in TabBar.</param>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public TabButtonSelectedEventArgs(int index)
         {
@@ -48,7 +50,7 @@ namespace Tizen.NUI.Components
     /// <summary>
     /// TabBar is a class which contains a set of TabButtons and has one of them selected.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class TabBar : Control
     {
         private IList<TabButton> tabButtons;
@@ -58,7 +60,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of TabBar.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TabBar()
         {
             Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal };
@@ -79,6 +81,8 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// The index of the selected tab button.
+        /// The indices of tab buttons in TabBar are basically the order of adding to TabBar by <see cref="TabView.AddTab"/>.
+        /// So a tab button's index in TabBar can be changed whenever <see cref="TabView.AddTab"/> or <see cref="TabView.RemoveTab"/> is called.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected int SelectedIndex { get; set; }
@@ -86,7 +90,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets the count of tab buttons.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public int TabButtonCount => tabButtons.Count;
 
         /// <summary>
@@ -187,6 +191,7 @@ namespace Tizen.NUI.Components
         }
 
         /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
         public override void OnRelayout(Vector2 size, RelayoutContainer container)
         {
             base.OnRelayout(size, container);
@@ -215,10 +220,12 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// Gets the tab button at the specified index of TabBar.
+        /// The indices of tab buttons in TabBar are basically the order of adding to TabBar by <see cref="TabView.AddTab"/>.
+        /// So a tab button's index in TabBar can be changed whenever <see cref="TabView.AddTab"/> or <see cref="TabView.RemoveTab"/> is called.
         /// </summary>
-        /// <param name="index">The index of TabBar where the specified tab button exists.</param>
+        /// <param name="index">The index of tab button in TabBar where the specified tab button exists.</param>
         /// <exception cref="ArgumentOutOfRangeException">Thrown when the index is less than 0, or greater than or equal to the number of tab buttons.</exception>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TabButton GetTabButton(int index)
         {
             if ((index < 0) || (index >= tabButtons.Count))
@@ -229,10 +236,7 @@ namespace Tizen.NUI.Components
             return tabButtons[index];
         }
 
-        /// <summary>
-        /// Dispose TabBar and all children on it.
-        /// </summary>
-        /// <param name="type">Dispose type.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
index 2805129..5db6e7a 100755 (executable)
@@ -23,7 +23,7 @@ namespace Tizen.NUI.Components
     /// <summary>
     /// TabButton is a class which is used for selecting one content in a TabView.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class TabButton : SelectButton
     {
         private bool selectedAgain = false;
@@ -38,7 +38,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of TabButton.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TabButton()
         {
             Initialize();
@@ -64,10 +64,7 @@ namespace Tizen.NUI.Components
             Initialize();
         }
 
-        /// <summary>
-        /// Applies style to TabButton.
-        /// </summary>
-        /// <param name="viewStyle">The style to apply.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         public override void ApplyStyle(ViewStyle viewStyle)
         {
@@ -126,10 +123,7 @@ namespace Tizen.NUI.Components
             return ret;
         }
 
-        /// <summary>
-        /// Dispose TabButton and all children on it.
-        /// </summary>
-        /// <param name="type">Dispose type.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
index a298f8f..4419318 100755 (executable)
@@ -24,7 +24,7 @@ namespace Tizen.NUI.Components
     /// <summary>
     /// TabContent is a class which contains a set of Views and has one of them selected.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class TabContent : Control
     {
         private IList<View> views;
@@ -32,7 +32,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of TabContent.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TabContent()
         {
             SelectedIndex = -1;
@@ -41,6 +41,8 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// The index of the selected view.
+        /// The indices of views in TabContent are basically the order of adding to TabContent by <see cref="TabView.AddTab"/>.
+        /// So a view's index in TabContent can be changed whenever <see cref="TabView.AddTab"/> or <see cref="TabView.RemoveTab"/> is called.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected int SelectedIndex { get; set; }
@@ -48,7 +50,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets the count of views.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public int ViewCount => views.Count;
 
         /// <summary>
@@ -110,8 +112,10 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// Selects a view at the specified index of TabContent.
+        /// The indices of views in TabContent are basically the order of adding to TabContent by <see cref="TabView.AddTab"/>.
+        /// So a view's index in TabContent can be changed whenever <see cref="TabView.AddTab"/> or <see cref="TabView.RemoveTab"/> is called.
         /// </summary>
-        /// <param name="index">The index of TabContent where a view will be selected.</param>
+        /// <param name="index">The index of a view in TabContent where the view will be selected.</param>
         /// <exception cref="ArgumentOutOfRangeException">Thrown when the index is less than -1, or greater than or equal to the number of views.</exception>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected internal void Select(int index)
@@ -136,10 +140,12 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// Gets the view at the specified index of TabContent.
+        /// The indices of views in TabContent are basically the order of adding to TabContent by <see cref="TabView.AddTab"/>.
+        /// So a view's index in TabContent can be changed whenever <see cref="TabView.AddTab"/> or <see cref="TabView.RemoveTab"/> is called.
         /// </summary>
-        /// <param name="index">The index of TabContent where the specified view exists.</param>
+        /// <param name="index">The index of a view in TabContent where the specified view exists.</param>
         /// <exception cref="ArgumentOutOfRangeException">Thrown when the index is less than 0, or greater than or equal to the number of views.</exception>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public View GetView(int index)
         {
             if ((index < 0) || (index >= views.Count))
@@ -150,10 +156,7 @@ namespace Tizen.NUI.Components
             return views[index];
         }
 
-        /// <summary>
-        /// Dispose TabContent and all children on it.
-        /// </summary>
-        /// <param name="type">Dispose type.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
index 134f246..c8fbfc1 100755 (executable)
@@ -21,10 +21,64 @@ using Tizen.NUI.BaseComponents;
 namespace Tizen.NUI.Components
 {
     /// <summary>
-    /// TabView is a class which contains a TabBar and TabContent and
-    /// selects a view from the TabContent according to the selected TabButton in the TabBar.
+    /// TabView is a class which contains a TabBar and TabContent.
+    /// TabView adds TabButtons and Views to TabBar and TabContent in TabView by <see cref="TabView.AddTab"/>.
+    /// TabView removes TabButtons and Views from TabBar and TabContent in TabView by <see cref="TabView.RemoveTab"/>.
+    /// TabView selects a view from the TabContent according to the selected TabButton in the TabBar.
+    ///
+    /// <example>
+    /// <code>
+    /// var tabView = new TabView()
+    /// {
+    ///     WidthSpecification = LayoutParamPolicies.MatchParent,
+    ///     HeightSpecification = LayoutParamPolicies.MatchParent,
+    /// };
+    ///
+    /// var tabButton = new TabButton()
+    /// {
+    ///     Text = "Tab#1"
+    /// };
+    ///
+    /// var content = new View()
+    /// {
+    ///     BackgroundColor = Color.Red,
+    ///     WidthSpecification = LayoutParamPolicies.MatchParent,
+    ///     HeightSpecification = LayoutParamPolicies.MatchParent,
+    /// };
+    ///
+    /// tabView.AddTab(tabButton, content);
+    ///
+    /// var tabButton2 = new TabButton()
+    /// {
+    ///     Text = "Tab#2"
+    /// };
+    ///
+    /// var content2 = new View()
+    /// {
+    ///     BackgroundColor = Color.Green,
+    ///     WidthSpecification = LayoutParamPolicies.MatchParent,
+    ///     HeightSpecification = LayoutParamPolicies.MatchParent,
+    /// };
+    ///
+    /// tabView.AddTab(tabButton2, content2);
+    ///
+    /// var tabButton3 = new TabButton()
+    /// {
+    ///     Text = "Tab#3"
+    /// };
+    ///
+    /// var content3 = new View()
+    /// {
+    ///     BackgroundColor = Color.Blue,
+    ///     WidthSpecification = LayoutParamPolicies.MatchParent,
+    ///     HeightSpecification = LayoutParamPolicies.MatchParent,
+    /// };
+    ///
+    /// tabView.AddTab(tabButton3, content3);
+    /// </code>
+    /// </example>
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class TabView : Control
     {
         private TabBar tabBar = null;
@@ -34,7 +88,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of TabView.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TabView()
         {
             Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical };
@@ -83,7 +137,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets TabBar of TabView.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TabBar TabBar
         {
             get
@@ -95,7 +149,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Gets TabContent of TabView.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TabContent Content
         {
             get
@@ -109,7 +163,7 @@ namespace Tizen.NUI.Components
         /// </summary>
         /// <param name="tabButton">A tab button to be added.</param>
         /// <param name="view">A content view to be added.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public void AddTab(TabButton tabButton, View view)
         {
             if (TabBar != null)
@@ -125,10 +179,12 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// Removes a tab at the specified index of TabView.
+        /// The indices of tabs(tab buttons and views) in TabView are basically the order of adding to TabView by <see cref="TabView.AddTab"/>.
+        /// So the index of a tab(tab button and view) in TabView can be changed whenever <see cref="TabView.AddTab"/> or <see cref="TabView.RemoveTab"/> is called.
         /// </summary>
-        /// <param name="index">The index of TabView where a tab will be removed.</param>
+        /// <param name="index">The index of a tab(tab button and view) in TabView where the tab will be removed.</param>
         /// <exception cref="ArgumentOutOfRangeException">Thrown when the index is less than 0, or greater than or equal to the number of tabs.</exception>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public void RemoveTab(int index)
         {
             var tabButton = TabBar.GetTabButton(index);
@@ -144,10 +200,7 @@ namespace Tizen.NUI.Components
             }
         }
 
-        /// <summary>
-        /// Dispose TabView and all children on it.
-        /// </summary>
-        /// <param name="type">Dispose type.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
index 772b857..1c0d926 100644 (file)
@@ -19,8 +19,8 @@ namespace Tizen.NUI.Samples
 
             tabView = new TabView()
             {
-                WidthResizePolicy = ResizePolicyType.FillToParent,
-                HeightResizePolicy = ResizePolicyType.FillToParent
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = LayoutParamPolicies.MatchParent,
             };
 
             tabCount = 0;
@@ -37,7 +37,7 @@ namespace Tizen.NUI.Samples
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = LayoutParamPolicies.MatchParent,
                 HorizontalAlignment = HorizontalAlignment.Center,
-                VerticalAlignment = VerticalAlignment.Center
+                VerticalAlignment = VerticalAlignment.Center,
             };
 
             tabView.AddTab(tabButton, content);