From: dongsug-song <35130733+dongsug-song@users.noreply.github.com> Date: Tue, 8 Oct 2019 01:57:05 +0000 (+0900) Subject: [NUI] Open public apis of NUI.Components for TCSACR-248 (#1061) X-Git-Tag: 5.5_M2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab5d2b9eed635052d6d718cdd697fbc439bc63f8;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Open public apis of NUI.Components for TCSACR-248 (#1061) * [NUI.Components] Open public apis of Components for ACR * [AudioManager] Changed handle type to marshal from unmanaged (#1027) * [NUI]Changed the APIs related to MultiWIndow to public (#1020) * [ComponentBased] Fix Log Tags (#1030) Currently, the log tag is too long. This patch changes the log tag to "Tizen.Applications". Signed-off-by: Hwankyu Jhun * [NUI.Components] fix Button TextPadding issue * Update Position.cs Set default parameter * Update Size.cs Set Default parameter * Update Position.cs * Update Size.cs --- diff --git a/src/Tizen.NUI.Components/Attributes/DropDownAttributes.cs b/src/Tizen.NUI.Components/Attributes/DropDownAttributes.cs index c1a85f8..b9b9002 100755 --- a/src/Tizen.NUI.Components/Attributes/DropDownAttributes.cs +++ b/src/Tizen.NUI.Components/Attributes/DropDownAttributes.cs @@ -79,9 +79,9 @@ namespace Tizen.NUI.Components ListMargin = new Vector4(attributes.ListMargin.X, attributes.ListMargin.Y, attributes.ListMargin.Z, attributes.ListMargin.W); } - if (attributes.ListSize2D != null) + if (attributes.ListSize != null) { - ListSize2D = new Size2D(attributes.ListSize2D.Width, attributes.ListSize2D.Height); + ListSize = new Size(attributes.ListSize.Width, attributes.ListSize.Height); } if (attributes.ListPadding != null) @@ -196,7 +196,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D ListSize2D + public Size ListSize { get; set; diff --git a/src/Tizen.NUI.Components/Attributes/LoadingAttributes.cs b/src/Tizen.NUI.Components/Attributes/LoadingAttributes.cs index 55aad10..0d8b874 100755 --- a/src/Tizen.NUI.Components/Attributes/LoadingAttributes.cs +++ b/src/Tizen.NUI.Components/Attributes/LoadingAttributes.cs @@ -48,9 +48,9 @@ namespace Tizen.NUI.Components return; } - if (null != attributes.FPS) + if (null != attributes.FrameRate) { - FPS = attributes.FPS.Clone() as IntSelector; + FrameRate = attributes.FrameRate.Clone() as IntSelector; } if (null != attributes.LoadingSize) { @@ -80,7 +80,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D LoadingSize + public Size LoadingSize { get; set; @@ -92,7 +92,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 IntSelector FPS + public IntSelector FrameRate { get; set; diff --git a/src/Tizen.NUI.Components/Attributes/PaginationAttributes.cs b/src/Tizen.NUI.Components/Attributes/PaginationAttributes.cs index 90d161e..b984150 100755 --- a/src/Tizen.NUI.Components/Attributes/PaginationAttributes.cs +++ b/src/Tizen.NUI.Components/Attributes/PaginationAttributes.cs @@ -48,7 +48,7 @@ namespace Tizen.NUI.Components if (attributes.IndicatorSize != null) { - IndicatorSize = new Size2D(attributes.IndicatorSize.Width, attributes.IndicatorSize.Height); + IndicatorSize = new Size(attributes.IndicatorSize.Width, attributes.IndicatorSize.Height); } if (attributes.IndicatorBackgroundURL != null) { @@ -67,7 +67,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D IndicatorSize + public Size IndicatorSize { get; set; diff --git a/src/Tizen.NUI.Components/Attributes/TabAttributes.cs b/src/Tizen.NUI.Components/Attributes/TabAttributes.cs index d2189fc..bab29ff 100755 --- a/src/Tizen.NUI.Components/Attributes/TabAttributes.cs +++ b/src/Tizen.NUI.Components/Attributes/TabAttributes.cs @@ -35,8 +35,8 @@ namespace Tizen.NUI.Components public TabAttributes() : base() { Space = new Vector4(0, 0, 0, 0); - IsNatureTextWidth = false; - ItemGap = 0; + UseTextNaturalSize = false; + ItemSpace = 0; } /// @@ -71,8 +71,8 @@ namespace Tizen.NUI.Components { Space = new Vector4(0, 0, 0, 0); } - ItemGap = attributes.ItemGap; - IsNatureTextWidth = attributes.IsNatureTextWidth; + ItemSpace = attributes.ItemSpace; + UseTextNaturalSize = attributes.UseTextNaturalSize; } /// @@ -105,7 +105,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 bool IsNatureTextWidth + public bool UseTextNaturalSize { get; set; @@ -117,7 +117,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 int ItemGap + public int ItemSpace { get; set; diff --git a/src/Tizen.NUI.Components/Attributes/ViewAttributes.cs b/src/Tizen.NUI.Components/Attributes/ViewAttributes.cs index 930633d..4bfd671 100755 --- a/src/Tizen.NUI.Components/Attributes/ViewAttributes.cs +++ b/src/Tizen.NUI.Components/Attributes/ViewAttributes.cs @@ -44,14 +44,14 @@ namespace Tizen.NUI.Components return; } - if (attributes.Position2D != null) + if (attributes.Position != null) { - Position2D = new Position2D(attributes.Position2D.X, attributes.Position2D.Y); + Position = new Position(attributes.Position.X, attributes.Position.Y, attributes.Position.Z); } - if (attributes.Size2D != null) + if (attributes.Size != null) { - Size2D = new Size2D(attributes.Size2D.Width, attributes.Size2D.Height); + Size = new Size(attributes.Size.Width, attributes.Size.Height, attributes.Size.Depth); } if (attributes.BackgroundColor != null) @@ -109,7 +109,7 @@ namespace Tizen.NUI.Components /// /// 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 Position2D Position2D + public Position Position { get; set; @@ -119,7 +119,7 @@ namespace Tizen.NUI.Components /// /// 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 Size2D Size2D + public Size Size { get; set; diff --git a/src/Tizen.NUI.Components/Controls/Button.cs b/src/Tizen.NUI.Components/Controls/Button.cs index 1c9ad4e..1eaaa2b 100755 --- a/src/Tizen.NUI.Components/Controls/Button.cs +++ b/src/Tizen.NUI.Components/Controls/Button.cs @@ -25,8 +25,6 @@ namespace Tizen.NUI.Components /// Button may contain text or an icon. /// /// 6 - /// 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 class Button : Control { private ImageView backgroundImage; @@ -37,7 +35,7 @@ namespace Tizen.NUI.Components private ImageView buttonIcon; private ButtonAttributes buttonAttributes; - private EventHandler stateChangeHander; + private EventHandler stateChangeHander; private bool isSelected = false; private bool isEnabled = true; @@ -46,8 +44,6 @@ namespace Tizen.NUI.Components /// Creates a new instance of a Button. /// /// 6 - /// 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 Button() : base() { Initialize(); @@ -78,16 +74,12 @@ namespace Tizen.NUI.Components /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.
/// /// 6 - /// 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 event EventHandler ClickEvent; /// /// An event for the button state changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
///
/// 6 - /// 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 event EventHandler StateChangedEvent + public event EventHandler StateChangedEvent { add { @@ -102,45 +94,33 @@ namespace Tizen.NUI.Components /// Icon orientation. /// /// 6 - /// 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 enum IconOrientation { /// /// Top. /// /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] Top, /// /// Bottom. /// /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] Bottom, /// /// Left. /// /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] Left, /// /// Right. /// /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] Right, } /// /// Flag to decide Button can be selected or not. /// /// 6 - /// 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 bool IsSelectable { get @@ -312,8 +292,6 @@ namespace Tizen.NUI.Components /// Text string in Button. /// /// 6 - /// 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 string Text { get @@ -339,8 +317,6 @@ namespace Tizen.NUI.Components /// Translate text string in Button. /// /// 6 - /// 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 string TranslatableText { get @@ -366,8 +342,6 @@ namespace Tizen.NUI.Components /// Text point size in Button. /// /// 6 - /// 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 float PointSize { get @@ -389,8 +363,6 @@ namespace Tizen.NUI.Components /// Text font family in Button. /// /// 6 - /// 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 string FontFamily { get @@ -408,8 +380,6 @@ namespace Tizen.NUI.Components /// Text color in Button. /// /// 6 - /// 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 Color TextColor { get @@ -431,8 +401,6 @@ namespace Tizen.NUI.Components /// Text horizontal alignment in Button. /// /// 6 - /// 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 HorizontalAlignment TextAlignment { get @@ -450,8 +418,6 @@ namespace Tizen.NUI.Components /// Icon image's resource url in Button. /// /// 6 - /// 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 string IconURL { get @@ -476,8 +442,6 @@ namespace Tizen.NUI.Components /// Text string selector in Button. /// /// 6 - /// 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 StringSelector TextSelector { get @@ -498,8 +462,6 @@ namespace Tizen.NUI.Components /// Translateable text string selector in Button. /// /// 6 - /// 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 StringSelector TranslatableTextSelector { get @@ -520,8 +482,6 @@ namespace Tizen.NUI.Components /// Text color selector in Button. /// /// 6 - /// 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 ColorSelector TextColorSelector { get @@ -542,8 +502,6 @@ namespace Tizen.NUI.Components /// Text font size selector in Button. /// /// 6 - /// 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 FloatSelector PointSizeSelector { get @@ -564,8 +522,6 @@ namespace Tizen.NUI.Components /// Icon image's resource url selector in Button. /// /// 6 - /// 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 StringSelector IconURLSelector { get @@ -718,8 +674,6 @@ namespace Tizen.NUI.Components /// Flag to decide selected state in Button. /// /// 6 - /// 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 bool IsSelected { get @@ -736,8 +690,6 @@ namespace Tizen.NUI.Components /// Flag to decide enable or disable in Button. /// /// 6 - /// 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 bool IsEnabled { get @@ -773,172 +725,73 @@ namespace Tizen.NUI.Components } } - /// - /// Icon left padding in Button, work only when show icon and text. - /// - /// 6 - /// 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 int IconPaddingLeft - { - get - { - return buttonAttributes?.IconAttributes?.PaddingLeft ?? 0; - } - set - { - CreateIconAttributes(); - buttonAttributes.IconAttributes.PaddingLeft = value; - RelayoutRequest(); - } - } - - /// - /// Icon right padding in Button, work only when show icon and text. - /// - /// 6 - /// 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 int IconPaddingRight - { - get - { - return buttonAttributes?.IconAttributes?.PaddingRight ?? 0; - } - set - { - CreateIconAttributes(); - buttonAttributes.IconAttributes.PaddingRight = value; - RelayoutRequest(); - } - } - - /// - /// Icon top padding in Button, work only when show icon and text. - /// - /// 6 - /// 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 int IconPaddingTop - { - get - { - return buttonAttributes?.IconAttributes?.PaddingTop ?? 0; - } - set - { - CreateIconAttributes(); - buttonAttributes.IconAttributes.PaddingTop = value; - RelayoutRequest(); - } - } - - /// - /// Icon bottom padding in Button, work only when show icon and text. - /// - /// 6 - /// 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 int IconPaddingBottom - { - get - { - return buttonAttributes?.IconAttributes?.PaddingBottom ?? 0; - } - set - { - CreateIconAttributes(); - buttonAttributes.IconAttributes.PaddingBottom = value; - RelayoutRequest(); - } - } - - /// - /// Text left padding in Button, work only when show icon and text. - /// - /// 6 - /// 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 int TextPaddingLeft - { - get - { - return buttonAttributes?.TextAttributes?.PaddingLeft ?? 0; - } - set - { - CreateTextAttributes(); - buttonAttributes.TextAttributes.PaddingLeft = value; - RelayoutRequest(); - } - } - - /// - /// Text right padding in Button, work only when show icon and text. + // + /// Icon padding in Button, work only when show icon and text. /// /// 6 - /// 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 int TextPaddingRight + public Extents IconPadding { get { - return buttonAttributes?.TextAttributes?.PaddingRight ?? 0; + if (null == buttonAttributes || null == buttonAttributes.IconAttributes) + { + return null; + } + else + { + return new Extents((ushort)buttonAttributes.IconAttributes.PaddingLeft, (ushort)buttonAttributes.IconAttributes.PaddingRight, (ushort)buttonAttributes.IconAttributes.PaddingTop, (ushort)buttonAttributes.IconAttributes.PaddingBottom); + } } set { - CreateTextAttributes(); - buttonAttributes.TextAttributes.PaddingRight = value; - RelayoutRequest(); + if (null != value) + { + CreateIconAttributes(); + buttonAttributes.IconAttributes.PaddingLeft = value.Start; + buttonAttributes.IconAttributes.PaddingRight = value.End; + buttonAttributes.IconAttributes.PaddingTop = value.Top; + buttonAttributes.IconAttributes.PaddingBottom = value.Bottom; + RelayoutRequest(); + } } } - /// - /// Text top padding in Button, work only when show icon and text. + // + /// Text padding in Button, work only when show icon and text. /// /// 6 - /// 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 int TextPaddingTop + public Extents TextPadding { get { - return buttonAttributes?.TextAttributes?.PaddingTop ?? 0; + if (null == buttonAttributes || null == buttonAttributes.TextAttributes) + { + return null; + } + else + { + return new Extents((ushort)buttonAttributes.TextAttributes.PaddingLeft, (ushort)buttonAttributes.TextAttributes.PaddingRight, (ushort)buttonAttributes.TextAttributes.PaddingTop, (ushort)buttonAttributes.TextAttributes.PaddingBottom); + } } set { - CreateTextAttributes(); - buttonAttributes.TextAttributes.PaddingTop = value; - RelayoutRequest(); + if (null != value) + { + CreateTextAttributes(); + buttonAttributes.TextAttributes.PaddingLeft = value.Start; + buttonAttributes.TextAttributes.PaddingRight = value.End; + buttonAttributes.TextAttributes.PaddingTop = value.Top; + buttonAttributes.TextAttributes.PaddingBottom = value.Bottom; + RelayoutRequest(); + } } } /// - /// Text bottom padding in Button, work only when show icon and text. - /// - /// 6 - /// 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 int TextPaddingBottom - { - get - { - return buttonAttributes?.TextAttributes?.PaddingBottom ?? 0; - } - set - { - CreateTextAttributes(); - buttonAttributes.TextAttributes.PaddingBottom = value; - RelayoutRequest(); - } - } - /// /// Dispose Button and all children on it. /// /// Dispose type. /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] protected override void Dispose(DisposeTypes type) { if (disposed) @@ -979,8 +832,6 @@ namespace Tizen.NUI.Components /// The key event. /// True if the key event should be consumed. /// 6 - /// 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 override bool OnKey(Key key) { if (key.State == Key.StateType.Down) @@ -1010,6 +861,7 @@ namespace Tizen.NUI.Components } return base.OnKey(key); } + /// /// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained. /// @@ -1032,6 +884,7 @@ namespace Tizen.NUI.Components base.OnFocusLost(); UpdateState(); } + /// /// Tap gesture event callback. /// @@ -1049,7 +902,6 @@ namespace Tizen.NUI.Components base.OnTapGestureDetected(source, e); } } - /// /// Called after a touch event is received by the owning view.
/// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
@@ -1198,7 +1050,7 @@ namespace Tizen.NUI.Components OnUpdate(); - StateChangeEventArgs e = new StateChangeEventArgs + StateChangedEventArgs e = new StateChangedEventArgs { PreviousState = sourceState, CurrentState = targetState @@ -1474,8 +1326,6 @@ namespace Tizen.NUI.Components /// ClickEventArgs is a class to record button click event arguments which will sent to user. ///
/// 6 - /// 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 class ClickEventArgs : EventArgs { } @@ -1483,19 +1333,13 @@ namespace Tizen.NUI.Components /// StateChangeEventArgs is a class to record button state change event arguments which will sent to user. ///
/// 6 - /// 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 class StateChangeEventArgs : EventArgs + public class StateChangedEventArgs : EventArgs { /// previous state of Button /// 6 - /// 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 ControlStates PreviousState; /// current state of Button /// 6 - /// 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 ControlStates CurrentState; } diff --git a/src/Tizen.NUI.Components/Controls/Control.cs b/src/Tizen.NUI.Components/Controls/Control.cs index 1c34649..287db8e 100755 --- a/src/Tizen.NUI.Components/Controls/Control.cs +++ b/src/Tizen.NUI.Components/Controls/Control.cs @@ -126,13 +126,13 @@ namespace Tizen.NUI.Components return; } - if (attrs.Position2D != null) + if (attrs.Position != null) { - view.Position2D = attrs.Position2D; + view.Position = attrs.Position; } - if (attrs.Size2D != null) + if (attrs.Size != null) { - view.Size2D = attrs.Size2D; + view.Size = attrs.Size; } if (attrs.MinimumSize != null) { diff --git a/src/Tizen.NUI.Components/Controls/DropDown.cs b/src/Tizen.NUI.Components/Controls/DropDown.cs index c4864b0..bb08a03 100755 --- a/src/Tizen.NUI.Components/Controls/DropDown.cs +++ b/src/Tizen.NUI.Components/Controls/DropDown.cs @@ -382,18 +382,18 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D ButtonIconSize2D + public Size ButtonIconSize { get { - return dropDownAttributes.ButtonAttributes?.IconAttributes?.Size2D; + return dropDownAttributes.ButtonAttributes?.IconAttributes?.Size; } set { if (value != null) { CreateButtonIconAttributes(); - dropDownAttributes.ButtonAttributes.IconAttributes.Size2D = value; + dropDownAttributes.ButtonAttributes.IconAttributes.Size = value; RelayoutRequest(); } } @@ -587,6 +587,25 @@ namespace Tizen.NUI.Components } /// + /// Bottom space in list. + /// + /// 6 + /// 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 int ListBottomMargin + { + get + { + return (int)dropDownAttributes.ListMargin.W; + } + set + { + dropDownAttributes.ListMargin.W = value; + RelayoutRequest(); + } + } + + /// /// Focused item index in list. /// /// 6 @@ -633,15 +652,15 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D ListSize2D + public Size ListSize { get { - return dropDownAttributes.ListSize2D; + return dropDownAttributes.ListSize; } set { - dropDownAttributes.ListSize2D = value; + dropDownAttributes.ListSize = value; RelayoutRequest(); } } @@ -802,9 +821,9 @@ namespace Tizen.NUI.Components button.IconURLSelector = dropDownAttributes.ButtonAttributes.IconAttributes.ResourceURL; int iconWidth = 0; int buttonTextWidth = 0; - if (dropDownAttributes.ButtonAttributes.IconAttributes.Size2D != null) + if (dropDownAttributes.ButtonAttributes.IconAttributes.Size != null) { - iconWidth = dropDownAttributes.ButtonAttributes.IconAttributes.Size2D.Width; + iconWidth = (int)dropDownAttributes.ButtonAttributes.IconAttributes.Size.Width; } if (buttonText.NaturalSize2D != null) { @@ -823,7 +842,7 @@ namespace Tizen.NUI.Components } ApplyAttributes(listBackgroundImage, dropDownAttributes.ListBackgroundImageAttributes); list.FocusedItemIndex = dropDownAttributes.FocusedItemIndex; - list.Size2D = dropDownAttributes.ListSize2D; + list.Size = dropDownAttributes.ListSize; list.Padding = dropDownAttributes.ListPadding; int listBackgroundImageX = 0; @@ -1110,7 +1129,7 @@ namespace Tizen.NUI.Components PivotPoint = Tizen.NUI.PivotPoint.TopLeft, WidthResizePolicy = ResizePolicyType.UseNaturalSize, HeightResizePolicy = ResizePolicyType.FillToParent, - Position2D = new Position2D(0, 0), + Position = new Position(0, 0), HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, }; @@ -1230,15 +1249,15 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D Size2D + public Size Size { get { - return itemDataAttributes.Size2D; + return itemDataAttributes.Size; } set { - itemDataAttributes.Size2D = value; + itemDataAttributes.Size = value; } } @@ -1345,16 +1364,16 @@ namespace Tizen.NUI.Components /// 6 /// 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 Position2D TextPosition2D + public Position TextPosition { get { - return itemDataAttributes.TextAttributes?.Position2D; + return itemDataAttributes.TextAttributes?.Position; } set { CreateTextAttributes(); - itemDataAttributes.TextAttributes.Position2D = value; + itemDataAttributes.TextAttributes.Position = value; } } @@ -1390,16 +1409,16 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D IconSize2D + public Size IconSize { get { - return itemDataAttributes.IconAttributes?.Size2D; + return itemDataAttributes.IconAttributes?.Size; } set { CreateIconAttributes(); - itemDataAttributes.IconAttributes.Size2D = value; + itemDataAttributes.IconAttributes.Size = value; } } @@ -1409,16 +1428,16 @@ namespace Tizen.NUI.Components /// 6 /// 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 Position2D IconPosition2D + public Position IconPosition { get { - return itemDataAttributes.IconAttributes.Position2D; + return itemDataAttributes.IconAttributes.Position; } set { CreateIconAttributes(); - itemDataAttributes.IconAttributes.Position2D = value; + itemDataAttributes.IconAttributes.Position = value; } } @@ -1454,16 +1473,16 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D CheckImageSize2D + public Size CheckImageSize { get { - return itemDataAttributes.CheckImageAttributes?.Size2D; + return itemDataAttributes.CheckImageAttributes?.Size; } set { CreateCheckImageAttributes(); - itemDataAttributes.CheckImageAttributes.Size2D = value; + itemDataAttributes.CheckImageAttributes.Size = value; } } @@ -1657,7 +1676,7 @@ namespace Tizen.NUI.Components /// 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 Position2D TextPosition2D + public Position TextPosition { get { @@ -1665,12 +1684,12 @@ namespace Tizen.NUI.Components { return null; } - return mText.Position2D; + return mText.Position; } set { CreateText(); - mText.Position2D = value; + mText.Position = value; } } @@ -1695,7 +1714,7 @@ namespace Tizen.NUI.Components /// 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 Size2D IconSize2D + public Size IconSize { get { @@ -1703,18 +1722,18 @@ namespace Tizen.NUI.Components { return null; } - return mIcon.Size2D; + return mIcon.Size; } set { CreateIcon(); - mIcon.Size2D = value; + mIcon.Size = value; } } /// 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 Position2D IconPosition2D + public Position IconPosition { get { @@ -1722,12 +1741,12 @@ namespace Tizen.NUI.Components { return null; } - return mIcon.Position2D; + return mIcon.Position; } set { CreateIcon(); - mIcon.Position2D = value; + mIcon.Position = value; } } @@ -1752,7 +1771,7 @@ namespace Tizen.NUI.Components /// 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 Position2D CheckPosition2D + public Position CheckPosition { get { @@ -1760,18 +1779,18 @@ namespace Tizen.NUI.Components { return null; } - return mCheck.Position2D; + return mCheck.Position; } set { CreateCheckImage(); - mCheck.Position2D = value; + mCheck.Position = value; } } /// 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 Size2D CheckImageSize2D + public Size CheckImageSize { get { @@ -1779,12 +1798,12 @@ namespace Tizen.NUI.Components { return null; } - return mCheck.Size2D; + return mCheck.Size; } set { CreateCheckImage(); - mCheck.Size2D = value; + mCheck.Size = value; } } @@ -2001,9 +2020,9 @@ namespace Tizen.NUI.Components } DropDownItemView listItemView = holder.ItemView as DropDownItemView; listItemView.Name = "Item" + position; - if (listItemData.Size2D != null) + if (listItemData.Size != null) { - holder.ItemView.Size2D = listItemData.Size2D; + holder.ItemView.Size = listItemData.Size; } if (listItemView != null) @@ -2014,26 +2033,26 @@ namespace Tizen.NUI.Components listItemView.Text = listItemData.Text; listItemView.PointSize = listItemData.PointSize; listItemView.FontFamily = listItemData.FontFamily; - listItemView.TextPosition2D = listItemData.TextPosition2D; + listItemView.TextPosition = listItemData.TextPosition; } if (listItemData.IconResourceUrl != null) { listItemView.IconResourceUrl = listItemData.IconResourceUrl; - listItemView.IconSize2D = listItemData.IconSize2D; - if (listItemView.IconSize2D != null) + listItemView.IconSize = listItemData.IconSize; + if (listItemView.IconSize != null) { - listItemView.IconPosition2D = new Position2D(listItemData.IconPosition2D.X, (listItemView.Size2D.Height - listItemView.IconSize2D.Height) / 2); + listItemView.IconPosition = new Position(listItemData.IconPosition.X, (listItemView.Size2D.Height - listItemView.IconSize.Height) / 2); } } if (listItemData.CheckImageResourceUrl != null) { listItemView.CheckResourceUrl = listItemData.CheckImageResourceUrl; - listItemView.CheckImageSize2D = listItemData.CheckImageSize2D; - if (listItemView.CheckImageSize2D != null) + listItemView.CheckImageSize = listItemData.CheckImageSize; + if (listItemView.CheckImageSize != null) { - listItemView.CheckPosition2D = new Position2D(listItemView.Size2D.Width - listItemData.CheckImageRightSpace - listItemView.CheckImageSize2D.Width, (listItemView.Size2D.Height - listItemView.CheckImageSize2D.Height) / 2); + listItemView.CheckPosition = new Position(listItemView.Size2D.Width - listItemData.CheckImageRightSpace - listItemView.CheckImageSize.Width, (listItemView.Size2D.Height - listItemView.CheckImageSize.Height) / 2); } } diff --git a/src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs b/src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs index 7b0a48c..de04a12 100755 --- a/src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs +++ b/src/Tizen.NUI.Components/Controls/FlexibleView/FlexibleView.cs @@ -617,11 +617,11 @@ namespace Tizen.NUI.Components } if (mScrollBar.Direction == ScrollBar.DirectionType.Vertical) { - mScrollBar.ThumbSize = new Size2D((int)thickness, (int)length); + mScrollBar.ThumbSize = new Size(thickness, length); } else { - mScrollBar.ThumbSize = new Size2D((int)length, (int)thickness); + mScrollBar.ThumbSize = new Size(length, thickness); } mScrollBar.MinValue = 0; mScrollBar.MaxValue = (int)(range - extent); @@ -655,7 +655,7 @@ namespace Tizen.NUI.Components mFocusedItemIndex = nextFocusPosition; - ShowScrollBar(); + ShowScrollBar(); } private void DispatchChildAttached(ViewHolder holder) @@ -730,7 +730,6 @@ namespace Tizen.NUI.Components } } - private void OnItemEvent(object sender, Adapter.ItemEventArgs e) { switch (e.EventType) @@ -1151,7 +1150,6 @@ namespace Tizen.NUI.Components { } - /// /// Gets the current focus position in adapter. /// @@ -1402,9 +1400,12 @@ namespace Tizen.NUI.Components /// 6 /// 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 int GetChildCount() + public int ChildCount { - return mChildHelper != null ? mChildHelper.GetChildCount() : 0; + get + { + return mChildHelper != null ? mChildHelper.GetChildCount() : 0; + } } /// @@ -1537,9 +1538,12 @@ namespace Tizen.NUI.Components /// 6 /// 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 float GetWidth() + public float Width { - return mFlexibleView != null ? mFlexibleView.SizeWidth : 0; + get + { + return mFlexibleView != null ? mFlexibleView.SizeWidth : 0; + } } /// @@ -1548,9 +1552,12 @@ namespace Tizen.NUI.Components /// 6 /// 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 float GetHeight() + public float Height { - return mFlexibleView != null ? mFlexibleView.SizeHeight : 0; + get + { + return mFlexibleView != null ? mFlexibleView.SizeHeight : 0; + } } /// @@ -1559,9 +1566,12 @@ namespace Tizen.NUI.Components /// 6 /// 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 int GetPaddingLeft() + public int PaddingLeft { - return mFlexibleView != null ? mFlexibleView.Padding.Start : 0; + get + { + return mFlexibleView?.Padding?.Start ?? 0; + } } /// @@ -1570,9 +1580,12 @@ namespace Tizen.NUI.Components /// 6 /// 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 int GetPaddingTop() + public int PaddingTop { - return mFlexibleView != null ? mFlexibleView.Padding.Top : 0; + get + { + return mFlexibleView?.Padding?.Top ?? 0; + } } /// @@ -1581,9 +1594,12 @@ namespace Tizen.NUI.Components /// 6 /// 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 int GetPaddingRight() + public int PaddingRight { - return mFlexibleView != null ? mFlexibleView.Padding.End : 0; + get + { + return mFlexibleView?.Padding?.End ?? 0; + } } /// @@ -1592,9 +1608,12 @@ namespace Tizen.NUI.Components /// 6 /// 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 int GetPaddingBottom() + public int PaddingBottom { - return mFlexibleView != null ? mFlexibleView.Padding.Bottom : 0; + get + { + return mFlexibleView?.Padding?.Bottom ?? 0; + } } /// @@ -1752,10 +1771,10 @@ namespace Tizen.NUI.Components private Vector2 GetChildRectangleOnScreenScrollAmount(FlexibleView parent, FlexibleView.ViewHolder child) { Vector2 ret = new Vector2(0, 0); - int parentLeft = GetPaddingLeft(); - int parentTop = GetPaddingTop(); - int parentRight = (int)GetWidth() - GetPaddingRight(); - int parentBottom = (int)GetHeight() - GetPaddingBottom(); + int parentLeft = PaddingLeft; + int parentTop = PaddingTop; + int parentRight = (int)Width - PaddingRight; + int parentBottom = (int)Height - PaddingBottom; int childLeft = (int)child.Left; int childTop = (int)child.Top; int childRight = (int)child.Right; diff --git a/src/Tizen.NUI.Components/Controls/FlexibleView/GridLayoutManager.cs b/src/Tizen.NUI.Components/Controls/FlexibleView/GridLayoutManager.cs index c78c2a0..3100256 100755 --- a/src/Tizen.NUI.Components/Controls/FlexibleView/GridLayoutManager.cs +++ b/src/Tizen.NUI.Components/Controls/FlexibleView/GridLayoutManager.cs @@ -59,7 +59,7 @@ namespace Tizen.NUI.Components else { // choose the max span we can get. hopefully last one - int indexLimit = GetChildCount() - 1; + int indexLimit = ChildCount - 1; int pos = anchorInfo.Position; int bestSpan = span; while (pos < indexLimit) @@ -179,16 +179,16 @@ namespace Tizen.NUI.Components float left, top, width, height; if (mOrientation == VERTICAL) { - width = (GetWidth() - GetPaddingLeft() - GetPaddingRight()) / count; + width = (Width - PaddingLeft - PaddingRight) / count; height = result.Consumed; if (layoutState.LayoutDirection == LayoutState.LAYOUT_END) { - left = GetPaddingLeft() + width * i; + left = PaddingLeft + width * i; top = layoutState.Offset; } else { - left = GetPaddingLeft() + width * (count - 1 - i); + left = PaddingLeft + width * (count - 1 - i); top = layoutState.Offset - height; } LayoutChild(holder, left, top, width, height); @@ -196,15 +196,15 @@ namespace Tizen.NUI.Components else { width = result.Consumed; - height = (GetHeight() - GetPaddingTop() - GetPaddingBottom()) / count; + height = (Height - PaddingTop - PaddingBottom) / count; if (layoutState.LayoutDirection == LayoutState.LAYOUT_END) { - top = GetPaddingTop() + height * i; + top = PaddingTop + height * i; left = layoutState.Offset; } else { - top = GetPaddingTop() + height * (count - 1 - i); + top = PaddingTop + height * (count - 1 - i); left = layoutState.Offset - width; } LayoutChild(holder, left, top, width, height); diff --git a/src/Tizen.NUI.Components/Controls/FlexibleView/LinearLayoutManager.cs b/src/Tizen.NUI.Components/Controls/FlexibleView/LinearLayoutManager.cs index 22a180e..366e13b 100755 --- a/src/Tizen.NUI.Components/Controls/FlexibleView/LinearLayoutManager.cs +++ b/src/Tizen.NUI.Components/Controls/FlexibleView/LinearLayoutManager.cs @@ -71,23 +71,17 @@ namespace Tizen.NUI.Components private LayoutState mLayoutState; private AnchorInfo mAnchorInfo = new AnchorInfo(); - /** - * Stashed to avoid allocation, currently only used in #fill() - */ + // Stashed to avoid allocation, currently only used in #fill() private LayoutChunkResult mLayoutChunkResult = new LayoutChunkResult(); private bool mShouldReverseLayout = false; - /** - * When LayoutManager needs to scroll to a position, it sets this variable and requests a - * layout which will check this variable and re-layout accordingly. - */ + // When LayoutManager needs to scroll to a position, it sets this variable and requests a + // layout which will check this variable and re-layout accordingly. private int mPendingScrollPosition = NO_POSITION; - /** - * Used to keep the offset value when {@link #scrollToPositionWithOffset(int, int)} is - * called. - */ + // Used to keep the offset value when {@link #scrollToPositionWithOffset(int, int)} is + // called. private int mPendingScrollPositionOffset = INVALID_OFFSET; /// @@ -280,7 +274,7 @@ namespace Tizen.NUI.Components { return 0; } - return ScrollBy(dy, recycler, immediate); ; + return ScrollBy(dy, recycler, immediate); } /// @@ -293,7 +287,7 @@ namespace Tizen.NUI.Components { FlexibleView.ViewHolder startChild = FindFirstVisibleItemView(); FlexibleView.ViewHolder endChild = FindLastVisibleItemView(); - if (GetChildCount() == 0 || startChild == null || endChild == null) + if (ChildCount == 0 || startChild == null || endChild == null) { return 0; } @@ -322,7 +316,7 @@ namespace Tizen.NUI.Components { FlexibleView.ViewHolder startChild = FindFirstVisibleItemView(); FlexibleView.ViewHolder endChild = FindLastVisibleItemView(); - if (GetChildCount() == 0 || startChild == null || endChild == null) + if (ChildCount == 0 || startChild == null || endChild == null) { return 0; } @@ -341,7 +335,7 @@ namespace Tizen.NUI.Components { FlexibleView.ViewHolder startChild = FindFirstVisibleItemView(); FlexibleView.ViewHolder endChild = FindLastVisibleItemView(); - if (GetChildCount() == 0 || startChild == null || endChild == null) + if (ChildCount == 0 || startChild == null || endChild == null) { return 0; } @@ -479,9 +473,9 @@ namespace Tizen.NUI.Components float left, top, width, height; if (mOrientation == VERTICAL) { - width = GetWidth() - GetPaddingLeft() - GetPaddingRight(); + width = Width - PaddingLeft - PaddingRight; height = result.Consumed; - left = GetPaddingLeft(); + left = PaddingLeft; if (layoutState.LayoutDirection == LayoutState.LAYOUT_END) { top = layoutState.Offset; @@ -495,8 +489,8 @@ namespace Tizen.NUI.Components else { width = result.Consumed; - height = GetHeight() - GetPaddingTop() - GetPaddingBottom(); - top = GetPaddingTop(); + height = Height - PaddingTop - PaddingBottom; + top = PaddingTop; if (layoutState.LayoutDirection == LayoutState.LAYOUT_END) { left = layoutState.Offset; @@ -513,7 +507,7 @@ namespace Tizen.NUI.Components internal override FlexibleView.ViewHolder OnFocusSearchFailed(FlexibleView.ViewHolder focused, FlexibleView.LayoutManager.Direction direction, FlexibleView.Recycler recycler) { - if (GetChildCount() == 0) + if (ChildCount == 0) { return null; } @@ -535,7 +529,7 @@ namespace Tizen.NUI.Components } else { - nextFocus = GetChildAt(GetChildCount() - 1); + nextFocus = GetChildAt(ChildCount - 1); } return nextFocus; } @@ -557,10 +551,9 @@ namespace Tizen.NUI.Components anchorInfo.Coordinate = anchorInfo.LayoutFromEnd ? mOrientationHelper.GetEndAfterPadding() : mOrientationHelper.GetStartAfterPadding(); } - /** - * If there is a pending scroll position or saved states, updates the anchor info from that - * data and returns true - */ + + // If there is a pending scroll position or saved states, updates the anchor info from that + // data and returns true private bool UpdateAnchorFromPendingData(AnchorInfo anchorInfo) { if (mPendingScrollPosition == NO_POSITION) @@ -594,17 +587,16 @@ namespace Tizen.NUI.Components + mPendingScrollPositionOffset; } } + return true; } - /** - * Finds an anchor child from existing Views. Most of the time, this is the view closest to - * start or end that has a valid position (e.g. not removed). - * If a child has focus, it is given priority. - */ + // Finds an anchor child from existing Views. Most of the time, this is the view closest to + // start or end that has a valid position (e.g. not removed). + // If a child has focus, it is given priority. private bool UpdateAnchorFromChildren(FlexibleView.Recycler recycler, AnchorInfo anchorInfo) { - if (GetChildCount() == 0) + if (ChildCount == 0) { return false; } @@ -620,16 +612,14 @@ namespace Tizen.NUI.Components return true; } - /** - * Converts a focusDirection to orientation. - * - * @param focusDirection One of {@link View#FOCUS_UP}, {@link View#FOCUS_DOWN}, - * {@link View#FOCUS_LEFT}, {@link View#FOCUS_RIGHT}, - * {@link View#FOCUS_BACKWARD}, {@link View#FOCUS_FORWARD} - * or 0 for not applicable - * @return {@link LayoutState#LAYOUT_START} or {@link LayoutState#LAYOUT_END} if focus direction - * is applicable to current state, {@link LayoutState#INVALID_LAYOUT} otherwise. - */ + // Converts a focusDirection to orientation. + // + // @param focusDirection One of {@link View#FOCUS_UP}, {@link View#FOCUS_DOWN}, + // {@link View#FOCUS_LEFT}, {@link View#FOCUS_RIGHT}, + // {@link View#FOCUS_BACKWARD}, {@link View#FOCUS_FORWARD} + // or 0 for not applicable + // @return {@link LayoutState#LAYOUT_START} or {@link LayoutState#LAYOUT_END} if focus direction + // is applicable to current state, {@link LayoutState#INVALID_LAYOUT} otherwise. private int ConvertFocusDirectionToLayoutDirection(FlexibleView.LayoutManager.Direction focusDirection) { switch (focusDirection) @@ -656,6 +646,7 @@ namespace Tizen.NUI.Components private float Fill(FlexibleView.Recycler recycler, LayoutState layoutState, bool stopOnFocusable, bool immediate) { float start = layoutState.Available; + if (layoutState.ScrollingOffset != LayoutState.SCROLLING_OFFSET_NaN) { // TODO ugly bug fix. should not happen @@ -679,12 +670,11 @@ namespace Tizen.NUI.Components break; } layoutState.Offset += layoutChunkResult.Consumed * layoutState.LayoutDirection; - /** - * Consume the available space if: - * layoutChunk did not request to be ignored - * OR we are laying out scrap children - * OR we are not doing pre-layout - */ + + // Consume the available space if: + // layoutChunk did not request to be ignored + // OR we are laying out scrap children + // OR we are not doing pre-layout if (!layoutChunkResult.IgnoreConsumed) { layoutState.Available -= layoutChunkResult.Consumed; @@ -779,7 +769,7 @@ namespace Tizen.NUI.Components } // ignore padding, ViewGroup may not clip children. float limit = dt; - int childCount = GetChildCount(); + int childCount = ChildCount; if (mShouldReverseLayout) { for (int i = childCount - 1; i >= 0; i--) @@ -810,7 +800,7 @@ namespace Tizen.NUI.Components private void RecycleViewsFromEnd(FlexibleView.Recycler recycler, float dt, bool immediate) { - int childCount = GetChildCount(); + int childCount = ChildCount; if (dt < 0) { return; @@ -846,7 +836,7 @@ namespace Tizen.NUI.Components private float ScrollBy(float dy, FlexibleView.Recycler recycler, bool immediate) { - if (GetChildCount() == 0 || dy == 0) + if (ChildCount == 0 || dy == 0) { return 0; } @@ -868,7 +858,6 @@ namespace Tizen.NUI.Components mOrientationHelper.OffsetChildren(scrolled, immediate); - return scrolled; } @@ -917,26 +906,23 @@ namespace Tizen.NUI.Components mLayoutState.ScrollingOffset = scrollingOffset; } - /** - * Convenience method to find the child closes to start. Caller should check it has enough - * children. - * - * @return The child closes to start of the layout from user's perspective. - */ + + // Convenience method to find the child closes to start. Caller should check it has enough + // children. + // + // @return The child closes to start of the layout from user's perspective. private FlexibleView.ViewHolder GetChildClosestToStart() { - return GetChildAt(mShouldReverseLayout ? GetChildCount() - 1 : 0); + return GetChildAt(mShouldReverseLayout ? ChildCount - 1 : 0); } - /** - * Convenience method to find the child closes to end. Caller should check it has enough - * children. - * - * @return The child closes to end of the layout from user's perspective. - */ + // Convenience method to find the child closes to end. Caller should check it has enough + // children. + // + // @return The child closes to end of the layout from user's perspective. private FlexibleView.ViewHolder GetChildClosestToEnd() { - return GetChildAt(mShouldReverseLayout ? 0 : GetChildCount() - 1); + return GetChildAt(mShouldReverseLayout ? 0 : ChildCount - 1); } private void UpdateLayoutStateToFillEnd(int itemPosition, float offset) @@ -965,7 +951,7 @@ namespace Tizen.NUI.Components private FlexibleView.ViewHolder FindFirstVisibleItemView() { - int childCount = GetChildCount(); + int childCount = ChildCount; if (mShouldReverseLayout == false) { for (int i = 0; i < childCount; i++) @@ -993,7 +979,7 @@ namespace Tizen.NUI.Components private FlexibleView.ViewHolder FindFirstCompleteVisibleItemView() { - int childCount = GetChildCount(); + int childCount = ChildCount; if (mShouldReverseLayout == false) { for (int i = 0; i < childCount; i++) @@ -1021,7 +1007,7 @@ namespace Tizen.NUI.Components private FlexibleView.ViewHolder FindLastVisibleItemView() { - int childCount = GetChildCount(); + int childCount = ChildCount; if (mShouldReverseLayout == false) { for (int i = childCount - 1; i >= 0; i--) @@ -1049,7 +1035,7 @@ namespace Tizen.NUI.Components private FlexibleView.ViewHolder FindLastCompleteVisibleItemView() { - int childCount = GetChildCount(); + int childCount = ChildCount; if (mShouldReverseLayout == false) { for (int i = childCount - 1; i >= 0; i--) @@ -1075,10 +1061,7 @@ namespace Tizen.NUI.Components return null; } - - /** - * Helper class that keeps temporary state while {LayoutManager} is filling out the empty space. - **/ + // Helper class that keeps temporary state while {LayoutManager} is filling out the empty space. internal class LayoutState { public static readonly int LAYOUT_START = -1; @@ -1093,67 +1076,47 @@ namespace Tizen.NUI.Components public static readonly int SCROLLING_OFFSET_NaN = -10000; - /** - * We may not want to recycle children in some cases (e.g. layout) - */ + // We may not want to recycle children in some cases (e.g. layout) public bool Recycle = true; - /** - * Pixel offset where layout should start - */ + // Pixel offset where layout should start public float Offset; - /** - * Number of pixels that we should fill, in the layout direction. - */ + // Number of pixels that we should fill, in the layout direction. public float Available; - /** - * Current position on the adapter to get the next item. - */ + // Current position on the adapter to get the next item. public int CurrentPosition; - /** - * Defines the direction in which the data adapter is traversed. - * Should be {@link #ITEM_DIRECTION_HEAD} or {@link #ITEM_DIRECTION_TAIL} - */ + // Defines the direction in which the data adapter is traversed. + // Should be {@link #ITEM_DIRECTION_HEAD} or {@link #ITEM_DIRECTION_TAIL} public int ItemDirection; - /** - * Defines the direction in which the layout is filled. - * Should be {@link #LAYOUT_START} or {@link #LAYOUT_END} - */ + // Defines the direction in which the layout is filled. + // Should be {@link #LAYOUT_START} or {@link #LAYOUT_END} public int LayoutDirection; - /** - * Used when LayoutState is constructed in a scrolling state. - * It should be set the amount of scrolling we can make without creating a new view. - * Settings this is required for efficient view recycling. - */ + // Used when LayoutState is constructed in a scrolling state. + // It should be set the amount of scrolling we can make without creating a new view. + // Settings this is required for efficient view recycling. public float ScrollingOffset; - /** - * Used if you want to pre-layout items that are not yet visible. - * The difference with {@link #mAvailable} is that, when recycling, distance laid out for - * {@link #mExtra} is not considered to avoid recycling visible children. - */ + // Used if you want to pre-layout items that are not yet visible. + // The difference with {@link #mAvailable} is that, when recycling, distance laid out for + // {@link #mExtra} is not considered to avoid recycling visible children. public float Extra = 0; - /** - * @return true if there are more items in the data adapter - */ + // @return true if there are more items in the data adapter public bool HasMore(int itemCount) { return CurrentPosition >= 0 && CurrentPosition < itemCount; } - /** - * Gets the view for the next element that we should layout. - * Also updates current item index to the next item, based on {@link #mItemDirection} - * - * @return The next element that we should layout. - */ + // Gets the view for the next element that we should layout. + // Also updates current item index to the next item, based on {@link #mItemDirection} + // + // @return The next element that we should layout. public FlexibleView.ViewHolder Next(FlexibleView.Recycler recycler) { FlexibleView.ViewHolder itemView = recycler.GetViewForPosition(CurrentPosition); diff --git a/src/Tizen.NUI.Components/Controls/FlexibleView/OrientationHelper.cs b/src/Tizen.NUI.Components/Controls/FlexibleView/OrientationHelper.cs index 494f1b3..572b190 100755 --- a/src/Tizen.NUI.Components/Controls/FlexibleView/OrientationHelper.cs +++ b/src/Tizen.NUI.Components/Controls/FlexibleView/OrientationHelper.cs @@ -18,15 +18,13 @@ using System; namespace Tizen.NUI.Components { - /** - * Helper class for LayoutManagers to abstract measurements depending on the View's orientation. - * It is developed to easily support vertical and horizontal orientations in a LayoutManager but - * can also be used to abstract calls around view bounds and child measurements with margins and - * decorations. - * - * @see #createHorizontalHelper(RecyclerView.LayoutManager) - * @see #createVerticalHelper(RecyclerView.LayoutManager) - */ + // Helper class for LayoutManagers to abstract measurements depending on the View's orientation. + // It is developed to easily support vertical and horizontal orientations in a LayoutManager but + // can also be used to abstract calls around view bounds and child measurements with margins and + // decorations. + // + // @see #createHorizontalHelper(RecyclerView.LayoutManager) + // @see #createVerticalHelper(RecyclerView.LayoutManager) internal abstract class OrientationHelper { public static readonly int HORIZONTAL = 0; @@ -43,132 +41,105 @@ namespace Tizen.NUI.Components mLayoutManager = layoutManager; } - /** - * Call this method after onLayout method is complete if state is NOT pre-layout. - * This method records information like layout bounds that might be useful in the next layout - * calculations. - */ + // Call this method after onLayout method is complete if state is NOT pre-layout. + // This method records information like layout bounds that might be useful in the next layout + // calculations. public void OnLayoutComplete() { mLastTotalSpace = GetTotalSpace(); } - /** - * Returns the layout space change between the previous layout pass and current layout pass. - * Make sure you call {@link #onLayoutComplete()} at the end of your LayoutManager's - * {@link RecyclerView.LayoutManager#onLayoutChildren(RecyclerView.Recycler, - * RecyclerView.State)} method. - * - * @return The difference between the current total space and previous layout's total space. - * @see #onLayoutComplete() - */ + // Returns the layout space change between the previous layout pass and current layout pass. + // Make sure you call {@link #onLayoutComplete()} at the end of your LayoutManager's + // {@link RecyclerView.LayoutManager#onLayoutChildren(RecyclerView.Recycler, + // RecyclerView.State)} method. + // + // @return The difference between the current total space and previous layout's total space. + // @see #onLayoutComplete() public float GetTotalSpaceChange() { return INVALID_SIZE == mLastTotalSpace ? 0 : GetTotalSpace() - mLastTotalSpace; } - /** - * Returns the start of the view including its decoration and margin. - * For example, for the horizontal helper, if a View's left is at pixel 20, has 2px left - * decoration and 3px left margin, returned value will be 15px. - * - * @param view The view element to check - * @return The first pixel of the element - * @see #getDecoratedEnd(android.view.View) - */ + // Returns the start of the view including its decoration and margin. + // For example, for the horizontal helper, if a View's left is at pixel 20, has 2px left + // decoration and 3px left margin, returned value will be 15px. + // + // @param view The view element to check + // @return The first pixel of the element + // @see #getDecoratedEnd(android.view.View) public abstract float GetViewHolderStart(FlexibleView.ViewHolder holder); - /** - * Returns the end of the view including its decoration and margin. - * For example, for the horizontal helper, if a View's right is at pixel 200, has 2px right - * decoration and 3px right margin, returned value will be 205. - * - * @param view The view element to check - * @return The last pixel of the element - * @see #getDecoratedStart(android.view.View) - */ + // Returns the end of the view including its decoration and margin. + // For example, for the horizontal helper, if a View's right is at pixel 200, has 2px right + // decoration and 3px right margin, returned value will be 205. + // + // @param view The view element to check + // @return The last pixel of the element + // @see #getDecoratedStart(android.view.View) public abstract float GetViewHolderEnd(FlexibleView.ViewHolder holder); - /** - * Returns the space occupied by this View in the current orientation including decorations and - * margins. - * - * @param view The view element to check - * @return Total space occupied by this view - * @see #getDecoratedMeasurementInOther(View) - */ + // Returns the space occupied by this View in the current orientation including decorations and + // margins. + // + // @param view The view element to check + // @return Total space occupied by this view + // @see #getDecoratedMeasurementInOther(View) + public abstract float GetViewHolderMeasurement(FlexibleView.ViewHolder holder); - /** - * Returns the space occupied by this View in the perpendicular orientation including - * decorations and margins. - * - * @param view The view element to check - * @return Total space occupied by this view in the perpendicular orientation to current one - * @see #getDecoratedMeasurement(View) - */ + // Returns the space occupied by this View in the perpendicular orientation including + // decorations and margins. + // + // @param view The view element to check + // @return Total space occupied by this view in the perpendicular orientation to current one + // @see #getDecoratedMeasurement(View) public abstract float GetViewHolderMeasurementInOther(FlexibleView.ViewHolder holder); - /** - * Returns the start position of the layout after the start padding is added. - * - * @return The very first pixel we can draw. - */ + // Returns the start position of the layout after the start padding is added. + // + // @return The very first pixel we can draw. public abstract float GetStartAfterPadding(); - /** - * Returns the end position of the layout after the end padding is removed. - * - * @return The end boundary for this layout. - */ + // Returns the end position of the layout after the end padding is removed. + // + // @return The end boundary for this layout. public abstract float GetEndAfterPadding(); - /** - * Returns the end position of the layout without taking padding into account. - * - * @return The end boundary for this layout without considering padding. - */ + // Returns the end position of the layout without taking padding into account. + // + // @return The end boundary for this layout without considering padding. public abstract float GetEnd(); - /** - * Offsets all children's positions by the given amount. - * - * @param amount Value to add to each child's layout parameters - */ + // Offsets all children's positions by the given amount. + // + // @param amount Value to add to each child's layout parameters public abstract void OffsetChildren(float amount, bool immediate); - /** - * Returns the total space to layout. This number is the difference between - * {@link #getEndAfterPadding()} and {@link #getStartAfterPadding()}. - * - * @return Total space to layout children - */ + // Returns the total space to layout. This number is the difference between + // {@link #getEndAfterPadding()} and {@link #getStartAfterPadding()}. + // + // @return Total space to layout children public abstract float GetTotalSpace(); - /** - * Offsets the child in this orientation. - * - * @param view View to offset - * @param offset offset amount - */ + // Offsets the child in this orientation. + // + // @param view View to offset + // @param offset offset amount internal abstract void OffsetChild(FlexibleView.ViewHolder holder, int offset); - /** - * Returns the padding at the end of the layout. For horizontal helper, this is the right - * padding and for vertical helper, this is the bottom padding. This method does not check - * whether the layout is RTL or not. - * - * @return The padding at the end of the layout. - */ + // Returns the padding at the end of the layout. For horizontal helper, this is the right + // padding and for vertical helper, this is the bottom padding. This method does not check + // whether the layout is RTL or not. + // + // @return The padding at the end of the layout. public abstract float GetEndPadding(); - /** - * Creates an OrientationHelper for the given LayoutManager and orientation. - * - * @param layoutManager LayoutManager to attach to - * @param orientation Desired orientation. Should be {@link #HORIZONTAL} or {@link #VERTICAL} - * @return A new OrientationHelper - */ + // Creates an OrientationHelper for the given LayoutManager and orientation. + // + // @param layoutManager LayoutManager to attach to + // @param orientation Desired orientation. Should be {@link #HORIZONTAL} or {@link #VERTICAL} + // @return A new OrientationHelper public static OrientationHelper CreateOrientationHelper( FlexibleView.LayoutManager layoutManager, int orientation) { @@ -185,23 +156,20 @@ namespace Tizen.NUI.Components } - /** - * Creates a horizontal OrientationHelper for the given LayoutManager. - * - * @param layoutManager The LayoutManager to attach to. - * @return A new OrientationHelper - */ + // Creates a horizontal OrientationHelper for the given LayoutManager. + // + // @param layoutManager The LayoutManager to attach to. + // @return A new OrientationHelper public static OrientationHelper CreateHorizontalHelper(FlexibleView.LayoutManager layoutManager) { return new HorizontalHelper(layoutManager); } - /** - * Creates a vertical OrientationHelper for the given LayoutManager. - * - * @param layoutManager The LayoutManager to attach to. - * @return A new OrientationHelper - */ + + // Creates a vertical OrientationHelper for the given LayoutManager. + // + // @param layoutManager The LayoutManager to attach to. + // @return A new OrientationHelper public static OrientationHelper CreateVerticalHelper(FlexibleView.LayoutManager layoutManager) { return new VerticalHelper(layoutManager); @@ -217,12 +185,12 @@ namespace Tizen.NUI.Components public override float GetEndAfterPadding() { - return mLayoutManager.GetWidth() - mLayoutManager.GetPaddingRight(); + return mLayoutManager.Width - mLayoutManager.PaddingRight; } public override float GetEnd() { - return mLayoutManager.GetWidth(); + return mLayoutManager.Width; } public override void OffsetChildren(float amount, bool immediate) @@ -233,7 +201,7 @@ namespace Tizen.NUI.Components public override float GetStartAfterPadding() { - return mLayoutManager.GetPaddingLeft(); + return mLayoutManager.PaddingLeft; } public override float GetViewHolderMeasurement(FlexibleView.ViewHolder holder) @@ -258,8 +226,8 @@ namespace Tizen.NUI.Components public override float GetTotalSpace() { - return mLayoutManager.GetWidth() - mLayoutManager.GetPaddingLeft() - - mLayoutManager.GetPaddingRight(); + return mLayoutManager.Width - mLayoutManager.PaddingLeft + - mLayoutManager.PaddingRight; } internal override void OffsetChild(FlexibleView.ViewHolder holder, int offset) @@ -269,7 +237,7 @@ namespace Tizen.NUI.Components public override float GetEndPadding() { - return mLayoutManager.GetPaddingRight(); + return mLayoutManager.PaddingRight; } } @@ -283,12 +251,12 @@ namespace Tizen.NUI.Components public override float GetEndAfterPadding() { - return mLayoutManager.GetHeight() - mLayoutManager.GetPaddingBottom(); + return mLayoutManager.Height - mLayoutManager.PaddingBottom; } public override float GetEnd() { - return mLayoutManager.GetHeight(); + return mLayoutManager.Height; } public override void OffsetChildren(float amount, bool immediate) @@ -298,7 +266,7 @@ namespace Tizen.NUI.Components public override float GetStartAfterPadding() { - return mLayoutManager.GetPaddingTop(); + return mLayoutManager.PaddingTop; } public override float GetViewHolderMeasurement(FlexibleView.ViewHolder holder) @@ -323,8 +291,8 @@ namespace Tizen.NUI.Components public override float GetTotalSpace() { - return mLayoutManager.GetHeight() - mLayoutManager.GetPaddingTop() - - mLayoutManager.GetPaddingBottom(); + return mLayoutManager.Height - mLayoutManager.PaddingTop + - mLayoutManager.PaddingBottom; } internal override void OffsetChild(FlexibleView.ViewHolder holder, int offset) @@ -334,7 +302,7 @@ namespace Tizen.NUI.Components public override float GetEndPadding() { - return mLayoutManager.GetPaddingBottom(); + return mLayoutManager.PaddingBottom; } } diff --git a/src/Tizen.NUI.Components/Controls/Loading.cs b/src/Tizen.NUI.Components/Controls/Loading.cs index f9109fc..f6bacc1 100755 --- a/src/Tizen.NUI.Components/Controls/Loading.cs +++ b/src/Tizen.NUI.Components/Controls/Loading.cs @@ -24,8 +24,6 @@ namespace Tizen.NUI.Components /// The Loading class of nui component. It's used to indicate informs users of the ongoing operation. /// /// 6 - /// 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 class Loading : Control { private LoadingAttributes loadingAttrs = null; // Loading Attributes @@ -35,8 +33,6 @@ namespace Tizen.NUI.Components /// The constructor of Loading /// /// 6 - /// 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 Loading() : base() { Initialize(); @@ -70,8 +66,6 @@ namespace Tizen.NUI.Components /// Gets or sets loading image resource array. /// /// 6 - /// 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 string[] ImageArray { get @@ -92,18 +86,17 @@ namespace Tizen.NUI.Components /// Gets or sets loading size. /// /// 6 - /// 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 Size2D LoadingSize + public new Size Size { get { - return loadingAttrs.LoadingSize ?? new Size2D(100, 100); + return loadingAttrs.Size ?? new Size(100, 100); } set { - loadingAttrs.LoadingSize = value; - imageVisual.Size = value; + loadingAttrs.Size = value; + base.Size = value; + imageVisual.Size = new Size2D((int)value.Width, (int)value.Height); } } @@ -111,23 +104,21 @@ namespace Tizen.NUI.Components /// Gets or sets FPS of loading. /// /// 6 - /// 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 int FPS + public int FrameRate { get { - return loadingAttrs?.FPS?.All ?? (int)(1000.0f / 16.6f); + return loadingAttrs?.FrameRate?.All ?? (int)(1000.0f / 16.6f); } set { if (value != 0) //It will crash if 0 { - if (null == loadingAttrs.FPS) + if (null == loadingAttrs.FrameRate) { - loadingAttrs.FPS = new IntSelector(); + loadingAttrs.FrameRate = new IntSelector(); } - loadingAttrs.FPS.All = value; + loadingAttrs.FrameRate.All = value; imageVisual.FrameDelay = 1000.0f / value; } } @@ -149,8 +140,6 @@ namespace Tizen.NUI.Components /// /// Dispose type. /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] protected override void Dispose(DisposeTypes type) { if (disposed) @@ -216,13 +205,13 @@ namespace Tizen.NUI.Components { imageVisual.URLS = new List(loadingAttrs.ImageArray); } - if (null != loadingAttrs.FPS) + if (null != loadingAttrs.FrameRate) { - imageVisual.FrameDelay = 1000.0f / (float)loadingAttrs.FPS.All; + imageVisual.FrameDelay = 1000.0f / (float)loadingAttrs.FrameRate.All; } if (null != loadingAttrs.LoadingSize) { - imageVisual.Size = loadingAttrs.LoadingSize; + imageVisual.Size = new Size2D((int)loadingAttrs.LoadingSize.Width, (int)loadingAttrs.LoadingSize.Height); } } } diff --git a/src/Tizen.NUI.Components/Controls/Pagination.cs b/src/Tizen.NUI.Components/Controls/Pagination.cs index f4e10cc..d8190b3 100755 --- a/src/Tizen.NUI.Components/Controls/Pagination.cs +++ b/src/Tizen.NUI.Components/Controls/Pagination.cs @@ -78,7 +78,7 @@ namespace Tizen.NUI.Components /// 6 /// 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 Size2D IndicatorSize + public Size IndicatorSize { get { @@ -335,12 +335,12 @@ namespace Tizen.NUI.Components { ImageVisual indicator = indicatorList[i]; indicator.URL = paginationAttributes.IndicatorBackgroundURL; - indicator.Size = paginationAttributes.IndicatorSize; + indicator.Size = new Size2D((int)paginationAttributes.IndicatorSize.Width, (int)paginationAttributes.IndicatorSize.Height); indicator.Position = new Position2D((int)(paginationAttributes.IndicatorSize.Width + paginationAttributes.IndicatorSpacing) * i, 0); } selectIndicator.URL = paginationAttributes.IndicatorSelectURL; - selectIndicator.Size = paginationAttributes.IndicatorSize; + selectIndicator.Size = new Size2D((int)paginationAttributes.IndicatorSize.Width, (int)paginationAttributes.IndicatorSize.Height); //UpdateContainer(); } @@ -379,7 +379,7 @@ namespace Tizen.NUI.Components ImageVisual indicator = new ImageVisual { URL = paginationAttributes.IndicatorBackgroundURL, - Size = paginationAttributes.IndicatorSize + Size = new Size2D((int)paginationAttributes.IndicatorSize.Width, (int)paginationAttributes.IndicatorSize.Height) }; indicator.Position = new Position2D((int)(paginationAttributes.IndicatorSize.Width + paginationAttributes.IndicatorSpacing) * indicatorList.Count, 0); container.AddVisual("Indicator" + indicatorList.Count, indicator); diff --git a/src/Tizen.NUI.Components/Controls/Popup.cs b/src/Tizen.NUI.Components/Controls/Popup.cs index 84b4847..3983375 100755 --- a/src/Tizen.NUI.Components/Controls/Popup.cs +++ b/src/Tizen.NUI.Components/Controls/Popup.cs @@ -26,8 +26,6 @@ namespace Tizen.NUI.Components /// User can handle Popup button count, head title and content area. /// /// 6 - /// 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 class Popup : Control { private ImageView backgroundImage; @@ -43,12 +41,11 @@ namespace Tizen.NUI.Components /// Creates a new instance of a Popup. /// /// 6 - /// 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 Popup() : base() { Initialize(); } + /// /// Creates a new instance of a Popup with style. /// @@ -60,6 +57,7 @@ namespace Tizen.NUI.Components { Initialize(); } + /// /// Creates a new instance of a Popup with attributes. /// @@ -71,20 +69,17 @@ namespace Tizen.NUI.Components { Initialize(); } + /// /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.
///
/// 6 - /// 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 event EventHandler PopupButtonClickedEvent; + public event EventHandler PopupButtonClickEvent; /// /// Title text string in Popup. /// /// 6 - /// 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 string TitleText { get @@ -111,8 +106,6 @@ namespace Tizen.NUI.Components /// Button count in Popup. ///
/// 6 - /// 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 int ButtonCount { get @@ -133,8 +126,6 @@ namespace Tizen.NUI.Components /// Content view in Popup, only can be gotten. ///
/// 6 - /// 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 View ContentView { get; @@ -253,8 +244,6 @@ namespace Tizen.NUI.Components /// Title text point size in Popup. /// /// 6 - /// 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 float TitlePointSize { get @@ -297,8 +286,6 @@ namespace Tizen.NUI.Components /// Title text color in Popup. /// /// 6 - /// 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 Color TitleTextColor { get @@ -321,8 +308,6 @@ namespace Tizen.NUI.Components /// Title text horizontal alignment in Popup. /// /// 6 - /// 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 HorizontalAlignment TitleTextHorizontalAlignment { get @@ -341,18 +326,16 @@ namespace Tizen.NUI.Components /// Title text's position in Popup. /// /// 6 - /// 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 Position2D TitleTextPosition2D + public Position TitleTextPosition { get { - return popupAttributes?.TitleTextAttributes?.Position2D ?? new Position2D(0, 0); + return popupAttributes?.TitleTextAttributes?.Position ?? new Position(0, 0, 0); } set { CreateTitleTextAttributes(); - popupAttributes.TitleTextAttributes.Position2D = value; + popupAttributes.TitleTextAttributes.Position = value; RelayoutRequest(); } } @@ -361,18 +344,16 @@ namespace Tizen.NUI.Components /// Title text's height in Popup. /// /// 6 - /// 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 int TitleHeight { get { - return popupAttributes?.TitleTextAttributes?.Size2D?.Height ?? 0; + return (int)(popupAttributes?.TitleTextAttributes?.Size?.Height ?? 0); } set { CreateTitleTextAttributes(); - popupAttributes.TitleTextAttributes.Size2D.Height = value; + popupAttributes.TitleTextAttributes.Size.Height = value; RelayoutRequest(); } } @@ -407,18 +388,16 @@ namespace Tizen.NUI.Components /// Button height in Popup. /// /// 6 - /// 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 int ButtonHeight { get { - return popupAttributes?.ButtonAttributes?.Size2D?.Height ?? 0; + return (int)(popupAttributes?.ButtonAttributes?.Size?.Height ?? 0); } set { CreateButtonAttributes(); - popupAttributes.ButtonAttributes.Size2D.Height = value; + popupAttributes.ButtonAttributes.Size.Height = value; RelayoutRequest(); } } @@ -427,9 +406,7 @@ namespace Tizen.NUI.Components /// Button text point size in Popup. /// /// 6 - /// 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 float ButtonPointSize + public float ButtonTextPointSize { get { @@ -451,8 +428,6 @@ namespace Tizen.NUI.Components /// Button text font family in Popup. /// /// 6 - /// 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 string ButtonFontFamily { get @@ -471,8 +446,6 @@ namespace Tizen.NUI.Components /// Button text color in Popup. /// /// 6 - /// 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 Color ButtonTextColor { get @@ -518,8 +491,6 @@ namespace Tizen.NUI.Components /// Button text horizontal alignment in Popup. /// /// 6 - /// 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 HorizontalAlignment ButtonTextAlignment { get @@ -594,8 +565,6 @@ namespace Tizen.NUI.Components /// Button index. /// Button text string. /// 6 - /// 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 void SetButtonText(int index, string text) { if(index < 0 && index >= buttonCount) @@ -618,8 +587,6 @@ namespace Tizen.NUI.Components /// /// Dispose type. /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] protected override void Dispose(DisposeTypes type) { if (disposed) @@ -676,6 +643,7 @@ namespace Tizen.NUI.Components { base.OnFocusGained(); } + /// /// Focus lost callback. /// @@ -761,16 +729,16 @@ namespace Tizen.NUI.Components popupAttributes.TitleTextAttributes.Text = new StringSelector { All = titleText.Text }; w = (int)(Size2D.Width - titleText.PositionX * 2); - if (popupAttributes.TitleTextAttributes.Size2D != null) + if (popupAttributes.TitleTextAttributes.Size != null) { - titleH = titleText.Size2D.Height; + titleH = (int)titleText.Size.Height; } titleText.Size2D = new Size2D(w, titleH); - if (popupAttributes.TitleTextAttributes.Position2D != null) + if (popupAttributes.TitleTextAttributes.Position != null) { - titleX = popupAttributes.TitleTextAttributes.Position2D.X; - titleY = popupAttributes.TitleTextAttributes.Position2D.Y; + titleX = (int)popupAttributes.TitleTextAttributes.Position.X; + titleY = (int)popupAttributes.TitleTextAttributes.Position.Y; } } else @@ -784,9 +752,9 @@ namespace Tizen.NUI.Components UpdateButton(buttonCount); - if (buttonList != null && popupAttributes.ButtonAttributes != null && popupAttributes.ButtonAttributes.Size2D != null) + if (buttonList != null && popupAttributes.ButtonAttributes != null && popupAttributes.ButtonAttributes.Size != null) { - buttonH = popupAttributes.ButtonAttributes.Size2D.Height; + buttonH = (int)popupAttributes.ButtonAttributes.Size.Height; } ContentView.Size2D = new Size2D(Size2D.Width - titleX * 2, Size2D.Height - titleY - titleH - buttonH); ContentView.Position2D = new Position2D(titleX, titleY + titleH); @@ -920,7 +888,7 @@ namespace Tizen.NUI.Components { popupAttributes.TitleTextAttributes = new TextAttributes() { - Size2D = new Size2D(0, 0), + Size = new Size(0, 0), PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, PivotPoint = Tizen.NUI.PivotPoint.TopLeft, @@ -936,7 +904,7 @@ namespace Tizen.NUI.Components { popupAttributes.ButtonAttributes = new ButtonAttributes() { - Size2D = new Size2D(0, 0), + Size = new Size(0, 0), PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft, PivotPoint = Tizen.NUI.PivotPoint.BottomLeft, @@ -997,13 +965,13 @@ namespace Tizen.NUI.Components return; } int buttonWidth = Size2D.Width / count; - int buttonHeight = popupAttributes.ButtonAttributes.Size2D.Height; + int buttonHeight = (int)popupAttributes.ButtonAttributes.Size.Height; int pos = 0; buttonList = new List