Make Dialog APIs public
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 14 Apr 2021 16:13:05 +0000 (01:13 +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 Dialog APIs public.

This pull request includes properties and methods of DialogPage, Dialog,
AlertDialog and AlertDialogStyle classes.

src/Tizen.NUI.Components/Controls/AlertDialog.cs
src/Tizen.NUI.Components/Controls/Dialog.cs
src/Tizen.NUI.Components/Controls/Navigation/DialogPage.cs
src/Tizen.NUI.Components/Style/AlertDialogStyle.cs

index b1b3ee5..0bf56a8 100755 (executable)
@@ -25,7 +25,7 @@ namespace Tizen.NUI.Components
     /// <summary>
     /// AlertDialog class shows a dialog with title, message and action buttons.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class AlertDialog : Control
     {
         private string title = null;
@@ -50,16 +50,33 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of AlertDialog.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public AlertDialog() : base()
         {
             Initialize();
         }
 
         /// <summary>
-        /// Dispose AlertDialog and all children on it.
+        /// Creates a new instance of AlertDialog.
+        /// </summary>
+        /// <param name="style">Creates AlertDialog by special style defined in UX.</param>
+        /// <since_tizen> 9 </since_tizen>
+        public AlertDialog(string style) : base(style)
+        {
+            Initialize();
+        }
+
+        /// <summary>
+        /// Creates a new instance of AlertDialog.
         /// </summary>
-        /// <param name="type">Dispose type.</param>
+        /// <param name="alertDialogStyle">Creates AlertDialog by style customized by user.</param>
+        /// <since_tizen> 9 </since_tizen>
+        public AlertDialog(AlertDialogStyle alertDialogStyle) : base(alertDialogStyle)
+        {
+            Initialize();
+        }
+
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
@@ -100,7 +117,7 @@ namespace Tizen.NUI.Components
         /// Applies style to AlertDialog.
         /// </summary>
         /// <param name="viewStyle">The style to apply.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public override void ApplyStyle(ViewStyle viewStyle)
         {
             styleApplied = false;
@@ -133,8 +150,10 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// Title text of AlertDialog.
+        /// Title text is set to TitleContent's Text if TitleContent is TextLabel.
+        /// If TitleContent's Text is set manually by user, then it is not guaranteed that TitleContent's Text is the same with Title text.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public string Title
         {
             get
@@ -158,9 +177,12 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Title content of AlertDialog. TitleContent is added to Children automatically.
+        /// Title content of AlertDialog.
+        /// TitleContent is added as a child of AlertDialog automatically.
+        /// Title text is set to TitleContent's Text if TitleContent is TextLabel.
+        /// If TitleContent's Text is set manually by user, then it is not guaranteed that TitleContent's Text is the same with Title text.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public View TitleContent
         {
             get
@@ -196,8 +218,10 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// Message text of AlertDialog.
+        /// Message text is set to Content's Text if Content is TextLabel.
+        /// If Content's Text is set manually by user, then it is not guaranteed that Content's Text is the same with Message text.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public string Message
         {
             get
@@ -221,9 +245,12 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Content of AlertDialog. Content is added to Children automatically.
+        /// Content of AlertDialog.
+        /// Content is added as a child of AlertDialog automatically.
+        /// Message text is set to Content's Text if Content is TextLabel.
+        /// If Content's Text is set manually by user, then it is not guaranteed that Content's Text is the same with Message text.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public View Content
         {
             get
@@ -259,9 +286,10 @@ namespace Tizen.NUI.Components
 
         /// <summary>
         /// Action views of AlertDialog.
-        /// Action views are added to ActionContent of AlertDialog.
+        /// Action views are added as children of ActionContent.
+        /// When Actions are set, previous Actions are removed from ActionContent.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public IEnumerable<View> Actions
         {
             get
@@ -302,9 +330,11 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Action content of AlertDialog. ActionContent is added to Children automatically.
+        /// Action content of AlertDialog.
+        /// ActionContent is added as a child of AlertDialog automatically.
+        /// Actions are added as children of ActionContent.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public View ActionContent
         {
              get
index 5abe7eb..4ca15dd 100644 (file)
@@ -22,9 +22,9 @@ using Tizen.NUI.BaseComponents;
 namespace Tizen.NUI.Components
 {
     /// <summary>
-    /// Dialog class shows a popup content with background scrim.
+    /// Dialog class shows a dialog with content.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class Dialog : Control
     {
         private View content = null;
@@ -32,7 +32,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of Dialog.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public Dialog() : base()
         {
             Layout = new AbsoluteLayout();
@@ -40,10 +40,7 @@ namespace Tizen.NUI.Components
             this.Relayout += OnRelayout;
         }
 
-        /// <summary>
-        /// Dispose Dialog and all children on it.
-        /// </summary>
-        /// <param name="type">Dispose type.</param>
+        /// <inheritdoc/>
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
@@ -66,9 +63,10 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Popup content of Dialog. Content is added to Children automatically.
+        /// Popup content of Dialog.
+        /// Content is added as a child of Dialog automatically.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public View Content
         {
             get
index ff032a8..47444c3 100755 (executable)
@@ -25,7 +25,7 @@ namespace Tizen.NUI.Components
     /// The DialogPage class is a class which shows a dialog on the page.
     /// DialogPage contains dialog and dimmed scrim behind the dialog.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class DialogPage : Page
     {
         private View content = null;
@@ -35,7 +35,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Creates a new instance of a DialogPage.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public DialogPage() : base()
         {
             Layout = new AbsoluteLayout();
@@ -80,9 +80,11 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
-        /// Content of DialogPage. Content is added to Children automatically.
+        /// Content of DialogPage.
+        /// Content is used as dialog, so Content is displayed above the dimmed scrim.
+        /// Content is added as a child of DialogPage automatically.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public View Content
         {
             get
@@ -111,15 +113,24 @@ namespace Tizen.NUI.Components
 
                 if (Scrim != null)
                 {
-                    content.RaiseAbove(Scrim);
+                    foreach (var child in Children)
+                    {
+                        if (child != Scrim)
+                        {
+                            // All children are above Scrim not to be covered by Scrim.
+                            child.RaiseAbove(Scrim);
+                        }
+                    }
                 }
             }
         }
 
         /// <summary>
-        /// Scrim of DialogPage. Scrim is added to Children automatically.
+        /// Scrim of DialogPage.
+        /// Scrim is the dimmed screen region behind dialog.
+        /// Scrim is added as a child of DialogPage automatically.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         protected View Scrim
         {
             get
@@ -146,9 +157,13 @@ namespace Tizen.NUI.Components
 
                 Add(scrim);
 
-                if (Content != null)
+                foreach (var child in Children)
                 {
-                    Content.RaiseAbove(scrim);
+                    if (child != scrim)
+                    {
+                        // All children are above Scrim not to be covered by Scrim.
+                        child.RaiseAbove(scrim);
+                    }
                 }
 
                 if (EnableScrim != Scrim.Visibility)
@@ -168,7 +183,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Indicates to show scrim behind dialog.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public bool EnableScrim
         {
             get
@@ -201,13 +216,13 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// Indicates to dismiss dialog by touching on scrim.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public bool EnableDismissOnScrim { get; set; } = true;
 
         /// <summary>
         /// The color of scrim.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public Color ScrimColor
         {
             get
@@ -246,7 +261,7 @@ namespace Tizen.NUI.Components
         /// Shows a dialog by pushing a dialog page containing dialog to default navigator.
         /// </summary>
         /// <param name="content">The content of Dialog.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         [SuppressMessage("Microsoft.Reliability",
                          "CA2000:DisposeObjectsBeforeLosingScope",
                          Justification = "The pushed views are added to NavigationPages and are disposed in Navigator.Dispose().")]
@@ -270,7 +285,7 @@ namespace Tizen.NUI.Components
         /// <param name="title">The title of AlertDialog.</param>
         /// <param name="message">The message of AlertDialog.</param>
         /// <param name="actions">The action views of AlertDialog.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         [SuppressMessage("Microsoft.Reliability",
                          "CA2000:DisposeObjectsBeforeLosingScope",
                          Justification = "The pushed views are added to NavigationPages and are disposed in Navigator.Dispose().")]
index 0cc8ed8..eb4b0f7 100755 (executable)
@@ -21,27 +21,28 @@ using Tizen.NUI.Binding;
 namespace Tizen.NUI.Components
 {
     /// <summary>
-    /// AlertDialogStyle is a class which saves AlertDialog's ux data.
+    /// AlertDialogStyle is a class which saves AlertDialog's UX data.
     /// </summary>
-    [EditorBrowsable(EditorBrowsableState.Never)]
+    /// <since_tizen> 9 </since_tizen>
     public class AlertDialogStyle : ButtonStyle
     {
         [EditorBrowsable(EditorBrowsableState.Never)]
         static AlertDialogStyle() { }
 
         /// <summary>
-        /// Creates a new instance of a AlertDialogStyle.
+        /// Creates a new instance of an AlertDialogStyle.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public AlertDialogStyle() : base()
         {
         }
 
         /// <summary>
-        /// Creates a new instance of a AlertDialogStyle with style.
+        /// Creates a new instance of an AlertDialogStyle with style.
+        /// The given style is copied to the new instance.
         /// </summary>
         /// <param name="style">Create AlertDialogStyle by style customized by user.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public AlertDialogStyle(AlertDialogStyle style) : base(style)
         {
         }
@@ -50,27 +51,24 @@ namespace Tizen.NUI.Components
         /// Gets or sets the AlertDialog Title TextLabel style.
         /// This style is applied if AlertDialog TitleContent is a TextLabel.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TextLabelStyle TitleTextLabel { get; set; } = new TextLabelStyle();
 
         /// <summary>
         /// Gets or sets the AlertDialog Message TextLabel style.
         /// This style is applied if AlertDialog Content is a TextLabel.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public TextLabelStyle MessageTextLabel { get; set; } = new TextLabelStyle();
 
         /// <summary>
         /// Gets or sets the AlertDialog ActionContent style.
         /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 9 </since_tizen>
         public ViewStyle ActionContent { get; set; } = new ViewStyle();
 
-        /// <summary>
-        /// Style's clone function.
-        /// </summary>
-        /// <param name="bindableObject">The style that need to copy.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <inheritdoc/>
+        /// <since_tizen> 9 </since_tizen>
         public override void CopyFrom(BindableObject bindableObject)
         {
             base.CopyFrom(bindableObject);