+++ /dev/null
-/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-
-namespace Tizen.NUI.Components
-{
- /// <summary>
- /// Base attributes.
- /// </summary>
- /// 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 abstract class Attributes
- {
- /// <summary>
- /// Clone the Attributes, each derived class need to override this method.
- /// </summary>
- /// <returns> Return the attributes clone.</returns>
- /// 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 abstract Attributes Clone();
- }
-}
* limitations under the License.
*
*/
+using System.Collections.Generic;
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class ButtonAttributes : ViewAttributes
+ public class ButtonStyle : ControlStyle
{
+ private bool? isSelectable;
+ private bool? isSelected;
+ private bool? isEnabled;
+ private Button.IconOrientation? iconRelativeOrientation;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IsSelectableProperty = BindableProperty.Create("IsSelectable", typeof(bool?), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ buttonStyle.isSelectable = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ return buttonStyle.isSelectable;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create("IsSelected", typeof(bool?), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ buttonStyle.isSelected = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ return buttonStyle.isSelected;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool?), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ buttonStyle.isEnabled = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ return buttonStyle.isEnabled;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create("IconRelativeOrientation", typeof(Button.IconOrientation?), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ buttonStyle.iconRelativeOrientation = (Button.IconOrientation?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var buttonStyle = (ButtonStyle)bindable;
+ return buttonStyle.iconRelativeOrientation;
+ });
+
/// <summary>
- /// Creates a new instance of a ButtonAttributes.
+ /// Creates a new instance of a ButtonStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ButtonAttributes() : base() { }
+ public ButtonStyle() : base()
+ {
+ InitSubAttributes();
+ }
/// <summary>
- /// Creates a new instance of a ButtonAttributes with attributes.
+ /// Creates a new instance of a ButtonStyle with style.
/// </summary>
- /// <param name="attributes">Create ButtonAttributes by attributes customized by user.</param>
+ /// <param name="style">Create ButtonStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ButtonAttributes(ButtonAttributes attributes) : base(attributes)
+ public ButtonStyle(ButtonStyle style) : base(style)
{
- if(attributes == null)
+ if(style == null)
{
return;
}
- IsSelectable = attributes.IsSelectable;
- IconRelativeOrientation = attributes.IconRelativeOrientation;
+ IsSelectable = style.IsSelectable;
+ IconRelativeOrientation = style.IconRelativeOrientation;
- if (attributes.ShadowImageAttributes != null)
- {
- ShadowImageAttributes = attributes.ShadowImageAttributes.Clone() as ImageAttributes;
- }
+ InitSubAttributes();
- if (attributes.BackgroundImageAttributes != null)
- {
- BackgroundImageAttributes = attributes.BackgroundImageAttributes.Clone() as ImageAttributes;
- }
-
- if (attributes.OverlayImageAttributes != null)
- {
- OverlayImageAttributes = attributes.OverlayImageAttributes.Clone() as ImageAttributes;
- }
-
- if (attributes.TextAttributes != null)
- {
- TextAttributes = attributes.TextAttributes.Clone() as TextAttributes;
- }
-
- if (attributes.IconAttributes != null)
- {
- IconAttributes = attributes.IconAttributes.Clone() as ImageAttributes;
- }
+ Overlay.CopyFrom(style.Overlay);
+ Text.CopyFrom(style.Text);
+ Icon.CopyFrom(style.Icon);
}
/// <summary>
- /// Shadow image's attributes.
+ /// Overlay image's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes ShadowImageAttributes
+ public ImageViewStyle Overlay
{
get;
set;
}
/// <summary>
- /// Background image's attributes.
+ /// Text's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes BackgroundImageAttributes
+ public TextLabelStyle Text
{
get;
set;
}
/// <summary>
- /// Overlay image's attributes.
+ /// Icon's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes OverlayImageAttributes
+ public ImageViewStyle Icon
{
get;
set;
}
- /// <summary>
- /// Text's attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextAttributes TextAttributes
+ public bool? IsSelectable
{
- get;
- set;
+ get
+ {
+ bool? temp = (bool?)GetValue(IsSelectableProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(IsSelectableProperty, value);
+ }
}
- /// <summary>
- /// Icon's attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes IconAttributes
+ public bool? IsSelected
{
- get;
- set;
+ get
+ {
+ bool? temp = (bool?)GetValue(IsSelectedProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(IsSelectedProperty, value);
+ }
}
+
/// <summary>
/// Flag to decide button can be selected or not.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public bool? IsSelectable
+ public bool? IsEnabled
{
- get;
- set;
+ get
+ {
+ bool? temp = (bool?)GetValue(IsEnabledProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(IsEnabledProperty, value);
+ }
}
+
/// <summary>
/// Icon relative orientation.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Button.IconOrientation? IconRelativeOrientation
{
- get;
- set;
+ get
+ {
+ Button.IconOrientation? temp = (Button.IconOrientation?)GetValue(IconRelativeOrientationProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(IconRelativeOrientationProperty, value);
+ }
}
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
+ {
+ base.CopyFrom(bindableObject);
+
+ ButtonStyle buttonAttributes = bindableObject as ButtonStyle;
+
+ if (null != buttonAttributes)
+ {
+ if (null != buttonAttributes.Overlay)
+ {
+ Overlay.CopyFrom(buttonAttributes.Overlay);
+ }
+
+ if (null != buttonAttributes.Text)
+ {
+ Text.CopyFrom(buttonAttributes.Text);
+ }
+
+ if (null != buttonAttributes.Icon)
+ {
+ Icon.CopyFrom(buttonAttributes.Icon);
+ }
+ }
+ }
+
+ private void InitSubAttributes()
+ {
+ Overlay = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent
+ };
+ Overlay.PropertyChanged += SubStyleCalledEvent;
+
+ Text = new TextLabelStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center
+ };
+ Text.PropertyChanged += SubStyleCalledEvent;
+
+ Icon = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.UseNaturalSize,
+ HeightResizePolicy = ResizePolicyType.UseNaturalSize,
+ };
+ Icon.PropertyChanged += SubStyleCalledEvent;
+ }
+
+ private void SubStyleCalledEvent(object sender, global::System.EventArgs e)
{
- return new ButtonAttributes(this);
+ OnPropertyChanged();
}
}
}
--- /dev/null
+/*
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System.Collections.Generic;
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Components
+{
+ /// <summary>
+ /// ButtonAttributes is a class which saves Button's ux data.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ControlStyle : ViewStyle
+ {
+ /// <summary>
+ /// Creates a new instance of a ButtonStyle.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ControlStyle() : base()
+ {
+ InitSubAttributes();
+ }
+ /// <summary>
+ /// Creates a new instance of a ButtonStyle with style.
+ /// </summary>
+ /// <param name="style">Create ButtonStyle by style customized by user.</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ControlStyle(ControlStyle style) : base(style)
+ {
+ if(style == null)
+ {
+ return;
+ }
+
+ InitSubAttributes();
+
+ Shadow.CopyFrom(style.Shadow);
+ Background.CopyFrom(style.Background);
+ }
+
+ /// <summary>
+ /// Shadow image's Style.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen__6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageViewStyle Shadow
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// Background image's Style.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageViewStyle Background
+ {
+ get;
+ set;
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override void CopyFrom(BindableObject bindableObject)
+ {
+ base.CopyFrom(bindableObject);
+
+ ControlStyle controlStyle = bindableObject as ControlStyle;
+
+ if (null != controlStyle)
+ {
+ if (null != controlStyle.Shadow)
+ {
+ Shadow.CopyFrom(controlStyle.Shadow);
+ }
+
+ if (null != controlStyle.Background)
+ {
+ Background.CopyFrom(controlStyle.Background);
+ }
+ }
+ }
+
+ private void InitSubAttributes()
+ {
+ Shadow = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent
+ };
+ Shadow.PropertyChanged += SubStyleCalledEvent;
+
+ Background = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent
+ };
+ Background.PropertyChanged += SubStyleCalledEvent;
+ }
+
+ private void SubStyleCalledEvent(object sender, global::System.EventArgs e)
+ {
+ OnPropertyChanged();
+ }
+ }
+}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using static Tizen.NUI.Components.DropDown;
namespace Tizen.NUI.Components
{
/// <summary>
- /// DropDownAttributes is a class which saves DropDown's ux data.
+ /// DropDownStyle is a class which saves DropDown's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class DropDownAttributes : ViewAttributes
+ public class DropDownStyle : ControlStyle
{
- /// <summary>
- /// Creates a new instance of a DropDownAttributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public DropDownAttributes() : base()
- {
- SpaceBetweenButtonTextAndIcon = 0;
- Space = new Vector4(0, 0, 0, 0);
- ListRelativeOrientation = DropDown.ListOrientation.Left;
- ListMargin = new Vector4(0, 0, 0, 0);
- FocusedItemIndex = 0;
- }
- /// <summary>
- /// Creates a new instance of a DropDownAttributes with attributes.
- /// </summary>
- /// <param name="attributes">Create DropDownAttributes by attributes customized by user.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public DropDownAttributes(DropDownAttributes attributes) : base(attributes)
+ private int spaceBetweenButtonTextAndIcon = 0;
+
+ private Extents _space;
+ private Extents space
{
- if(attributes == null)
+ get
{
- return;
- }
+ if (null == _space)
+ {
+ _space = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ Extents extents = new Extents(start, end, top, bottom);
+ _space.CopyFrom(extents);
+ }, 0, 0, 0, 0);
+ }
- if (attributes.ButtonAttributes != null)
- {
- ButtonAttributes = attributes.ButtonAttributes.Clone() as ButtonAttributes;
+ return _space;
}
+ }
- if (attributes.HeaderTextAttributes != null)
- {
- HeaderTextAttributes = attributes.HeaderTextAttributes.Clone() as TextAttributes;
- }
+ private ListOrientation? listRelativeOrientation = ListOrientation.Left;
- if (attributes.ListBackgroundImageAttributes != null)
+ private bool isListMarginSetted = false;
+ private Extents _listMargin;
+ private Extents listMargin
+ {
+ get
{
- ListBackgroundImageAttributes = attributes.ListBackgroundImageAttributes.Clone() as ImageAttributes;
- }
+ if (null == _listMargin)
+ {
+ _listMargin = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ Extents extents = new Extents(start, end, top, bottom);
+ _listMargin.CopyFrom(extents);
+ }, 0, 0, 0, 0);
+ }
- if (attributes.Space != null)
- {
- Space = new Vector4(attributes.Space.X, attributes.Space.Y, attributes.Space.Z, attributes.Space.W);
+ return _listMargin;
}
+ }
- if (attributes.ListMargin != null)
- {
- ListMargin = new Vector4(attributes.ListMargin.X, attributes.ListMargin.Y, attributes.ListMargin.Z, attributes.ListMargin.W);
- }
+ private int focusedItemIndex = 0;
+ private int selectedItemIndex = 0;
+ private Size listSize;
- if (attributes.ListSize != null)
+ private Extents _listPadding;
+ private Extents listPadding
+ {
+ get
{
- ListSize = new Size(attributes.ListSize.Width, attributes.ListSize.Height);
- }
+ if (null == _listPadding)
+ {
+ _listPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ Extents extents = new Extents(start, end, top, bottom);
+ _listPadding.CopyFrom(extents);
+ }, 0, 0, 0, 0);
+ }
- if (attributes.ListPadding != null)
- {
- ListPadding = attributes.ListPadding;
+ return _listPadding;
}
-
- SpaceBetweenButtonTextAndIcon = attributes.SpaceBetweenButtonTextAndIcon;
- ListRelativeOrientation = attributes.ListRelativeOrientation;
- FocusedItemIndex = attributes.FocusedItemIndex;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SpaceBetweenButtonTextAndIconProperty = BindableProperty.Create("SpaceBetweenButtonTextAndIcon", typeof(int), typeof(DropDownStyle), 0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ dropDownStyle.spaceBetweenButtonTextAndIcon = (int)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ return dropDownStyle.spaceBetweenButtonTextAndIcon;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SpaceProperty = BindableProperty.Create("Space", typeof(Extents), typeof(DropDownStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ dropDownStyle.space.CopyFrom((Extents)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ return dropDownStyle.space;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ListRelativeOrientationProperty = BindableProperty.Create("ListRelativeOrientation", typeof(ListOrientation?), typeof(DropDownStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ dropDownStyle.listRelativeOrientation = (ListOrientation?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ return dropDownStyle.listRelativeOrientation;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ListMarginProperty = BindableProperty.Create("ListMargin", typeof(Extents), typeof(DropDownStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ dropDownStyle.listMargin.CopyFrom((Extents)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ return dropDownStyle.listMargin;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FocusedItemIndexProperty = BindableProperty.Create("FocusedItemIndex", typeof(int), typeof(DropDownStyle), 0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ dropDownStyle.focusedItemIndex = (int)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ return dropDownStyle.focusedItemIndex;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SelectedItemIndexProperty = BindableProperty.Create("SelectedItemIndex", typeof(int), typeof(DropDownStyle), 0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ dropDownStyle.selectedItemIndex = (int)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ return dropDownStyle.selectedItemIndex;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ListSizeProperty = BindableProperty.Create("ListSize", typeof(Size), typeof(DropDownStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ dropDownStyle.listSize = (Size)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ return dropDownStyle.listSize;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ListPaddingProperty = BindableProperty.Create("ListPadding", typeof(Extents), typeof(DropDownStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ dropDownStyle.listPadding.CopyFrom((Extents)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var dropDownStyle = (DropDownStyle)bindable;
+ return dropDownStyle.listPadding;
+ });
+
/// <summary>
- /// DropDown button's attributes.
+ /// Creates a new instance of a DropDownStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ButtonAttributes ButtonAttributes
+ public DropDownStyle() : base()
{
- get;
- set;
+ Button = new ButtonStyle();
+ HeaderText = new TextLabelStyle();
+ ListBackgroundImage = new ImageViewStyle();
+ }
+ /// <summary>
+ /// Creates a new instance of a DropDownStyle with style.
+ /// </summary>
+ /// <param name="style">Create DropDownStyle by style customized by user.</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public DropDownStyle(DropDownStyle style) : base(style)
+ {
+ if(style == null)
+ {
+ return;
+ }
+
+ Button = new ButtonStyle();
+ HeaderText = new TextLabelStyle();
+ ListBackgroundImage = new ImageViewStyle();
+
+ CopyFrom(style);
}
/// <summary>
- /// Header text's attributes.
+ /// DropDown button's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextAttributes HeaderTextAttributes
+ public ButtonStyle Button
{
get;
set;
}
/// <summary>
- /// Space between button text and button icon.
+ /// Header text's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public int SpaceBetweenButtonTextAndIcon
+ public TextLabelStyle HeaderText
{
get;
set;
}
/// <summary>
- /// List background image's attributes.
+ /// List background image's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes ListBackgroundImageAttributes
+ public ImageViewStyle ListBackgroundImage
{
get;
set;
}
/// <summary>
- /// Space in DropDown.
+ /// Space between button text and button icon.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Vector4 Space
+ public int SpaceBetweenButtonTextAndIcon
{
- get;
- set;
+ get
+ {
+ int temp = (int)GetValue(SpaceBetweenButtonTextAndIconProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SpaceBetweenButtonTextAndIconProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Extents Space
+ {
+ get
+ {
+ Extents temp = (Extents)GetValue(SpaceProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SpaceProperty, value);
+ }
}
/// <summary>
/// List relative orientation.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public DropDown.ListOrientation ListRelativeOrientation
+ public ListOrientation? ListRelativeOrientation
{
- get;
- set;
+ get
+ {
+ ListOrientation? temp = (ListOrientation?)GetValue(ListRelativeOrientationProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ListRelativeOrientationProperty, value);
+ }
}
/// <summary>
/// List margin.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Vector4 ListMargin
+ public Extents ListMargin
{
- get;
- set;
+ get
+ {
+ Extents temp = (Extents)GetValue(ListMarginProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ListMarginProperty, value);
+ }
}
/// <summary>
/// Focused item index.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public int FocusedItemIndex
{
+ get
+ {
+ int temp = (int)GetValue(FocusedItemIndexProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(FocusedItemIndexProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int SelectedItemIndex
+ {
+ get
+ {
+ int temp = (int)GetValue(SelectedItemIndexProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SelectedItemIndexProperty, value);
+ }
+ }
+
+ /// <summary>
+ /// List size.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Size ListSize
+ {
+ get
+ {
+ Size temp = (Size)GetValue(ListSizeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ListSizeProperty, value);
+ }
+ }
+
+ /// <summary>
+ /// List padding.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Extents ListPadding
+ {
+ get
+ {
+ Extents temp = (Extents)GetValue(ListPaddingProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ListPaddingProperty, value);
+ }
+ }
+
+ /// <summary>
+ /// Icon's Style.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageViewStyle Icon
+ {
get;
set;
}
/// <summary>
- /// List size.
+ /// Check image's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Size ListSize
+ public ImageViewStyle CheckImage
{
get;
set;
}
/// <summary>
- /// List padding.
+ /// Gap of Check image to boundary.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Extents ListPadding
+ public int CheckImageGapToBoundary
{
get;
set;
}
/// <summary>
- /// Attributes's clone function.
+ /// Flag to decide item is selected or not.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public bool IsSelected
{
- return new DropDownAttributes(this);
+ get;
+ set;
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override void CopyFrom(BindableObject bindableObject)
+ {
+ base.CopyFrom(bindableObject);
+
+ DropDownStyle dropDownStyle = bindableObject as DropDownStyle;
+
+ if (null != dropDownStyle)
+ {
+ Button.CopyFrom(dropDownStyle.Button);
+ HeaderText.CopyFrom(dropDownStyle.HeaderText);
+ ListBackgroundImage.CopyFrom(dropDownStyle.ListBackgroundImage);
+ }
}
}
/// <summary>
- /// DropDownItemAttributes is a class which saves DropDownItem's ux data.
+ /// DropDownItemStyle is a class which saves DropDownItem's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class DropDownItemAttributes : ViewAttributes
+ public class DropDownItemStyle : ControlStyle
{
/// <summary>
- /// Creates a new instance of a DropDownItemAttributes.
+ /// Creates a new instance of a DropDownItemStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public DropDownItemAttributes() : base() { }
+ public DropDownItemStyle() : base() { }
/// <summary>
- /// Creates a new instance of a DropDownItemAttributes with attributes.
+ /// Creates a new instance of a DropDownItemStyle with style.
/// </summary>
- /// <param name="attributes">Create DropDownItemAttributes by attributes customized by user.</param>
+ /// <param name="style">Create DropDownItemStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public DropDownItemAttributes(DropDownItemAttributes attributes) : base(attributes)
+ public DropDownItemStyle(DropDownItemStyle style) : base(style)
{
- if (attributes.TextAttributes != null)
+ if (style.Text!= null)
{
- TextAttributes = attributes.TextAttributes.Clone() as TextAttributes;
+ Text.CopyFrom(style.Text);
}
- if (attributes.IconAttributes != null)
+ if (style.Icon!= null)
{
- IconAttributes = attributes.IconAttributes.Clone() as ImageAttributes;
+ Icon.CopyFrom(style.Icon);
}
- if (attributes.CheckImageAttributes != null)
+ if (style.CheckImage!= null)
{
- CheckImageAttributes = attributes.CheckImageAttributes.Clone() as ImageAttributes;
+ CheckImage.CopyFrom(style.CheckImage);
}
- CheckImageRightSpace = attributes.CheckImageRightSpace;
- IsSelected = attributes.IsSelected;
+ CheckImageGapToBoundary = style.CheckImageGapToBoundary;
+ IsSelected = style.IsSelected;
}
/// <summary>
- /// Text's attributes.
+ /// Text's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextAttributes TextAttributes
+ public TextLabelStyle Text
{
get;
set;
}
/// <summary>
- /// Icon's attributes.
+ /// Icon's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes IconAttributes
+ public ImageViewStyle Icon
{
get;
set;
}
/// <summary>
- /// Check image's attributes.
+ /// Check image's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes CheckImageAttributes
+ public ImageViewStyle CheckImage
{
get;
set;
}
/// <summary>
- /// Right space from check image.
+ /// Gap of Check image to boundary.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImageRightSpace
+ public int CheckImageGapToBoundary
{
get;
set;
get;
set;
}
-
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
- {
- return new DropDownItemAttributes(this);
- }
}
}
* limitations under the License.
*
*/
+using System.Collections.Generic;
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// The image view attributes class.
+ /// ImageControlStyle is a class which saves Button's ux data.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class ImageAttributes : ViewAttributes
+ public class ImageControlStyle : ControlStyle
{
/// <summary>
- /// Construct ImageAttributes.
+ /// Creates a new instance of a ImageControlStyle.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes() : base() { }
+ public ImageControlStyle() : base()
+ {
+ InitSubStyle();
+ }
/// <summary>
- /// Construct with specified attribute.
+ /// Creates a new instance of a ImageControlStyle with style.
/// </summary>
- /// <param name="attributes">The specified ImageAttributes.</param>
+ /// <param name="style">Create ImageControlStyle by style customized by user.</param>
+ /// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes(ImageAttributes attributes) : base(attributes)
+ public ImageControlStyle(ImageControlStyle style) : base(style)
{
- if (attributes == null)
+ if(style == null)
{
return;
}
- if (attributes.ResourceURL != null)
- {
- ResourceURL = attributes.ResourceURL.Clone() as StringSelector;
- }
+ InitSubStyle();
- if (attributes.Border != null)
- {
- Border = attributes.Border.Clone() as RectangleSelector;
- }
+ Image.CopyFrom(style.Image);
}
+
/// <summary>
- /// Image URL.
+ /// Image's Style.
/// </summary>
+ /// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector ResourceURL
+ public ImageViewStyle Image
{
get;
set;
}
- /// <summary>
- /// Image border.
- /// </summary>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public RectangleSelector Border
+ public override void CopyFrom(BindableObject bindableObject)
{
- get;
- set;
+ base.CopyFrom(bindableObject);
+
+ ImageControlStyle imageControlStyle = bindableObject as ImageControlStyle;
+
+ if (null != imageControlStyle)
+ {
+ if (null != imageControlStyle.Image)
+ {
+ Image.CopyFrom(imageControlStyle.Image);
+ }
+ }
}
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// <returns> Return the attributes clone.</returns>
- /// 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 Attributes Clone()
+
+ private void InitSubStyle()
{
- return new ImageAttributes(this);
+ Image = new ImageViewStyle();
+ Image.PropertyChanged += SubStyleCalledEvent;
}
+ private void SubStyleCalledEvent(object sender, global::System.EventArgs e)
+ {
+ OnPropertyChanged();
+ }
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class InputFieldAttributes : ViewAttributes
+ public class InputFieldStyle : ControlStyle
{
/// <summary>
/// Creates a new instance of a InputFieldAttributes.
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public InputFieldAttributes() : base() { }
+ public InputFieldStyle() : base()
+ {
+ BackgroundImageAttributes = new ImageViewStyle();
+ InputBoxAttributes = new TextFieldStyle();
+ }
/// <summary>
- /// Creates a new instance of a InputFieldAttributes with attributes.
+ /// Creates a new instance of a InputFieldStyle with Style.
/// </summary>
- /// <param name="attrs">Create InputFieldAttributes by attributes customized by user.</param>
+ /// <param name="attrs">Create InputFieldStyle by Style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public InputFieldAttributes(InputFieldAttributes attrs) : base(attrs)
+ public InputFieldStyle(InputFieldStyle attrs) : base(attrs)
{
if (null == attrs)
{
return;
}
+
+ BackgroundImageAttributes = new ImageViewStyle();
+ InputBoxAttributes = new TextFieldStyle();
+
if (null != attrs.BackgroundImageAttributes)
{
- BackgroundImageAttributes = attrs.BackgroundImageAttributes.Clone() as ImageAttributes;
+ BackgroundImageAttributes.CopyFrom(attrs.BackgroundImageAttributes);
}
if (null != attrs.InputBoxAttributes)
{
- InputBoxAttributes = attrs.InputBoxAttributes.Clone() as TextFieldAttributes;
+ InputBoxAttributes.CopyFrom(attrs.InputBoxAttributes);
}
if (null != attrs.Space)
{
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes BackgroundImageAttributes
+ public ImageViewStyle BackgroundImageAttributes
{
get;
set;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextFieldAttributes InputBoxAttributes
+ public TextFieldStyle InputBoxAttributes
{
get;
set;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
{
- return new InputFieldAttributes(this);
+ InputFieldStyle inputFieldAttributes = bindableObject as InputFieldStyle;
+
+ if (null != inputFieldAttributes)
+ {
+ Space = inputFieldAttributes.Space;
+
+ if (null != inputFieldAttributes.BackgroundImageAttributes)
+ {
+ BackgroundImageAttributes.CopyFrom(inputFieldAttributes.BackgroundImageAttributes);
+ }
+
+ if (null != inputFieldAttributes.InputBoxAttributes)
+ {
+ InputBoxAttributes.CopyFrom(inputFieldAttributes.InputBoxAttributes);
+ }
+ }
}
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// LoadingAttributes is a class which saves Loading's ux data.
+ /// LoadingStyle is a class which saves Loading's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class LoadingAttributes : ViewAttributes
+ public class LoadingStyle : ControlStyle
{
/// <summary>
- /// Creates a new instance of a LoadingAttributes.
+ /// Creates a new instance of a LoadingStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public LoadingAttributes() : base() { }
+ public LoadingStyle() : base() { }
/// <summary>
- /// Creates a new instance of a LoadingAttributes with attributes.
+ /// Creates a new instance of a LoadingStyle with style.
/// </summary>
- /// <param name="attributes">Create LoadingAttributes by attributes customized by user.</param>
+ /// <param name="style">Create LoadingStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public LoadingAttributes(LoadingAttributes attributes) : base(attributes)
+ public LoadingStyle(LoadingStyle style) : base(style)
{
- if(null == attributes)
+ if(null == style)
{
return;
}
-
- if (null != attributes.FrameRate)
- {
- FrameRate = attributes.FrameRate.Clone() as IntSelector;
- }
- if (null != attributes.LoadingSize)
- {
- LoadingSize = attributes.LoadingSize;
- }
- if (null != attributes.ImageArray)
- {
- ImageArray = attributes.ImageArray;
- }
+ this.CopyFrom(style);
}
/// <summary>
- /// Gets or sets loading image resource array.
+ /// Gets or sets loading image resources.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public string[] ImageArray
+ public string[] Images
{
get;
set;
/// Gets or sets loading image size.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Size LoadingSize
{
/// Gets or sets loading frame per second.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public IntSelector FrameRate
+ public Selector<int?> FrameRate
{
get;
set;
- }
+ } = new Selector<int?>();
/// <summary>
/// Attributes's clone function.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
{
- return new LoadingAttributes(this);
+ base.CopyFrom(bindableObject);
+
+ LoadingStyle loadingStyle = bindableObject as LoadingStyle;
+
+ if (null != loadingStyle)
+ {
+ if (null != loadingStyle.FrameRate)
+ {
+ FrameRate.Clone(loadingStyle.FrameRate);
+ }
+ if (null != loadingStyle.LoadingSize)
+ {
+ LoadingSize = loadingStyle.LoadingSize;
+ }
+ if (null != loadingStyle.Images)
+ {
+ Images = loadingStyle.Images;
+ }
+ }
}
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// PaginationAttributes used to config the pagination represent.
+ /// PaginationStyle used to config the pagination represent.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class PaginationAttributes : ViewAttributes
+ public class PaginationStyle : ControlStyle
{
/// <summary>
- /// Creates a new instance of a PaginationAttributes.
+ /// Creates a new instance of a PaginationStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public PaginationAttributes() : base() { }
+ public PaginationStyle() : base() { }
+
/// <summary>
- /// Creates a new instance of a PaginationAttributes using attributes.
+ /// Creates a new instance of a PaginationStyle using style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public PaginationAttributes(PaginationAttributes attributes) : base(attributes)
+ public PaginationStyle(PaginationStyle style) : base(style)
{
- if (attributes == null)
- {
- return;
- }
+ if (null == style) return;
- if (attributes.IndicatorSize != null)
- {
- IndicatorSize = new Size(attributes.IndicatorSize.Width, attributes.IndicatorSize.Height);
- }
- if (attributes.IndicatorBackgroundURL != null)
- {
- IndicatorBackgroundURL = attributes.IndicatorBackgroundURL.Clone() as string;
- }
- if (attributes.IndicatorSelectURL != null)
- {
- IndicatorSelectURL = attributes.IndicatorSelectURL.Clone() as string;
- }
- IndicatorSpacing = attributes.IndicatorSpacing;
+ this.CopyFrom(style);
}
/// <summary>
/// Gets or sets the size of the indicator.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Size IndicatorSize
{
}
/// <summary>
- /// Gets or sets the background resource of indicator.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string IndicatorBackgroundURL
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets the resource of the select indicator.
+ /// Gets or sets the resource of indicator.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public string IndicatorSelectURL
+ public Selector<string> IndicatorImageURL
{
get;
set;
- }
+ } = new Selector<string>();
/// <summary>
/// Gets or sets the space of the indicator.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public int IndicatorSpacing
{
set;
}
-
/// <summary>
- /// Retrieves a copy of PaginationAttributes.
+ /// Retrieves a copy of PaginationStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
{
- return new PaginationAttributes(this);
- }
+ base.CopyFrom(bindableObject);
+ PaginationStyle paginationStyle = bindableObject as PaginationStyle;
+ if (null != paginationStyle)
+ {
+ if (null != paginationStyle.IndicatorSize)
+ {
+ IndicatorSize = new Size(paginationStyle.IndicatorSize.Width, paginationStyle.IndicatorSize.Height);
+ }
+ if (null != paginationStyle.IndicatorImageURL)
+ {
+ IndicatorImageURL.Clone(paginationStyle.IndicatorImageURL);
+ }
+ IndicatorSpacing = paginationStyle.IndicatorSpacing;
+ }
+ }
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// PopupAttributes is a class which saves Popup's ux data.
+ /// PopupStyle is a class which saves Popup's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class PopupAttributes : ViewAttributes
+ public class PopupStyle : ControlStyle
{
/// <summary>
- /// Creates a new instance of a PopupAttributes.
+ /// Creates a new instance of a PopupStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public PopupAttributes() : base() { }
- /// <summary>
- /// Creates a new instance of a PopupAttributes with attributes.
- /// </summary>
- /// <param name="attributes">Create PopupAttributes by attributes customized by user.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public PopupAttributes(PopupAttributes attributes) : base(attributes)
+ public PopupStyle() : base()
{
- if (attributes.ShadowImageAttributes != null)
- {
- ShadowImageAttributes = attributes.ShadowImageAttributes.Clone() as ImageAttributes;
- }
-
- if (attributes.BackgroundImageAttributes != null)
- {
- BackgroundImageAttributes = attributes.BackgroundImageAttributes.Clone() as ImageAttributes;
- }
-
- if (attributes.TitleTextAttributes != null)
- {
- TitleTextAttributes = attributes.TitleTextAttributes.Clone() as TextAttributes;
- }
-
- if (attributes.ButtonAttributes != null)
- {
- ButtonAttributes = attributes.ButtonAttributes.Clone() as ButtonAttributes;
- }
-
- if(attributes.ShadowOffset != null)
- {
- ShadowOffset = new Vector4(attributes.ShadowOffset.W, attributes.ShadowOffset.X, attributes.ShadowOffset.Y, attributes.ShadowOffset.Z);
- }
-
+ InitSubStyle();
}
/// <summary>
- /// Shadow image's attributes.
+ /// Creates a new instance of a PopupStyle with style.
/// </summary>
+ /// <param name="style">Create PopupStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes ShadowImageAttributes
+ public PopupStyle(PopupStyle style) : base(style)
{
- get;
- set;
+ InitSubStyle();
+ this.CopyFrom(style);
}
/// <summary>
- /// Background image's attributes.
+ /// Title Text's Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes BackgroundImageAttributes
- {
- get;
- set;
- }
-
- /// <summary>
- /// Title Text's attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public TextAttributes TitleTextAttributes
+ public TextLabelStyle Title
{
get;
set;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ButtonAttributes ButtonAttributes
+ public ButtonStyle Buttons
{
get;
set;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
+ {
+ base.CopyFrom(bindableObject);
+
+ PopupStyle popupAttributes = bindableObject as PopupStyle;
+ if (popupAttributes != null)
+ {
+ if (popupAttributes.Shadow != null)
+ {
+ Shadow.CopyFrom(popupAttributes.Shadow);
+ }
+
+ if (popupAttributes.Background != null)
+ {
+ Background.CopyFrom(popupAttributes.Background);
+ }
+
+ if (popupAttributes.Title != null)
+ {
+ Title.CopyFrom(popupAttributes.Title);
+ }
+
+ if (popupAttributes.Buttons != null)
+ {
+ Buttons.CopyFrom(popupAttributes.Buttons);
+ }
+
+ if (popupAttributes.ShadowOffset != null)
+ {
+ ShadowOffset = new Vector4(popupAttributes.ShadowOffset.W, popupAttributes.ShadowOffset.X, popupAttributes.ShadowOffset.Y, popupAttributes.ShadowOffset.Z);
+ }
+ }
+ }
+
+ private void InitSubStyle()
{
- return new PopupAttributes(this);
+ Shadow = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center
+ };
+
+ Background = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent
+ };
+
+ Title = new TextLabelStyle()
+ {
+ Size = new Size(0, 0),
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ VerticalAlignment = VerticalAlignment.Bottom
+ };
+
+ Buttons = new ButtonStyle()
+ {
+ Size = new Size(0, 0),
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+ Text = new TextLabelStyle
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center
+ }
+ };
}
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// ProgressAttributes is a class which saves Progress's ux data.
+ /// ProgressStyle is a class which saves Progress's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class ProgressAttributes : ViewAttributes
+ public class ProgressStyle : ControlStyle
{
/// <summary>
- /// Creates a new instance of a ProgressAttributes.
+ /// Creates a new instance of a ProgressStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ProgressAttributes() : base() { }
+ public ProgressStyle() : base()
+ {
+ InitSubStyle();
+ }
/// <summary>
- /// Creates a new instance of a ProgressAttributes with attributes.
+ /// Creates a new instance of a ProgressStyle with style.
/// </summary>
- /// <param name="attributes">Create ProgressAttributes by attributes customized by user.</param>
+ /// <param name="style">Create ProgressStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ProgressAttributes(ProgressAttributes attributes) : base(attributes)
+ public ProgressStyle(ProgressStyle style) : base(style)
{
- if (null == attributes)
- {
- return;
- }
-
- if (null != attributes.TrackImageAttributes)
- {
- TrackImageAttributes = attributes.TrackImageAttributes.Clone() as ImageAttributes;
- }
-
- if (null != attributes.ProgressImageAttributes)
- {
- ProgressImageAttributes = attributes.ProgressImageAttributes.Clone() as ImageAttributes;
- }
+ if (null == style) return;
- if (null != attributes.BufferImageAttributes)
- {
- BufferImageAttributes = attributes.BufferImageAttributes.Clone() as ImageAttributes;
- }
+ InitSubStyle();
- if (null != attributes.LoadingImageAttributes)
- {
- LoadingImageAttributes = attributes.LoadingImageAttributes.Clone() as ImageAttributes;
- }
+ this.CopyFrom(style);
}
/// <summary>
- /// Get or set Track Image Attributes.
+ /// Get or set track image.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes TrackImageAttributes
+ public ImageViewStyle Track
{
get;
set;
}
/// <summary>
- /// Get or set Progress Image Attributes.
+ /// Get or set progress image.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes ProgressImageAttributes
+ public ImageViewStyle Progress
{
get;
set;
}
/// <summary>
- /// Get or set Buffer Image Attributes.
+ /// Get or set buffer image.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes BufferImageAttributes
+ public ImageViewStyle Buffer
{
get;
set;
}
/// <summary>
- /// Get or set LoadingImageAttributes.
+ /// Clone function.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes LoadingImageAttributes
+ public override void CopyFrom(BindableObject bindableObject)
{
- get;
- set;
+ base.CopyFrom(bindableObject);
+
+ ProgressStyle progressStyle = bindableObject as ProgressStyle;
+
+ if (null != progressStyle)
+ {
+ if (null != progressStyle.Track)
+ {
+ Track.CopyFrom(progressStyle.Track);
+ }
+
+ if (null != progressStyle.Progress)
+ {
+ Progress.CopyFrom(progressStyle.Progress);
+ }
+
+ if (null != progressStyle.Buffer)
+ {
+ Buffer.CopyFrom(progressStyle.Buffer);
+ }
+ }
}
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ private void InitSubStyle()
{
- return new ProgressAttributes(this);
+ Track = new ImageViewStyle()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ PositionUsesPivotPoint = true,
+ ParentOrigin = NUI.ParentOrigin.TopLeft,
+ PivotPoint = NUI.PivotPoint.TopLeft
+ };
+
+ Progress = new ImageViewStyle()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft
+ };
+
+ Buffer = new ImageViewStyle()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft
+ };
}
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// ScrollBarAttributes is a class which saves Scrollbar's ux data.
+ /// ScrollBarStyle is a class which saves Scrollbar's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class ScrollBarAttributes : ViewAttributes
+ public class ScrollBarStyle : ControlStyle
{
/// <summary>
- /// Creates a new instance of a ScrollBarAttributes.
+ /// Creates a new instance of a ScrollBarStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ScrollBarAttributes() : base()
+ public ScrollBarStyle() : base()
{
+ InitSubStyle();
Direction = ScrollBar.DirectionType.Horizontal;
}
/// <summary>
- /// Creates a new instance of a ScrollBarAttributes with attributes.
+ /// Creates a new instance of a ScrollBarStyle with style.
/// </summary>
- /// <param name="attributes">Create ScrollBarAttributes by attributes customized by user.</param>
+ /// <param name="style">Create ScrollBarStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ScrollBarAttributes(ScrollBarAttributes attributes) : base(attributes)
+ public ScrollBarStyle(ScrollBarStyle style) : base(style)
{
- if(attributes == null)
- {
- return;
- }
+ if (null == style) return;
- if (attributes.TrackImageAttributes != null)
- {
- TrackImageAttributes = attributes.TrackImageAttributes.Clone() as ImageAttributes;
- }
+ InitSubStyle();
- if (attributes.ThumbImageAttributes != null)
- {
- ThumbImageAttributes = attributes.ThumbImageAttributes.Clone() as ImageAttributes;
- }
-
- Direction = attributes.Direction;
- Duration = attributes.Duration;
+ this.CopyFrom(style);
}
/// <summary>
- /// Get or set track image attributes
+ /// Get or set track image style
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes TrackImageAttributes
+ public ImageViewStyle Track
{
get;
set;
}
/// <summary>
- /// Get or set thumb image attributes
+ /// Get or set thumb image style
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes ThumbImageAttributes
+ public ImageViewStyle Thumb
{
get;
set;
/// Get or set direction type
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public ScrollBar.DirectionType? Direction
{
/// Get or set duration
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public uint Duration
{
/// Attributes's clone function.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
{
- return new ScrollBarAttributes(this);
+ base.CopyFrom(bindableObject);
+
+ ScrollBarStyle scrollBarStyle = bindableObject as ScrollBarStyle;
+
+ if (null != scrollBarStyle)
+ {
+ if (null != scrollBarStyle.Track)
+ {
+ Track.CopyFrom(scrollBarStyle.Track);
+ }
+
+ if (null != scrollBarStyle.Thumb)
+ {
+ Thumb.CopyFrom(scrollBarStyle.Thumb);
+ }
+
+ Direction = scrollBarStyle.Direction;
+ Duration = scrollBarStyle.Duration;
+ }
}
+ private void InitSubStyle()
+ {
+ Track = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent
+ };
+
+ Thumb = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ WidthResizePolicy = ResizePolicyType.Fixed,
+ HeightResizePolicy = ResizePolicyType.Fixed
+ };
+ }
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// SelectButtonAttributes is a class which saves SelectButton's ux data.
+ /// SelectButtonStyle is a class which saves SelectButton's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class SelectButtonAttributes : ButtonAttributes
+ public class SelectButtonStyle : ButtonStyle
{
/// <summary>
- /// Creates a new instance of a SelectButtonAttributes.
+ /// Creates a new instance of a SelectButtonStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public SelectButtonAttributes() : base() { }
+ public SelectButtonStyle() : base()
+ {
+ IsSelectable = true;
+ CreateSubStyles();
+ }
/// <summary>
- /// Creates a new instance of a SelectButtonAttributes with attributes.
+ /// Creates a new instance of a SelectButtonStyle with style.
/// </summary>
- /// <param name="attributes">Create SelectButtonAttributes by attributes customized by user.</param>
+ /// <param name="style">Create SelectButtonStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public SelectButtonAttributes(SelectButtonAttributes attributes) : base(attributes)
+ public SelectButtonStyle(SelectButtonStyle style) : base(style)
{
- if(attributes == null)
+ if (style == null)
{
return;
}
- if (attributes.CheckImageAttributes != null)
- {
- CheckImageAttributes = attributes.CheckImageAttributes.Clone() as ImageAttributes;
- }
- if (attributes.CheckBackgroundImageAttributes != null)
- {
- CheckBackgroundImageAttributes = attributes.CheckBackgroundImageAttributes.Clone() as ImageAttributes;
- }
+ CreateSubStyles();
- if (attributes.CheckShadowImageAttributes != null)
- {
- CheckShadowImageAttributes = attributes.CheckShadowImageAttributes.Clone() as ImageAttributes;
- }
+ CopyFrom(style);
}
/// <summary>
- /// Check image's attributes.
+ /// Selectable image's attributes.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes CheckImageAttributes
+ public ImageControlStyle SelectableImage
{
get;
set;
}
- /// <summary>
- /// Background image's attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes CheckBackgroundImageAttributes
+ public override void CopyFrom(BindableObject bindableObject)
{
- get;
- set;
- }
+ base.CopyFrom(bindableObject);
- /// <summary>
- /// Shadow image's attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes CheckShadowImageAttributes
- {
- get;
- set;
+ SelectButtonStyle selectButtonStyle = bindableObject as SelectButtonStyle;
+
+ if (null != selectButtonStyle && null != selectButtonStyle.SelectableImage)
+ {
+ SelectableImage.CopyFrom(selectButtonStyle.SelectableImage);
+ }
}
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ private void CreateSubStyles()
{
- return new SelectButtonAttributes(this);
+ SelectableImage = new ImageControlStyle();
}
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using static Tizen.NUI.Components.Slider;
namespace Tizen.NUI.Components
{
/// <summary>
- /// SliderAttributes is a class which saves Slider's ux data.
+ /// SliderStyle is a class which saves Slider's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class SliderAttributes : ViewAttributes
+ public class SliderStyle : ControlStyle
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IndicatorTypeProperty = BindableProperty.Create("IndicatorType", typeof(IndicatorType?), typeof(SliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.SliderStyle)bindable;
+ if (newValue != null)
+ {
+ instance.privateIndicatorType = (IndicatorType)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (SliderStyle)bindable;
+ return instance.privateIndicatorType;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SpaceBetweenTrackAndIndicatorProperty = BindableProperty.Create("SpaceBetweenTrackAndIndicator", typeof(uint?), typeof(SliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (SliderStyle)bindable;
+ if (newValue != null)
+ {
+ instance.privateSpaceBetweenTrackAndIndicator = (uint?)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (SliderStyle)bindable;
+ return instance.privateSpaceBetweenTrackAndIndicator;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TrackThicknessProperty = BindableProperty.Create("TrackThickness", typeof(uint?), typeof(SliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (SliderStyle)bindable;
+ if (newValue != null)
+ {
+ instance.privateTrackThickness = (uint?)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (SliderStyle)bindable;
+ return instance.privateTrackThickness;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TrackPaddingProperty = BindableProperty.Create("TrackPadding", typeof(Extents), typeof(SliderStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (SliderStyle)bindable;
+ if (newValue != null)
+ {
+ instance.trackPadding.CopyFrom((Extents)newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (SliderStyle)bindable;
+ return instance.trackPadding;
+ });
/// <summary>
- /// Creates a new instance of a SliderAttributes.
+ /// Creates a new instance of a SliderStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public SliderAttributes() : base()
+ public SliderStyle() : base()
{
IndicatorType = Slider.IndicatorType.None;
+ InitSubStyle();
}
/// <summary>
- /// Creates a new instance of a SliderAttributes with attributes.
+ /// Creates a new instance of a SliderStyle with style.
/// </summary>
- /// <param name="attributes">Create SliderAttributes by attributes customized by user.</param>
+ /// <param name="style">Create SliderStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public SliderAttributes(SliderAttributes attributes) : base(attributes)
+ public SliderStyle(SliderStyle style) : base(style)
{
- if(attributes == null)
+ if(style == null)
{
return;
}
- if (attributes.BackgroundTrackAttributes != null)
- {
- BackgroundTrackAttributes = attributes.BackgroundTrackAttributes.Clone() as ImageAttributes;
- }
- if (attributes.SlidedTrackAttributes != null)
- {
- SlidedTrackAttributes = attributes.SlidedTrackAttributes.Clone() as ImageAttributes;
- }
- if (attributes.ThumbBackgroundAttributes != null)
- {
- ThumbBackgroundAttributes = attributes.ThumbBackgroundAttributes.Clone() as ImageAttributes;
- }
- if (attributes.ThumbAttributes != null)
- {
- ThumbAttributes = attributes.ThumbAttributes.Clone() as ImageAttributes;
- }
- if (attributes.LowIndicatorImageAttributes != null)
- {
- LowIndicatorImageAttributes = attributes.LowIndicatorImageAttributes.Clone() as ImageAttributes;
- }
- if (attributes.HighIndicatorImageAttributes != null)
- {
- HighIndicatorImageAttributes = attributes.HighIndicatorImageAttributes.Clone() as ImageAttributes;
- }
- if (attributes.LowIndicatorTextAttributes != null)
- {
- LowIndicatorTextAttributes = attributes.LowIndicatorTextAttributes.Clone() as TextAttributes;
- }
- if (attributes.HighIndicatorTextAttributes != null)
- {
- HighIndicatorTextAttributes = attributes.HighIndicatorTextAttributes.Clone() as TextAttributes;
- }
- if (attributes.TrackThickness != null)
- {
- TrackThickness = attributes.TrackThickness;
- }
- if (attributes.SpaceBetweenTrackAndIndicator != null)
- {
- SpaceBetweenTrackAndIndicator = attributes.SpaceBetweenTrackAndIndicator;
- }
- IndicatorType = attributes.IndicatorType;
+
+ InitSubStyle();
+
+ this.CopyFrom(style);
+
+ IndicatorType = style.IndicatorType;
+ }
+
+ /// <summary>
+ /// Get or set background track.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageViewStyle Track
+ {
+ get;
+ set;
}
/// <summary>
- /// Get or set background track attributes
+ /// Get or set slided track.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes BackgroundTrackAttributes
+ public ImageViewStyle Progress
{
get;
set;
}
/// <summary>
- /// Get or set slided track attributes
+ /// Get or set thumb.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes SlidedTrackAttributes
+ public ImageViewStyle Thumb
{
get;
set;
}
/// <summary>
- /// Get or set thumb attributes
+ /// Get or set thumb background.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes ThumbAttributes
+ public ImageViewStyle ThumbBackground
{
get;
set;
}
/// <summary>
- /// Get or set thumb background attributes
+ /// Get or set low indicator image.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes ThumbBackgroundAttributes
+ public ImageViewStyle LowIndicatorImage
{
get;
set;
}
/// <summary>
- /// Get or set low indicator image attributes
+ /// Get or set high indicator image.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes LowIndicatorImageAttributes
+ public ImageViewStyle HighIndicatorImage
{
get;
set;
}
/// <summary>
- /// Get or set high indicator image attributes
+ /// Get or set low indicator text.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes HighIndicatorImageAttributes
+ public TextLabelStyle LowIndicator
{
get;
set;
}
/// <summary>
- /// Get or low indicator text attributes
+ /// Get or set high indicator text.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextAttributes LowIndicatorTextAttributes
+ public TextLabelStyle HighIndicator
{
get;
set;
}
/// <summary>
- /// Get or set high indicator text attributes
+ /// Get or set Indicator type
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextAttributes HighIndicatorTextAttributes
+ public IndicatorType? IndicatorType
+ {
+ get
+ {
+ return (IndicatorType?)GetValue(IndicatorTypeProperty);
+ }
+ set
+ {
+ SetValue(IndicatorTypeProperty, value);
+ }
+ }
+ private IndicatorType? privateIndicatorType
{
get;
set;
[EditorBrowsable(EditorBrowsableState.Never)]
public uint? TrackThickness
{
+ get
+ {
+ return (uint?)GetValue(TrackThicknessProperty);
+ }
+ set
+ {
+ SetValue(TrackThicknessProperty, value);
+ }
+ }
+ private uint? privateTrackThickness
+ {
get;
set;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public uint? SpaceBetweenTrackAndIndicator
{
+ get
+ {
+ return (uint?)GetValue(SpaceBetweenTrackAndIndicatorProperty);
+ }
+ set
+ {
+ SetValue(SpaceBetweenTrackAndIndicatorProperty, value);
+ }
+ }
+ private uint? privateSpaceBetweenTrackAndIndicator
+ {
get;
set;
}
/// <summary>
- /// Get or set Indicator type
+ /// Get or set space between track and indicator
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Slider.IndicatorType IndicatorType
+ public Extents TrackPadding
{
- get;
- set;
+ get
+ {
+ return (Extents)GetValue(TrackPaddingProperty);
+ }
+ set
+ {
+ SetValue(TrackPaddingProperty, value);
+ }
+ }
+ private Extents _trackPadding;
+ private Extents trackPadding
+ {
+ get
+ {
+ if (null == _trackPadding)
+ {
+ _trackPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom)=>
+ {
+ Extents extents = new Extents(start, end, top, bottom);
+ _trackPadding.CopyFrom(extents);
+ }, 0, 0, 0, 0);
+ }
+ return _trackPadding;
+ }
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
+ {
+ base.CopyFrom(bindableObject);
+
+ SliderStyle sliderAttributes = bindableObject as SliderStyle;
+
+ if (null != sliderAttributes)
+ {
+ if (sliderAttributes.Track != null)
+ {
+ if (null == Track)
+ {
+ Track = new ImageViewStyle();
+ }
+ Track.CopyFrom(sliderAttributes.Track);
+ }
+
+ if (sliderAttributes.Progress != null)
+ {
+ if (null == Progress)
+ {
+ Progress = new ImageViewStyle();
+ }
+ Progress.CopyFrom(sliderAttributes.Progress);
+ }
+
+ if (sliderAttributes.Thumb != null)
+ {
+ if (null == Thumb)
+ {
+ Thumb = new ImageViewStyle();
+ }
+ Thumb.CopyFrom(sliderAttributes.Thumb);
+ }
+
+ if (sliderAttributes.ThumbBackground != null)
+ {
+ if (null == ThumbBackground)
+ {
+ ThumbBackground = new ImageViewStyle();
+ }
+ ThumbBackground.CopyFrom(sliderAttributes.ThumbBackground);
+ }
+
+ if (sliderAttributes.LowIndicatorImage != null)
+ {
+ if (null == LowIndicatorImage)
+ {
+ LowIndicatorImage = new ImageViewStyle();
+ }
+ LowIndicatorImage.CopyFrom(sliderAttributes.LowIndicatorImage);
+ }
+
+ if (sliderAttributes.HighIndicatorImage != null)
+ {
+ if (null == HighIndicatorImage)
+ {
+ HighIndicatorImage = new ImageViewStyle();
+ }
+ HighIndicatorImage.CopyFrom(sliderAttributes.HighIndicatorImage);
+ }
+
+ if (sliderAttributes.LowIndicator != null)
+ {
+ if (null == LowIndicator)
+ {
+ LowIndicator = new TextLabelStyle();
+ }
+ LowIndicator.CopyFrom(sliderAttributes.LowIndicator);
+ }
+
+ if (sliderAttributes.HighIndicator != null)
+ {
+ if (null == HighIndicator)
+ {
+ HighIndicator = new TextLabelStyle();
+ }
+ HighIndicator.CopyFrom(sliderAttributes.HighIndicator);
+ }
+
+ if (sliderAttributes.TrackThickness != null)
+ {
+ TrackThickness = sliderAttributes.TrackThickness;
+ }
+
+ if (sliderAttributes.TrackPadding != null)
+ {
+ TrackPadding = sliderAttributes.TrackPadding;
+ }
+ }
+ }
+
+ private void InitSubStyle()
{
- return new SliderAttributes(this);
+ Track = new ImageViewStyle();
+ Progress = new ImageViewStyle();
+ Thumb = new ImageViewStyle();
+ ThumbBackground = new ImageViewStyle();
+ LowIndicatorImage = new ImageViewStyle();
+ HighIndicatorImage = new ImageViewStyle();
+ LowIndicator = new TextLabelStyle();
+ HighIndicator = new TextLabelStyle();
}
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// SwitchAttributes is a class which saves Switch's ux data.
+ /// SwitchStyle is a class which saves Switch's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class SwitchAttributes : ButtonAttributes
+ public class SwitchStyle : ButtonStyle
{
/// <summary>
- /// Creates a new instance of a SwitchAttributes.
+ /// Creates a new instance of a SwitchStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public SwitchAttributes() : base() { }
+ public SwitchStyle() : base()
+ {
+ InitSubStyle();
+ }
+
/// <summary>
- /// Creates a new instance of a SwitchAttributes with attributes.
+ /// Creates a new instance of a SwitchStyle with style.
/// </summary>
- /// <param name="attributes">Create SwitchAttributes by attributes customized by user.</param>
+ /// <param name="style">Create SwitchStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public SwitchAttributes(SwitchAttributes attributes) : base(attributes)
+ public SwitchStyle(SwitchStyle style) : base(style)
{
- if(attributes == null)
+ if(null == style)
{
return;
}
- if (attributes.SwitchHandlerImageAttributes != null)
- {
- SwitchHandlerImageAttributes = attributes.SwitchHandlerImageAttributes.Clone() as ImageAttributes;
- }
- if (attributes.SwitchBackgroundImageAttributes != null)
- {
- SwitchBackgroundImageAttributes = attributes.SwitchBackgroundImageAttributes.Clone() as ImageAttributes;
- }
+ InitSubStyle();
+
+ this.CopyFrom(style);
}
/// <summary>
- /// Handler image's attributes.
+ /// Thumb image's style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes SwitchHandlerImageAttributes
+ public ImageViewStyle Thumb
{
get;
set;
}
/// <summary>
- /// Background image's attributes.
+ /// Track image's style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes SwitchBackgroundImageAttributes
+ public ImageViewStyle Track
{
get;
set;
}
/// <summary>
- /// Attributes's clone function.
+ /// Style's clone function.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
{
- return new SwitchAttributes(this);
+ base.CopyFrom(bindableObject);
+
+ SwitchStyle switchStyle = bindableObject as SwitchStyle;
+
+ if (null != switchStyle)
+ {
+ if (null != switchStyle.Track)
+ {
+ Track.CopyFrom(switchStyle.Track);
+ }
+
+ if (null != switchStyle.Thumb)
+ {
+ Thumb.CopyFrom(switchStyle.Thumb);
+ }
+ }
+ }
+
+ private void InitSubStyle()
+ {
+ Track = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent
+ };
+
+ Thumb = new ImageViewStyle()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft,
+ WidthResizePolicy = ResizePolicyType.Fixed,
+ HeightResizePolicy = ResizePolicyType.Fixed
+ };
}
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// TabAttributes is a class which saves Tab's ux data.
+ /// TabStyle is a class which saves Tab's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class TabAttributes : ViewAttributes
+ public class TabStyle : ControlStyle
{
/// <summary>
- /// Creates a new instance of a TabAttributes.
+ /// Creates a new instance of a TabStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TabAttributes() : base()
+ public TabStyle() : base()
{
- Space = new Vector4(0, 0, 0, 0);
+ ItemPadding = new Extents(0, 0, 0, 0);
UseTextNaturalSize = false;
ItemSpace = 0;
+
+ UnderLine = new ViewStyle();
+ Text = new TextLabelStyle();
}
/// <summary>
- /// Creates a new instance of a TabAttributes with attributes.
+ /// Creates a new instance of a TabStyle with style.
/// </summary>
- /// <param name="attributes">Create TabAttributes by attributes customized by user.</param>
+ /// <param name="style">Create TabStyle by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TabAttributes(TabAttributes attributes) : base(attributes)
+ public TabStyle(TabStyle style) : base(style)
{
- if (null == attributes)
+ UnderLine = new ViewStyle();
+ Text = new TextLabelStyle();
+
+ if (null == style)
{
return;
}
- if (attributes.UnderLineAttributes != null)
+ if (style.UnderLine != null)
{
- UnderLineAttributes = attributes.UnderLineAttributes.Clone() as ViewAttributes;
+ UnderLine.CopyFrom(style.UnderLine);
}
- if (attributes.TextAttributes != null)
+ if (style.Text != null)
{
- TextAttributes = attributes.TextAttributes.Clone() as TextAttributes;
+ Text.CopyFrom(style.Text);
}
- if (attributes.Space != null)
+ if (style.ItemPadding != null)
{
- Space = new Vector4(attributes.Space.X, attributes.Space.Y, attributes.Space.Z, attributes.Space.W);
+ ItemPadding = new Extents(style.ItemPadding.Start, style.ItemPadding.End, style.ItemPadding.Top, style.ItemPadding.Bottom);
}
else
{
- Space = new Vector4(0, 0, 0, 0);
+ ItemPadding = new Extents(0, 0, 0, 0);
+ }
+ ItemSpace = style.ItemSpace;
+ UseTextNaturalSize = style.UseTextNaturalSize;
+
+ if (null != style.UnderLine)
+ {
+ UnderLine.CopyFrom(style.UnderLine);
+ }
+
+ if (null != style.Text)
+ {
+ Text.CopyFrom(style.Text);
}
- ItemSpace = attributes.ItemSpace;
- UseTextNaturalSize = attributes.UseTextNaturalSize;
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ViewAttributes UnderLineAttributes
+ public ViewStyle UnderLine
{
get;
set;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextAttributes TextAttributes
+ public TextLabelStyle Text
{
get;
set;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Vector4 Space
+ public Extents ItemPadding
{
get;
set;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ public override void CopyFrom(BindableObject bindableObject)
{
- return new TabAttributes(this);
+ base.CopyFrom(bindableObject);
+ TabStyle tabStyle = bindableObject as TabStyle;
+
+ if (null != tabStyle)
+ {
+ if (null != tabStyle.ItemPadding)
+ {
+ ItemPadding.CopyFrom(tabStyle.ItemPadding);
+ }
+
+ ItemSpace = tabStyle.ItemSpace;
+ UseTextNaturalSize = tabStyle.UseTextNaturalSize;
+
+ if (null != tabStyle.UnderLine)
+ {
+ UnderLine.CopyFrom(tabStyle.UnderLine);
+ }
+
+ if (null != tabStyle.Text)
+ {
+ Text.CopyFrom(tabStyle.Text);
+ }
+ }
}
}
}
+++ /dev/null
-/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-
-namespace Tizen.NUI.Components
-{
- /// <summary>
- /// The Text Attributes class.
- /// </summary>
- /// 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 TextAttributes : ViewAttributes
- {
- /// <summary>
- /// Construct TextAttributes.
- /// </summary>
- /// 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 TextAttributes() : base() { }
- /// <summary>
- /// Construct with specified attribute.
- /// </summary>
- /// <param name="attributes">The specified TextAttributes.</param>
- /// 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 TextAttributes(TextAttributes attributes) : base(attributes)
- {
- if(attributes == null)
- {
- return;
- }
- if (attributes.Text != null)
- {
- Text = attributes.Text.Clone() as StringSelector;
- }
-
- if (attributes.TranslatableText != null)
- {
- TranslatableText = attributes.TranslatableText.Clone() as StringSelector;
- }
-
- if (attributes.MultiLine != null)
- {
- MultiLine = attributes.MultiLine;
- }
-
- if (attributes.HorizontalAlignment != null)
- {
- HorizontalAlignment = attributes.HorizontalAlignment;
- }
-
- if (attributes.VerticalAlignment != null)
- {
- VerticalAlignment = attributes.VerticalAlignment;
- }
-
- if (attributes.EnableMarkup != null)
- {
- EnableMarkup = attributes.EnableMarkup;
- }
-
- if (attributes.EnableAutoScroll != null)
- {
- EnableAutoScroll = attributes.EnableAutoScroll;
- }
-
- if (attributes.AutoScrollSpeed != null)
- {
- AutoScrollSpeed = attributes.AutoScrollSpeed;
- }
-
- if (attributes.AutoScrollLoopCount != null)
- {
- AutoScrollLoopCount = attributes.AutoScrollLoopCount;
- }
-
- if (attributes.AutoScrollGap != null)
- {
- AutoScrollGap = attributes.AutoScrollGap;
- }
-
- if (attributes.AutoScrollLoopDelay != null)
- {
- AutoScrollLoopDelay = attributes.AutoScrollLoopDelay;
- }
-
- if (attributes.AutoScrollStopMode != null)
- {
- AutoScrollStopMode = attributes.AutoScrollStopMode;
- }
-
- if (attributes.LineSpacing != null)
- {
- LineSpacing = attributes.LineSpacing;
- }
-
- if (attributes.TextColor != null)
- {
- TextColor = attributes.TextColor.Clone() as ColorSelector;
- }
-
- if (attributes.FontFamily != null)
- {
- FontFamily = attributes.FontFamily;
- }
-
- if (attributes.PointSize != null)
- {
- PointSize = attributes.PointSize.Clone() as FloatSelector;
- }
-
- if (attributes.ShadowOffset != null)
- {
- ShadowOffset = attributes.ShadowOffset.Clone() as Vector2Selector;
- }
-
- if (attributes.ShadowColor != null)
- {
- ShadowColor = attributes.ShadowColor.Clone() as ColorSelector;
- }
-
- if (attributes.OutstrokeColor != null)
- {
- OutstrokeColor = attributes.OutstrokeColor.Clone() as ColorSelector;
- }
- if (attributes.OutstrokeThickness != null)
- {
- OutstrokeThickness = attributes.OutstrokeThickness.Clone() as IntSelector;
- }
- }
- /// <summary>
- /// TextLabel Text
- /// </summary>
- /// 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 Text
- {
- get;
- set;
- }
- /// <summary>
- /// The TranslatableText property
- /// </summary>
- /// 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 TranslatableText
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel MultiLine
- /// </summary>
- /// 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? MultiLine
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel HorizontalAlignment
- /// </summary>
- /// 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? HorizontalAlignment
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel VerticalAlignment
- /// </summary>
- /// 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 VerticalAlignment? VerticalAlignment
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel EnableMarkup
- /// </summary>
- /// 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? EnableMarkup
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel EnableAutoScroll
- /// </summary>
- /// 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? EnableAutoScroll
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel AutoScrollSpeed
- /// </summary>
- /// 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? AutoScrollSpeed
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel AutoScrollLoopCount
- /// </summary>
- /// 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? AutoScrollLoopCount
-{
- get;
- set;
- }
- /// <summary>
- /// TextLabel AutoScrollGap
- /// </summary>
- /// 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? AutoScrollGap
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel AutoScrollLoopDelay
- /// </summary>
- /// 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? AutoScrollLoopDelay
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel AutoScrollStopMode
- /// </summary>
- /// 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 AutoScrollStopMode? AutoScrollStopMode
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel LineSpacing
- /// </summary>
- /// 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? LineSpacing
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel TextColor
- /// </summary>
- /// 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 TextColor
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel FontFamily
- /// </summary>
- /// 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;
- set;
- }
- /// <summary>
- /// TextLabel PointSize
- /// </summary>
- /// 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 PointSize
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel ShadowOffset
- /// </summary>
- /// 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 Vector2Selector ShadowOffset
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel ShadowColor
- /// </summary>
- /// 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 ShadowColor
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel OutstrokeColor
- /// </summary>
- /// 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 OutstrokeColor
- {
- get;
- set;
- }
- /// <summary>
- /// TextLabel OutstrokeThickness
- /// </summary>
- /// 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 OutstrokeThickness
- {
- get;
- set;
- }
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// 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 Attributes Clone()
- {
- return new TextAttributes(this);
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-
-namespace Tizen.NUI.Components
-{
- /// <summary>
- /// TextFieldAttributes is a class which saves TextField's ux data.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class TextFieldAttributes : ViewAttributes
- {
- /// <summary>
- /// Creates a new instance of a TextField.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public TextFieldAttributes() : base() { }
-
- /// <summary>
- /// Creates a new instance of a TextField with style.
- /// </summary>
- /// <param name="attributes">Create TextField by special style defined in UX.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public TextFieldAttributes(TextFieldAttributes attributes) : base(attributes)
- {
- if(null == attributes)
- {
- return;
- }
- if (null != attributes.Text)
- {
- Text = attributes.Text.Clone() as StringSelector;
- }
- if (null != attributes.PlaceholderText)
- {
- PlaceholderText = attributes.PlaceholderText.Clone() as StringSelector;
- }
- if (null != attributes.TranslatablePlaceholderText)
- {
- TranslatablePlaceholderText = attributes.TranslatablePlaceholderText.Clone() as StringSelector;
- }
- if (null != attributes.HorizontalAlignment)
- {
- HorizontalAlignment = attributes.HorizontalAlignment;
- }
- if (null != attributes.VerticalAlignment)
- {
- VerticalAlignment = attributes.VerticalAlignment;
- }
- if (null != attributes.EnableMarkup)
- {
- EnableMarkup = attributes.EnableMarkup;
- }
- if (null != attributes.TextColor)
- {
- TextColor = attributes.TextColor.Clone() as ColorSelector;
- }
- if (null != attributes.PlaceholderTextColor)
- {
- PlaceholderTextColor = attributes.PlaceholderTextColor.Clone() as ColorSelector;
- }
- if (null != attributes.PrimaryCursorColor)
- {
- PrimaryCursorColor = attributes.PrimaryCursorColor.Clone() as ColorSelector;
- }
- if (null != attributes.SecondaryCursorColor)
- {
- SecondaryCursorColor = attributes.SecondaryCursorColor.Clone() as ColorSelector;
- }
- if (null != attributes.FontFamily)
- {
- FontFamily = attributes.FontFamily;
- }
- if (null != attributes.PointSize)
- {
- PointSize = attributes.PointSize.Clone() as FloatSelector;
- }
- if (null != attributes.EnableCursorBlink)
- {
- EnableCursorBlink = attributes.EnableCursorBlink;
- }
- if (null != attributes.EnableSelection)
- {
- EnableSelection = attributes.EnableSelection;
- }
- if (null != attributes.CursorWidth)
- {
- CursorWidth = attributes.CursorWidth;
- }
- if (null != attributes.EnableEllipsis)
- {
- EnableEllipsis = attributes.EnableEllipsis;
- }
- }
-
- /// <summary>
- /// Gets or sets text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector Text
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets place holder text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector PlaceholderText
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets translatable place holder text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector TranslatablePlaceholderText
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets horizontal alignment of text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public HorizontalAlignment? HorizontalAlignment
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets vertical alignment of text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public VerticalAlignment? VerticalAlignment
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets enable mark up.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool? EnableMarkup
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets text color.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ColorSelector TextColor
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets place holder text color.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ColorSelector PlaceholderTextColor
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets primary cursor color.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ColorSelector PrimaryCursorColor
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets secondary cursor color.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ColorSelector SecondaryCursorColor
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets font family of text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string FontFamily
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets point size of text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public FloatSelector PointSize
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets enable cursor blink.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool? EnableCursorBlink
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets enable selection.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool? EnableSelection
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets cursor width.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int? CursorWidth
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets if enable ellipsis.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool? EnableEllipsis
- {
- get;
- set;
- }
-
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
- {
- return new TextFieldAttributes(this);
- }
- }
-}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <summary>
- /// ToastAttributes is a class which saves Toast's ux data.
+ /// ToastStyle is a class which saves Toast's ux data.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public class ToastAttributes : ViewAttributes
+ public class ToastStyle : ControlStyle
{
/// <summary>
- /// Creates a new instance of a ToastAttributes.
+ /// Creates a new instance of a ToastStyle.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ToastAttributes() : base() { }
-
- /// <summary>
- /// Creates a new instance of a ToastAttributes with attributes.
- /// </summary>
- /// <param name="attributes">Create ToastAttributes by attributes customized by user.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ToastAttributes(ToastAttributes attributes) : base(attributes)
+ public ToastStyle() : base()
{
- if(null == attributes)
- {
- return;
- }
- if(null != attributes.BackgroundImageAttributes)
- {
- BackgroundImageAttributes = attributes.BackgroundImageAttributes.Clone() as ImageAttributes;
- }
- if(null != attributes.TextAttributes)
- {
- TextAttributes = attributes.TextAttributes.Clone() as TextAttributes;
- }
- TextLineHeight = attributes.TextLineHeight;
- TextLineSpace = attributes.TextLineSpace;
- Duration = attributes.Duration;
+ InitSubStyle();
}
/// <summary>
- /// Gets or sets background image attributes.
+ /// Creates a new instance of a ToastStyle with Style.
/// </summary>
+ /// <param name="Style">Create ToastStyle by Style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ImageAttributes BackgroundImageAttributes
+ public ToastStyle(ToastStyle style) : base(style)
{
- get;
- set;
+ InitSubStyle();
+ this.CopyFrom(style);
}
/// <summary>
- /// Gets or sets text attributes.
+ /// Gets or sets background image Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public TextAttributes TextAttributes
+ public ImageViewStyle Background
{
get;
set;
}
/// <summary>
- /// Gets or sets toast text line height.
+ /// Gets or sets text Style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public uint? TextLineHeight
+ public TextLabelStyle Text
{
get;
set;
}
/// <summary>
- /// Gets or sets toast text line space.
+ /// Gets or sets toast show duration time.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public uint? TextLineSpace
+ public uint? Duration
{
get;
set;
}
/// <summary>
- /// Gets or sets toast show duration time.
+ /// Style's clone function.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public uint? Duration
+ public override void CopyFrom(BindableObject bindableObject)
{
- get;
- set;
+ base.CopyFrom(bindableObject);
+ ToastStyle toastStyle = bindableObject as ToastStyle;
+ if (toastStyle != null)
+ {
+ if (toastStyle.Background!= null)
+ {
+ Background.CopyFrom(toastStyle.Background);
+ }
+
+ if (toastStyle.Text!= null)
+ {
+ Text.CopyFrom(toastStyle.Text);
+ }
+ Duration = toastStyle.Duration;
+ }
}
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public override Attributes Clone()
+ private void InitSubStyle()
{
- return new ToastAttributes(this);
+ if (Background== null)
+ {
+ Background= new ImageViewStyle();
+ }
+
+ if (Text== null)
+ {
+ Text= new TextLabelStyle();
+ }
}
}
}
+++ /dev/null
-/*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System.ComponentModel;
-
-namespace Tizen.NUI.Components
-{
- /// <summary>
- /// The base class for Children attributes in Components.
- /// </summary>
- /// 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 ViewAttributes : Attributes
- {
- /// <summary>
- /// Construct ViewAttributes.
- /// </summary>
- /// 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 ViewAttributes() : base() { }
- /// <summary>
- /// Constructs a ViewAttributes that is a copy of attrs.
- /// </summary>
- /// <param name="attributes">Construct Attributes</param>
- /// 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 ViewAttributes(ViewAttributes attributes)
- {
- if (attributes == null)
- {
- return;
- }
-
- if (attributes.Position != null)
- {
- Position = new Position(attributes.Position.X, attributes.Position.Y, attributes.Position.Z);
- }
-
- if (attributes.Size != null)
- {
- Size = new Size(attributes.Size.Width, attributes.Size.Height, attributes.Size.Depth);
- }
-
- if (attributes.BackgroundColor != null)
- {
- BackgroundColor = attributes.BackgroundColor.Clone() as ColorSelector;
- }
-
- if (attributes.PositionUsesPivotPoint != null)
- {
- PositionUsesPivotPoint = attributes.PositionUsesPivotPoint;
- }
-
- if (attributes.ParentOrigin != null)
- {
- ParentOrigin = new Position(attributes.ParentOrigin.X, attributes.ParentOrigin.Y, attributes.ParentOrigin.Z);
- }
-
- if (attributes.PivotPoint != null)
- {
- PivotPoint = new Position(attributes.PivotPoint.X, attributes.PivotPoint.Y, attributes.PivotPoint.Z);
- }
-
- if (attributes.WidthResizePolicy != null)
- {
- WidthResizePolicy = attributes.WidthResizePolicy;
- }
-
- if (attributes.HeightResizePolicy != null)
- {
- HeightResizePolicy = attributes.HeightResizePolicy;
- }
-
- if (attributes.MinimumSize != null)
- {
- MinimumSize = new Size2D(attributes.MinimumSize.Width, attributes.MinimumSize.Height);
- }
-
- if (attributes.SizeModeFactor != null)
- {
- SizeModeFactor = new Vector3(attributes.SizeModeFactor.X, attributes.SizeModeFactor.Y, attributes.SizeModeFactor.Z);
- }
-
- if (attributes.Opacity != null)
- {
- Opacity = attributes.Opacity.Clone() as FloatSelector;
- }
-
- PaddingLeft = attributes.PaddingLeft;
- PaddingRight = attributes.PaddingRight;
- PaddingTop = attributes.PaddingTop;
- PaddingBottom = attributes.PaddingBottom;
- }
- /// <summary>
- /// View Position
- /// </summary>
- /// 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 Position Position
- {
- get;
- set;
- }
- /// <summary>
- /// View Size
- /// </summary>
- /// 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 Size Size
- {
- get;
- set;
- }
- /// <summary>
- /// View BackgroundColor
- /// </summary>
- /// 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 BackgroundColor
- {
- get;
- set;
- }
- /// <summary>
- /// View PositionUsesPivotPoint
- /// </summary>
- /// 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? PositionUsesPivotPoint
- {
- get;
- set;
- }
- /// <summary>
- /// View ParentOrigin
- /// </summary>
- /// 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 Position ParentOrigin
- {
- get;
- set;
- }
- /// <summary>
- /// View PivotPoint
- /// </summary>
- /// 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 Position PivotPoint
- {
- get;
- set;
- }
- /// <summary>
- /// View WidthResizePolicy
- /// </summary>
- /// 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 ResizePolicyType? WidthResizePolicy
- {
- get;
- set;
- }
- /// <summary>
- /// View HeightResizePolicy
- /// </summary>
- /// 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 ResizePolicyType? HeightResizePolicy
- {
- get;
- set;
- }
- /// <summary>
- /// View MinimumSize
- /// </summary>
- /// 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 MinimumSize
- {
- get;
- set;
- }
- /// <summary>
- /// View SizeModeFactor
- /// </summary>
- /// 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 Vector3 SizeModeFactor
- {
- get;
- set;
- }
- /// <summary>
- /// View Opacity
- /// </summary>
- /// 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 Opacity
- {
- get;
- set;
- }
- /// <summary>
- /// View left padding
- /// </summary>
- /// 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 PaddingLeft
- {
- get;
- set;
- }
- /// <summary>
- /// View right padding
- /// </summary>
- /// 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 PaddingRight
- {
- get;
- set;
- }
- /// <summary>
- /// View top padding
- /// </summary>
- /// 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 PaddingTop
- {
- get;
- set;
- }
- /// <summary>
- /// View bottom padding
- /// </summary>
- /// 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 PaddingBottom
- {
- get;
- set;
- }
- /// <summary>
- /// Attributes's clone function.
- /// </summary>
- /// 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 Attributes Clone()
- {
- return new ViewAttributes(this);
- }
-
- }
-}
using System;
using System.ComponentModel;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <since_tizen> 6 </since_tizen>
public class Button : Control
{
- private ImageView backgroundImage;
- private ImageView shadowImage;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create("IconRelativeOrientation", typeof(IconOrientation?), typeof(Tizen.NUI.Components.Button), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.Button)bindable;
+ if (newValue != null)
+ {
+ instance.privateIconRelativeOrientation = (IconOrientation?)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.Button)bindable;
+ return instance.privateIconRelativeOrientation;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.Button)bindable;
+ if (newValue != null)
+ {
+ instance.privateIsEnabled = (bool)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.Button)bindable;
+ return instance.privateIsEnabled;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create("IsSelected", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.Button)bindable;
+ if (newValue != null)
+ {
+ instance.privateIsSelected = (bool)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.Button)bindable;
+ return instance.privateIsSelected;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IsSelectableProperty = BindableProperty.Create("IsSelectable", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.Button)bindable;
+ if (newValue != null)
+ {
+ instance.privateIsSelectable = (bool)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.Button)bindable;
+ return instance.privateIsSelectable;
+ });
+
private ImageView overlayImage;
private TextLabel buttonText;
private ImageView buttonIcon;
- private ButtonAttributes buttonAttributes;
private EventHandler<StateChangedEventArgs> stateChangeHander;
private bool isSelected = false;
private bool isEnabled = true;
private bool isPressed = false;
+
/// <summary>
/// Creates a new instance of a Button.
/// </summary>
{
Initialize();
}
+
/// <summary>
/// Creates a new instance of a Button with style.
/// </summary>
{
Initialize();
}
+
/// <summary>
/// Creates a new instance of a Button with attributes.
/// </summary>
- /// <param name="attributes">Create Button by attributes customized by user.</param>
+ /// <param name="controlStyle">Create Button by attributes customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Button(ButtonAttributes attributes) : base(attributes)
+ public Button(ButtonStyle controlStyle) : base(controlStyle)
{
Initialize();
}
+
/// <summary>
/// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
/// </summary>
/// <since_tizen> 6 </since_tizen>
Right,
}
- /// <summary>
- /// Flag to decide Button can be selected or not.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- public bool IsSelectable
- {
- get
- {
- return buttonAttributes?.IsSelectable ?? false;
- }
- set
- {
- buttonAttributes.IsSelectable = value;
- }
- }
- /// <summary>
- /// Background image's resource url in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string BackgroundImageURL
- {
- get
- {
- return buttonAttributes?.BackgroundImageAttributes?.ResourceURL?.All;
- }
- set
- {
- if (value != null)
- {
- CreateBackgroundAttributes();
- if (buttonAttributes.BackgroundImageAttributes.ResourceURL == null)
- {
- buttonAttributes.BackgroundImageAttributes.ResourceURL = new StringSelector();
- }
- buttonAttributes.BackgroundImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
- }
- }
- /// <summary>
- /// Background image's border in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Rectangle BackgroundImageBorder
- {
- get
- {
- return buttonAttributes?.BackgroundImageAttributes?.Border?.All;
- }
- set
- {
- if (value != null)
- {
- CreateBackgroundAttributes();
- if (buttonAttributes.BackgroundImageAttributes.Border == null)
- {
- buttonAttributes.BackgroundImageAttributes.Border = new RectangleSelector();
- }
- buttonAttributes.BackgroundImageAttributes.Border.All = value;
- RelayoutRequest();
- }
- }
- }
- /// <summary>
- /// Shadow image's resource url in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public string ShadowImageURL
- {
- get
- {
- return buttonAttributes?.ShadowImageAttributes?.ResourceURL?.All;
- }
- set
- {
- if (value != null)
- {
- CreateShadowAttributes();
- if (buttonAttributes.ShadowImageAttributes.ResourceURL == null)
- {
- buttonAttributes.ShadowImageAttributes.ResourceURL = new StringSelector();
- }
- buttonAttributes.ShadowImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
- }
- }
+ public new ButtonStyle Style => ViewStyle as ButtonStyle;
+
/// <summary>
- /// Shadow image's border in Button.
+ /// The text of Button.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Rectangle ShadowImageBorder
+ public string Text
{
get
{
- return buttonAttributes?.ShadowImageAttributes?.Border?.All;
+ return Style.Text.Text.GetValue(ControlState);
}
set
{
- if (value != null)
- {
- CreateShadowAttributes();
- if (buttonAttributes.ShadowImageAttributes.Border == null)
- {
- buttonAttributes.ShadowImageAttributes.Border = new RectangleSelector();
- }
- buttonAttributes.ShadowImageAttributes.Border.All = value;
- RelayoutRequest();
- }
+ Style.Text.Text = value;
}
}
+
/// <summary>
- /// Overlay image's resource url in Button.
+ /// Flag to decide Button can be selected or not.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string OverlayImageURL
+ public bool IsSelectable
{
get
{
- return buttonAttributes?.OverlayImageAttributes?.ResourceURL?.All;
+ return (bool)GetValue(IsSelectableProperty);
}
set
{
- if (value != null)
- {
- CreateOverlayAttributes();
- if (buttonAttributes.OverlayImageAttributes.ResourceURL == null)
- {
- buttonAttributes.OverlayImageAttributes.ResourceURL = new StringSelector();
- }
- buttonAttributes.OverlayImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
+ SetValue(IsSelectableProperty, value);
}
}
- /// <summary>
- /// Overlay image's border in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Rectangle OverlayImageBorder
+
+ private bool privateIsSelectable
{
get
{
- return buttonAttributes?.OverlayImageAttributes?.Border?.All;
+ return Style?.IsSelectable ?? false;
}
set
{
- if (value != null)
- {
- CreateOverlayAttributes();
- if (buttonAttributes.OverlayImageAttributes.Border == null)
- {
- buttonAttributes.OverlayImageAttributes.Border = new RectangleSelector();
- }
- buttonAttributes.OverlayImageAttributes.Border.All = value;
- RelayoutRequest();
- }
+ Style.IsSelectable = value;
}
}
- /// <summary>
- /// Text string in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- public string Text
- {
- get
- {
- return buttonAttributes?.TextAttributes?.Text?.All;
- }
- set
- {
- if (value != null)
- {
- CreateTextAttributes();
- if(buttonAttributes.TextAttributes.Text == null)
- {
- buttonAttributes.TextAttributes.Text = new StringSelector();
- }
- buttonAttributes.TextAttributes.Text.All = value;
- RelayoutRequest();
- }
- }
- }
/// <summary>
/// Translate text string in Button.
/// </summary>
{
get
{
- return buttonAttributes?.TextAttributes?.TranslatableText?.All;
+ return Style?.Text?.TranslatableText?.All;
}
set
{
if (value != null)
{
- CreateTextAttributes();
- if (buttonAttributes.TextAttributes.TranslatableText == null)
+ if (Style.Text.TranslatableText == null)
{
- buttonAttributes.TextAttributes.TranslatableText = new StringSelector();
+ Style.Text.TranslatableText = new Selector<string>();
}
- buttonAttributes.TextAttributes.TranslatableText.All = value;
-
- RelayoutRequest();
+ Style.Text.TranslatableText.All = value;
}
}
}
+
/// <summary>
/// Text point size in Button.
/// </summary>
{
get
{
- return buttonAttributes?.TextAttributes?.PointSize?.All ?? 0;
+ return Style?.Text?.PointSize?.All ?? 0;
}
set
{
- CreateTextAttributes();
- if (buttonAttributes.TextAttributes.PointSize == null)
+ if (Style.Text.PointSize == null)
{
- buttonAttributes.TextAttributes.PointSize = new FloatSelector();
+ Style.Text.PointSize = new Selector<float?>();
}
- buttonAttributes.TextAttributes.PointSize.All = value;
- RelayoutRequest();
+ Style.Text.PointSize.All = value;
}
}
+
/// <summary>
/// Text font family in Button.
/// </summary>
{
get
{
- return buttonAttributes?.TextAttributes?.FontFamily;
+ return Style?.Text?.FontFamily.All;
}
set
{
- CreateTextAttributes();
- buttonAttributes.TextAttributes.FontFamily = value;
- RelayoutRequest();
+ Style.Text.FontFamily = value;
}
}
/// <summary>
{
get
{
- return buttonAttributes?.TextAttributes?.TextColor?.All;
+ return Style?.Text?.TextColor?.All;
}
set
{
- CreateTextAttributes();
- if (buttonAttributes.TextAttributes.TextColor == null)
+ if (Style.Text.TextColor == null)
{
- buttonAttributes.TextAttributes.TextColor = new ColorSelector();
+ Style.Text.TextColor = new Selector<Color>();
}
- buttonAttributes.TextAttributes.TextColor.All = value;
- RelayoutRequest();
+ Style.Text.TextColor.All = value;
}
}
/// <summary>
{
get
{
- return buttonAttributes?.TextAttributes?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ return Style?.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
}
set
{
- CreateTextAttributes();
- buttonAttributes.TextAttributes.HorizontalAlignment = value;
- RelayoutRequest();
+ Style.Text.HorizontalAlignment = value;
}
}
/// <summary>
{
get
{
- return buttonAttributes?.IconAttributes?.ResourceURL?.All;
+ return Style?.Icon?.ResourceUrl?.All;
}
set
{
if (value != null)
{
- CreateIconAttributes();
- if (buttonAttributes.IconAttributes.ResourceURL == null)
+ if (Style.Icon.ResourceUrl == null)
{
- buttonAttributes.IconAttributes.ResourceURL = new StringSelector();
+ Style.Icon.ResourceUrl = new Selector<string>();
}
- buttonAttributes.IconAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.Icon.ResourceUrl.All = value;
}
}
}
{
get
{
- return buttonAttributes?.TextAttributes?.Text;
+ return (StringSelector)Style?.Text?.Text;
}
set
{
if (value != null)
{
- CreateTextAttributes();
- buttonAttributes.TextAttributes.Text = value.Clone() as StringSelector;
- RelayoutRequest();
+ Style.Text.Text = value.Clone() as StringSelector;
}
}
}
{
get
{
- return buttonAttributes?.TextAttributes?.TranslatableText;
+ return (StringSelector)Style?.Text?.TranslatableText;
}
set
{
if (value != null)
{
- CreateTextAttributes();
- buttonAttributes.TextAttributes.TranslatableText = value.Clone() as StringSelector;
- RelayoutRequest();
+ Style.Text.TranslatableText = value.Clone() as StringSelector;
}
}
}
+
/// <summary>
/// Text color selector in Button.
/// </summary>
{
get
{
- return buttonAttributes?.TextAttributes?.TextColor;
+ return (ColorSelector)Style?.Text?.TextColor;
}
set
{
if(value != null)
{
- CreateTextAttributes();
- buttonAttributes.TextAttributes.TextColor = value.Clone() as ColorSelector;
- RelayoutRequest();
+ Style.Text.TextColor = value.Clone() as ColorSelector;
}
}
}
+
/// <summary>
/// Text font size selector in Button.
/// </summary>
{
get
{
- return buttonAttributes?.TextAttributes?.PointSize;
+ return (FloatSelector)Style?.Text?.PointSize;
}
set
{
if (value != null)
{
- CreateTextAttributes();
- buttonAttributes.TextAttributes.PointSize = value.Clone() as FloatSelector;
- RelayoutRequest();
+ Style.Text.PointSize = value.Clone() as FloatSelector;
}
}
}
+
/// <summary>
/// Icon image's resource url selector in Button.
/// </summary>
{
get
{
- return buttonAttributes?.IconAttributes?.ResourceURL;
+ return (StringSelector)Style?.Icon?.ResourceUrl;
}
set
{
if (value != null)
{
- CreateIconAttributes();
- buttonAttributes.IconAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
- }
- }
- }
- /// <summary>
- /// Background image's resource url selector in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector BackgroundImageURLSelector
- {
- get
- {
- return buttonAttributes?.BackgroundImageAttributes?.ResourceURL;
- }
- set
- {
- if (value != null)
- {
- CreateBackgroundAttributes();
- buttonAttributes.BackgroundImageAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
+ Style.Icon.ResourceUrl = value.Clone() as StringSelector;
}
}
}
+
/// <summary>
- /// Background image's border selector in Button.
+ /// Flag to decide selected state in Button.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public RectangleSelector BackgroundImageBorderSelector
+ public bool IsSelected
{
get
{
- return buttonAttributes?.BackgroundImageAttributes?.Border;
+ return (bool)GetValue(IsSelectedProperty);
}
set
{
- if (value != null)
- {
- CreateBackgroundAttributes();
- buttonAttributes.BackgroundImageAttributes.Border = value.Clone() as RectangleSelector;
- RelayoutRequest();
- }
+ SetValue(IsSelectedProperty, value);
}
}
- /// <summary>
- /// Shadow image's resource url selector in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector ShadowImageURLSelector
+ private bool privateIsSelected
{
get
{
- return buttonAttributes?.ShadowImageAttributes?.ResourceURL;
+ return isSelected;
}
set
{
- if (value != null)
- {
- CreateShadowAttributes();
- buttonAttributes.ShadowImageAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
- }
+ isSelected = value;
+ UpdateState();
}
}
/// <summary>
- /// Shadow image's border selector in Button.
+ /// Flag to decide enable or disable in Button.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public RectangleSelector ShadowImageBorderSelector
+ public bool IsEnabled
{
get
{
- return buttonAttributes?.ShadowImageAttributes?.Border;
+ return (bool)GetValue(IsEnabledProperty);
}
set
{
- if (value != null)
- {
- CreateShadowAttributes();
- buttonAttributes.ShadowImageAttributes.Border = value.Clone() as RectangleSelector;
- RelayoutRequest();
- }
+ SetValue(IsEnabledProperty, value);
}
}
- /// <summary>
- /// Overlay image's resource url selector in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector OverlayImageURLSelector
+ private bool privateIsEnabled
{
get
{
- return buttonAttributes?.OverlayImageAttributes?.ResourceURL;
+ return isEnabled;
}
set
{
- if (value != null)
- {
- CreateOverlayAttributes();
- buttonAttributes.OverlayImageAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
- }
+ isEnabled = value;
+ UpdateState();
}
}
+
/// <summary>
- /// Overlay image's border selector in Button.
+ /// Icon relative orientation in Button, work only when show icon and text.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public RectangleSelector OverlayImageBorderSelector
- {
- get
- {
- return buttonAttributes?.OverlayImageAttributes?.Border;
- }
- set
- {
- if (value != null)
- {
- CreateOverlayAttributes();
- buttonAttributes.OverlayImageAttributes.Border = value.Clone() as RectangleSelector;
- RelayoutRequest();
- }
- }
- }
- /// <summary>
- /// Flag to decide selected state in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- public bool IsSelected
- {
- get
- {
- return isSelected;
- }
- set
- {
- isSelected = value;
- UpdateState();
- }
- }
- /// <summary>
- /// Flag to decide enable or disable in Button.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- public bool IsEnabled
+ public IconOrientation? IconRelativeOrientation
{
get
{
- return isEnabled;
+ return (IconOrientation?)GetValue(IconRelativeOrientationProperty);
}
set
{
- isEnabled = value;
- UpdateState();
+ SetValue(IconRelativeOrientationProperty, value);
}
}
-
- /// <summary>
- /// Icon relative orientation in Button, work only when show icon and text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public IconOrientation? IconRelativeOrientation
+ private IconOrientation? privateIconRelativeOrientation
{
get
{
- return buttonAttributes?.IconRelativeOrientation;
+ return Style?.IconRelativeOrientation;
}
set
{
- if(buttonAttributes != null && buttonAttributes.IconRelativeOrientation != value)
+ if(Style != null && Style.IconRelativeOrientation != value)
{
- buttonAttributes.IconRelativeOrientation = value;
- RelayoutRequest();
+ Style.IconRelativeOrientation = value;
+ UpdateUIContent();
}
}
}
{
get
{
- 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);
- }
+ return Style.Icon.Padding;
}
set
{
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();
+ Style.Icon.Padding.CopyFrom(value);
}
}
}
{
get
{
- 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);
- }
+ return Style.Text.Padding;
}
set
{
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();
+ Style.Text.Padding.CopyFrom(value);
}
}
}
{
Utility.Dispose(overlayImage);
}
- if (backgroundImage != null)
- {
- Utility.Dispose(backgroundImage);
- }
- if (shadowImage != null)
- {
- Utility.Dispose(shadowImage);
- }
}
base.Dispose(type);
if (key.KeyPressedName == "Return")
{
isPressed = false;
- if (buttonAttributes.IsSelectable != null && buttonAttributes.IsSelectable == true)
+ if (Style.IsSelectable != null && Style.IsSelectable == true)
{
isSelected = !isSelected;
}
public override bool OnTouch(Touch touch)
{
PointStateType state = touch.GetState(0);
-
+
switch(state)
{
case PointStateType.Down:
return true;
case PointStateType.Up:
isPressed = false;
- if (buttonAttributes.IsSelectable != null && buttonAttributes.IsSelectable == true)
+ if (Style.IsSelectable != null && Style.IsSelectable == true)
{
isSelected = !isSelected;
}
}
return base.OnTouch(touch);
}
- /// <summary>
- /// Get Button attribues.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
- {
- return new ButtonAttributes();
- }
- /// <summary>
- /// Update Button by attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
+ public override void ApplyStyle(ViewStyle viewStyle)
{
- if (buttonAttributes.ShadowImageAttributes != null)
- {
- if(shadowImage == null)
- {
- shadowImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
- this.Add(shadowImage);
- }
- ApplyAttributes(shadowImage, buttonAttributes.ShadowImageAttributes);
- }
+ base.ApplyStyle(viewStyle);
- if (buttonAttributes.BackgroundImageAttributes != null)
- {
- if(backgroundImage == null)
- {
- backgroundImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
- this.Add(backgroundImage);
- }
- ApplyAttributes(backgroundImage, buttonAttributes.BackgroundImageAttributes);
- }
+ ButtonStyle buttonStyle = viewStyle as ButtonStyle;
- if (buttonAttributes.OverlayImageAttributes != null)
+ if (null != buttonStyle)
{
- if(overlayImage == null)
+ if (null == overlayImage)
{
overlayImage = new ImageView()
{
};
this.Add(overlayImage);
}
- ApplyAttributes(overlayImage, buttonAttributes.OverlayImageAttributes);
- }
- if (buttonAttributes.TextAttributes != null)
- {
- if(buttonText == null)
+ if (null == buttonText)
{
buttonText = new TextLabel();
this.Add(buttonText);
}
- ApplyAttributes(buttonText, buttonAttributes.TextAttributes);
- }
- if (buttonAttributes.IconAttributes != null)
- {
- if(buttonIcon == null)
+ if (null == buttonIcon)
{
buttonIcon = new ImageView();
buttonIcon.Relayout += OnIconRelayout;
this.Add(buttonIcon);
}
- ApplyAttributes(buttonIcon, buttonAttributes.IconAttributes);
- }
- MeasureText();
- LayoutChild();
+ overlayImage.ApplyStyle(buttonStyle.Overlay);
+ buttonText.ApplyStyle(buttonStyle.Text);
+ buttonIcon.ApplyStyle(buttonStyle.Icon);
+ }
+ }
- Sensitive = isEnabled ? true : false;
+ /// <summary>
+ /// Get Button attribues.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override ViewStyle GetViewStyle()
+ {
+ return new ButtonStyle();
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected void UpdateState()
{
- ControlStates sourceState = State;
+ ControlStates sourceState = ControlState;
ControlStates targetState;
if(isEnabled)
{
targetState = IsSelected ? ControlStates.DisabledSelected : (IsFocused ? ControlStates.DisabledFocused : ControlStates.Disabled);
}
+
if(sourceState != targetState)
{
- State = targetState;
+ ControlState = targetState;
OnUpdate();
stateChangeHander?.Invoke(this, e);
}
}
+
/// <summary>
/// It is hijack by using protected, attributes copy problem when class inherited from Button.
/// </summary>
/// <since_tizen> 6 </since_tizen>
private void Initialize()
{
- buttonAttributes = attributes as ButtonAttributes;
- if (buttonAttributes == null)
- {
- throw new Exception("Button attribute parse error.");
- }
-
- ApplyAttributes(this, buttonAttributes);
+ UpdateState();
LayoutDirectionChanged += OnLayoutDirectionChanged;
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void MeasureText()
{
- if (buttonAttributes.IconRelativeOrientation == null || buttonIcon == null || buttonText == null)
+ if (Style.IconRelativeOrientation == null || buttonIcon == null || buttonText == null)
{
return;
}
buttonText.WidthResizePolicy = ResizePolicyType.Fixed;
buttonText.HeightResizePolicy = ResizePolicyType.Fixed;
- int textPaddingLeft = buttonAttributes.TextAttributes.PaddingLeft;
- int textPaddingRight = buttonAttributes.TextAttributes.PaddingRight;
- int textPaddingTop = buttonAttributes.TextAttributes.PaddingTop;
- int textPaddingBottom = buttonAttributes.TextAttributes.PaddingBottom;
+ int textPaddingStart = Style.Text.Padding.Start;
+ int textPaddingEnd = Style.Text.Padding.End;
+ int textPaddingTop = Style.Text.Padding.Top;
+ int textPaddingBottom = Style.Text.Padding.Bottom;
- int iconPaddingLeft = buttonAttributes.IconAttributes.PaddingLeft;
- int iconPaddingRight = buttonAttributes.IconAttributes.PaddingRight;
- int iconPaddingTop = buttonAttributes.IconAttributes.PaddingTop;
- int iconPaddingBottom = buttonAttributes.IconAttributes.PaddingBottom;
+ int iconPaddingStart = Style.Icon.Padding.Start;
+ int iconPaddingEnd = Style.Icon.Padding.End;
+ int iconPaddingTop = Style.Icon.Padding.Top;
+ int iconPaddingBottom = Style.Icon.Padding.Bottom;
if (IconRelativeOrientation == IconOrientation.Top || IconRelativeOrientation == IconOrientation.Bottom)
{
- buttonText.SizeWidth = SizeWidth - textPaddingLeft - textPaddingRight;
+ buttonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd;
buttonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom - iconPaddingTop - iconPaddingBottom - buttonIcon.SizeHeight;
}
else
{
- buttonText.SizeWidth = SizeWidth - textPaddingLeft - textPaddingRight - iconPaddingLeft - iconPaddingRight - buttonIcon.SizeWidth;
+ buttonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd - iconPaddingStart - iconPaddingEnd - buttonIcon.SizeWidth;
buttonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void LayoutChild()
{
- if (buttonAttributes.IconRelativeOrientation == null || buttonIcon == null || buttonText == null)
+ if (Style.IconRelativeOrientation == null || buttonIcon == null || buttonText == null)
{
return;
}
- int textPaddingLeft = buttonAttributes.TextAttributes.PaddingLeft;
- int textPaddingRight = buttonAttributes.TextAttributes.PaddingRight;
- int textPaddingTop = buttonAttributes.TextAttributes.PaddingTop;
- int textPaddingBottom = buttonAttributes.TextAttributes.PaddingBottom;
+ int textPaddingStart = Style.Text.Padding.Start;
+ int textPaddingEnd = Style.Text.Padding.End;
+ int textPaddingTop = Style.Text.Padding.Top;
+ int textPaddingBottom = Style.Text.Padding.Bottom;
- int iconPaddingLeft = buttonAttributes.IconAttributes.PaddingLeft;
- int iconPaddingRight = buttonAttributes.IconAttributes.PaddingRight;
- int iconPaddingTop = buttonAttributes.IconAttributes.PaddingTop;
- int iconPaddingBottom = buttonAttributes.IconAttributes.PaddingBottom;
+ int iconPaddingStart = Style.Icon.Padding.Start;
+ int iconPaddingEnd = Style.Icon.Padding.End;
+ int iconPaddingTop = Style.Icon.Padding.Top;
+ int iconPaddingBottom = Style.Icon.Padding.Bottom;
switch (IconRelativeOrientation)
{
buttonIcon.PositionUsesPivotPoint = true;
buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterLeft;
buttonIcon.PivotPoint = NUI.PivotPoint.CenterLeft;
- buttonIcon.Position2D = new Position2D(iconPaddingLeft, 0);
+ buttonIcon.Position2D = new Position2D(iconPaddingStart, 0);
buttonText.PositionUsesPivotPoint = true;
buttonText.ParentOrigin = NUI.ParentOrigin.CenterRight;
buttonText.PivotPoint = NUI.PivotPoint.CenterRight;
- buttonText.Position2D = new Position2D(-textPaddingRight, 0);
+ buttonText.Position2D = new Position2D(-textPaddingEnd, 0);
}
else
{
buttonIcon.PositionUsesPivotPoint = true;
buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterRight;
buttonIcon.PivotPoint = NUI.PivotPoint.CenterRight;
- buttonIcon.Position2D = new Position2D(-iconPaddingLeft, 0);
+ buttonIcon.Position2D = new Position2D(-iconPaddingStart, 0);
buttonText.PositionUsesPivotPoint = true;
buttonText.ParentOrigin = NUI.ParentOrigin.CenterLeft;
buttonText.PivotPoint = NUI.PivotPoint.CenterLeft;
- buttonText.Position2D = new Position2D(textPaddingRight, 0);
+ buttonText.Position2D = new Position2D(textPaddingEnd, 0);
}
break;
buttonIcon.PositionUsesPivotPoint = true;
buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterLeft;
buttonIcon.PivotPoint = NUI.PivotPoint.CenterLeft;
- buttonIcon.Position2D = new Position2D(iconPaddingRight, 0);
+ buttonIcon.Position2D = new Position2D(iconPaddingEnd, 0);
buttonText.PositionUsesPivotPoint = true;
buttonText.ParentOrigin = NUI.ParentOrigin.CenterRight;
buttonText.PivotPoint = NUI.PivotPoint.CenterRight;
- buttonText.Position2D = new Position2D(-textPaddingLeft, 0);
+ buttonText.Position2D = new Position2D(-textPaddingStart, 0);
}
else
{
buttonIcon.PositionUsesPivotPoint = true;
buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterRight;
buttonIcon.PivotPoint = NUI.PivotPoint.CenterRight;
- buttonIcon.Position2D = new Position2D(-iconPaddingRight, 0);
+ buttonIcon.Position2D = new Position2D(-iconPaddingEnd, 0);
buttonText.PositionUsesPivotPoint = true;
buttonText.ParentOrigin = NUI.ParentOrigin.CenterLeft;
buttonText.PivotPoint = NUI.PivotPoint.CenterLeft;
- buttonText.Position2D = new Position2D(textPaddingLeft, 0);
+ buttonText.Position2D = new Position2D(textPaddingStart, 0);
}
break;
default:
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- ButtonAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as ButtonAttributes;
- if(tempAttributes != null)
+ ButtonStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as ButtonStyle;
+ if (tempAttributes != null)
{
- attributes = buttonAttributes = tempAttributes;
- RelayoutRequest();
+ Style.CopyFrom(tempAttributes);
+ UpdateUIContent();
}
}
- private void OnLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e)
+ private void UpdateUIContent()
{
MeasureText();
LayoutChild();
- }
- private void OnClick(ClickEventArgs eventArgs)
- {
- ClickEvent?.Invoke(this, eventArgs);
+ Sensitive = isEnabled;
}
- private void OnIconRelayout(object sender, EventArgs e)
+ private void OnLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e)
{
MeasureText();
LayoutChild();
}
- private void CreateBackgroundAttributes()
- {
- if (buttonAttributes.BackgroundImageAttributes == null)
- {
- buttonAttributes.BackgroundImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
- }
- }
-
- private void CreateShadowAttributes()
- {
- if (buttonAttributes.ShadowImageAttributes == null)
- {
- buttonAttributes.ShadowImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
- }
- }
-
- private void CreateOverlayAttributes()
+ private void OnClick(ClickEventArgs eventArgs)
{
- if (buttonAttributes.OverlayImageAttributes == null)
- {
- buttonAttributes.OverlayImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
- }
+ ClickEvent?.Invoke(this, eventArgs);
}
- private void CreateTextAttributes()
+ private void OnIconRelayout(object sender, EventArgs e)
{
- if (buttonAttributes.TextAttributes == null)
- {
- buttonAttributes.TextAttributes = new TextAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
- };
- }
+ MeasureText();
+ LayoutChild();
}
- private void CreateIconAttributes()
- {
- if (buttonAttributes.IconAttributes == null)
- {
- buttonAttributes.IconAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.UseNaturalSize,
- HeightResizePolicy = ResizePolicyType.UseNaturalSize,
- };
- }
- }
/// <summary>
/// ClickEventArgs is a class to record button click event arguments which will sent to user.
/// </summary>
/// <param name="attrs"></param>
/// 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 CheckBox(SelectButtonAttributes attrs) : base(attrs) { }
+ public CheckBox(SelectButtonStyle attrs) : base(attrs) { }
/// <summary>
/// Get CheckBoxGroup to which this CheckBox belong.
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public abstract class Control : VisualView
+ public class Control : VisualView
{
/// <summary>
/// Control style.
/// 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 string style;
- /// <summary>
- /// Control attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected Attributes attributes;
private TapGestureDetector tapGestureDetector = new TapGestureDetector();
private bool isFocused = false;
+ internal ImageView backgroundImage;
+ internal ImageView shadowImage;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ControlStyle Style => ViewStyle as ControlStyle;
+
/// <summary>
/// Construct an empty Control.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Control(Attributes attributes) : base()
+ public Control(ControlStyle controlStyle) : base(controlStyle)
{
Initialize(null);
- this.attributes = attributes.Clone();
}
/// <summary>
Initialize(style);
}
- /// <summary>
- /// Get/Set the control state.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public new ControlStates State
- {
- get;
- set;
- }
- /// <summary>
- /// Whether focusable when touch
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- internal bool StateFocusableOnTouchMode
- {
- get;
- set;
- }
-
- internal bool IsFocused
+ public new Selector<string> BackgroundImage
{
get
{
- return isFocused || HasFocus();
+ return Style.Background.ResourceUrl;
}
- }
- /// <summary>
- /// Apply attributes for View, Image or TextLabel.
- /// </summary>
- /// <param name="view">View which will be applied attrs</param>
- /// <param name="attrs">Attributes for View, Image or TextLabel</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected void ApplyAttributes(View view, ViewAttributes attrs)
- {
- if (view == null || attrs == null)
+ set
{
- return;
+ Style.Background.ResourceUrl = value;
}
+ }
- if (attrs.Position != null)
- {
- view.Position = attrs.Position;
- }
- if (attrs.Size != null)
- {
- view.Size = attrs.Size;
- }
- if (attrs.MinimumSize != null)
- {
- view.MinimumSize = attrs.MinimumSize;
- }
- if (attrs.BackgroundColor?.GetValue(State) != null)
- {
- view.BackgroundColor = attrs.BackgroundColor.GetValue(State);
- }
- if (attrs.PositionUsesPivotPoint != null)
- {
- view.PositionUsesPivotPoint = attrs.PositionUsesPivotPoint.Value;
- }
- if (attrs.ParentOrigin != null)
- {
- view.ParentOrigin = attrs.ParentOrigin;
- }
- if (attrs.PivotPoint != null)
- {
- view.PivotPoint = attrs.PivotPoint;
- }
- if (attrs.WidthResizePolicy!= null)
+ public Selector<Rectangle> BackgroundBorder
+ {
+ get
{
- view.WidthResizePolicy = attrs.WidthResizePolicy.Value;
+ return Style.Background.Border;
}
- if (attrs.HeightResizePolicy != null)
+ set
{
- view.HeightResizePolicy = attrs.HeightResizePolicy.Value;
+ Style.Background.Border = value;
}
- if (attrs.SizeModeFactor != null)
+ }
+
+ public Selector<string> ShadowImage
+ {
+ get
{
- view.SizeModeFactor = attrs.SizeModeFactor;
+ return Style.Shadow.ResourceUrl;
}
- if (attrs.Opacity?.GetValue(State) != null)
+ set
{
- view.Opacity = attrs.Opacity.GetValue(State).Value;
+ Style.Shadow.ResourceUrl = value;
}
+ }
- ImageView image = view as ImageView;
- ImageAttributes imageAttrs = attrs as ImageAttributes;
- if (image != null && imageAttrs != null)
+ public Selector<Rectangle> ShadowImageBorder
+ {
+ get
{
- if (imageAttrs.ResourceURL?.GetValue(State) != null)
- {
- image.ResourceUrl = imageAttrs.ResourceURL.GetValue(State);
- }
- if (imageAttrs.Border?.GetValue(State) != null)
- {
- image.Border = imageAttrs.Border.GetValue(State);
- }
-
+ return Style.Shadow.Border;
}
-
- TextLabel text = view as TextLabel;
- TextAttributes textAttrs = attrs as TextAttributes;
- if (text != null && textAttrs != null)
+ set
{
- if (textAttrs.Text?.GetValue(State) != null )
- {
- text.Text = textAttrs.Text.GetValue(State);
- }
- if (textAttrs.TranslatableText?.GetValue(State) != null)
- {
- text.TranslatableText = textAttrs.TranslatableText.GetValue(State);
- }
- if (textAttrs.MultiLine != null)
- {
- text.MultiLine = textAttrs.MultiLine.Value;
- }
- if (textAttrs.HorizontalAlignment != null)
- {
- text.HorizontalAlignment = textAttrs.HorizontalAlignment.Value;
- }
- if (textAttrs.VerticalAlignment != null)
- {
- text.VerticalAlignment = textAttrs.VerticalAlignment.Value;
- }
- if (textAttrs.EnableMarkup != null)
- {
- text.EnableMarkup = textAttrs.EnableMarkup.Value;
- }
- if (textAttrs.AutoScrollLoopCount != null)
- {
- text.AutoScrollLoopCount = textAttrs.AutoScrollLoopCount.Value;
- }
- if (textAttrs.AutoScrollSpeed != null)
- {
- text.AutoScrollSpeed = textAttrs.AutoScrollSpeed.Value;
- }
- if (textAttrs.AutoScrollGap != null)
- {
- text.AutoScrollGap = textAttrs.AutoScrollGap.Value;
- }
- if (textAttrs.AutoScrollLoopDelay != null)
- {
- text.AutoScrollLoopDelay = textAttrs.AutoScrollLoopDelay.Value;
- }
- if (textAttrs.AutoScrollStopMode != null)
- {
- text.AutoScrollStopMode = textAttrs.AutoScrollStopMode.Value;
- }
- if (textAttrs.LineSpacing != null)
- {
- text.LineSpacing = textAttrs.LineSpacing.Value;
- }
- if (textAttrs.TextColor?.GetValue(State) != null)
- {
- text.TextColor = textAttrs.TextColor.GetValue(State);
- }
- if (textAttrs.FontFamily != null)
- {
- text.FontFamily = textAttrs.FontFamily;
- }
- if (textAttrs.PointSize?.GetValue(State) != null)
- {
- text.PointSize = textAttrs.PointSize.GetValue(State).Value;
- }
+ Style.Shadow.Border = value;
+ }
+ }
- int thickness = 0;
+ internal void ApplyAttributes(View view, ViewStyle viewStyle)
+ {
+ view.CopyFrom(viewStyle);
+ }
- if (textAttrs.OutstrokeThickness?.GetValue(State) != null)
- {
- thickness = textAttrs.OutstrokeThickness.GetValue(State).Value;
- }
- if (textAttrs.OutstrokeColor?.GetValue(State) != null)
- {
- Color outstrokeColor = textAttrs.OutstrokeColor.GetValue(State);
- PropertyMap outlineMap = new PropertyMap();
- outlineMap.Add("color", new PropertyValue(new Color(outstrokeColor.R, outstrokeColor.G, outstrokeColor.B, outstrokeColor.A)));
- outlineMap.Add("width", new PropertyValue(thickness));
- text.Outline = outlineMap;
- }
- else
- {
- text.Outline = new PropertyMap();
- }
- }
+ /// <summary>
+ /// Whether focusable when touch
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ internal bool StateFocusableOnTouchMode
+ {
+ get;
+ set;
+ }
- TextField textField = view as TextField;
- TextFieldAttributes textFieldAttrs = attrs as TextFieldAttributes;
- if (textField != null && textFieldAttrs != null)
+ internal bool IsFocused
+ {
+ get
{
- if (textFieldAttrs.Text?.GetValue(State) != null)
- {
- textField.Text = textFieldAttrs.Text.GetValue(State);
- }
- if (textFieldAttrs.PlaceholderText?.GetValue(State) != null)
- {
- textField.PlaceholderText = textFieldAttrs.PlaceholderText.GetValue(State);
- }
- if (textFieldAttrs.TranslatablePlaceholderText?.GetValue(State) != null)
- {
- textField.TranslatablePlaceholderText = textFieldAttrs.TranslatablePlaceholderText.GetValue(State);
- }
- if (textFieldAttrs.HorizontalAlignment != null)
- {
- textField.HorizontalAlignment = textFieldAttrs.HorizontalAlignment.Value;
- }
- if (textFieldAttrs.VerticalAlignment != null)
- {
- textField.VerticalAlignment = textFieldAttrs.VerticalAlignment.Value;
- }
- if (textFieldAttrs.EnableMarkup != null)
- {
- textField.EnableMarkup = textFieldAttrs.EnableMarkup.Value;
- }
- if (textFieldAttrs.TextColor?.GetValue(State) != null)
- {
- textField.TextColor = textFieldAttrs.TextColor.GetValue(State);
- }
- if (textFieldAttrs.PlaceholderTextColor?.GetValue(State) != null)
- {
- textField.PlaceholderTextColor = textFieldAttrs.PlaceholderTextColor.GetValue(State);
- }
- if (textFieldAttrs.PrimaryCursorColor?.GetValue(State) != null)
- {
- textField.PrimaryCursorColor = textFieldAttrs.PrimaryCursorColor.GetValue(State);
- }
- if (textFieldAttrs.SecondaryCursorColor?.GetValue(State) != null)
- {
- textField.SecondaryCursorColor = textFieldAttrs.SecondaryCursorColor.GetValue(State);
- }
- if (textFieldAttrs.FontFamily != null)
- {
- textField.FontFamily = textFieldAttrs.FontFamily;
- }
- if (textFieldAttrs.PointSize?.GetValue(State) != null)
- {
- textField.PointSize = textFieldAttrs.PointSize.GetValue(State).Value;
- }
- if (textFieldAttrs.EnableCursorBlink != null)
- {
- textField.EnableCursorBlink = textFieldAttrs.EnableCursorBlink.Value;
- }
- if (textFieldAttrs.EnableSelection != null)
- {
- textField.EnableSelection = textFieldAttrs.EnableSelection.Value;
- }
- if (textFieldAttrs.CursorWidth != null)
- {
- textField.CursorWidth = textFieldAttrs.CursorWidth.Value;
- }
- if (textFieldAttrs.EnableEllipsis != null)
- {
- textField.Ellipsis = textFieldAttrs.EnableEllipsis.Value;
- }
+ return isFocused || HasFocus();
}
}
+
/// <summary>
/// Dispose Control and all children on it.
/// </summary>
tapGestureDetector.Detected -= OnTapGestureDetected;
tapGestureDetector.Detach(this);
}
+
+ if (backgroundImage != null)
+ {
+ Utility.Dispose(backgroundImage);
+ }
+ if (shadowImage != null)
+ {
+ Utility.Dispose(shadowImage);
+ }
+
base.Dispose(type);
}
- /// <summary>
- /// Get attribues, it is abstract function and must be override.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected abstract Attributes GetAttributes();
+
/// <summary>
/// Called after a key event is received by the view that has had its focus set.
/// </summary>
isFocused = false;
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override void ApplyStyle(ViewStyle viewStyle)
+ {
+ base.ApplyStyle(viewStyle);
+
+ ControlStyle controlStyle = viewStyle as ControlStyle;
+
+ if (null != controlStyle?.Shadow)
+ {
+ if (null == shadowImage)
+ {
+ shadowImage = new ImageView();
+ this.Add(shadowImage);
+ }
+
+ shadowImage.ApplyStyle(controlStyle.Shadow);
+ }
+
+ if (null != controlStyle?.Background)
+ {
+ if (null == backgroundImage)
+ {
+ backgroundImage = new ImageView();
+ this.Add(backgroundImage);
+ }
+ backgroundImage.ApplyStyle(controlStyle.Background);
+ }
+ }
+
/// <summary>
/// Tap gesture callback.
/// </summary>
{
}
+ /// 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 virtual void RegisterDetectionOfSubstyleChanges()
+ {
+
+ }
+
+ /// 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 ViewStyle GetViewStyle()
+ {
+ return new ControlStyle();
+ }
+
private void Initialize(string style)
{
- attributes = (style == null) ? GetAttributes() : GetAttributes(style);
- State = ControlStates.Normal;
+ ControlState = ControlStates.Normal;
+
+ RegisterDetectionOfSubstyleChanges();
LeaveRequired = true;
StyleManager.Instance.ThemeChangedEvent += OnThemeChangedEvent;
}
- private Attributes GetAttributes(string style)
+ private ViewStyle GetAttributes(string style)
{
- Attributes attributes = StyleManager.Instance.GetAttributes(style);
+ ViewStyle attributes = StyleManager.Instance.GetAttributes(style);
if(attributes == null)
{
throw new InvalidOperationException($"There is no style {style}");
this.style = style;
return attributes;
}
-
}
}
using System.Collections.Generic;
using Tizen.NUI.BaseComponents;
using System.ComponentModel;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
[EditorBrowsable(EditorBrowsableState.Never)]
public class DropDown : Control
{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ListPaddingProperty = BindableProperty.Create("ListPadding", typeof(Extents), typeof(Tizen.NUI.Components.DropDown), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ if (newValue != null)
+ {
+ instance.privateListPadding = (Extents)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ return instance.privateListPadding;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ListSizeProperty = BindableProperty.Create("ListSize", typeof(Size), typeof(Tizen.NUI.Components.DropDown), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ if (newValue != null)
+ {
+ instance.privateListSize = (Size)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ return instance.privateListSize;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SelectedItemIndexProperty = BindableProperty.Create("SelectedItemIndex", typeof(int), typeof(Tizen.NUI.Components.DropDown), 0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ if (newValue != null)
+ {
+ instance.privateSelectedItemIndex = (int)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ return instance.privateSelectedItemIndex;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FocusedItemIndexProperty = BindableProperty.Create("FocusedItemIndex", typeof(int), typeof(Tizen.NUI.Components.DropDown), 0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ if (newValue != null)
+ {
+ instance.privateFocusedItemIndex = (int)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ return instance.privateFocusedItemIndex;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ListMarginProperty = BindableProperty.Create("ListMargin", typeof(Extents), typeof(Tizen.NUI.Components.DropDown), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ if (newValue != null)
+ {
+ instance.privateListMargin = (Extents)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ return instance.privateListMargin;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ListRelativeOrientationProperty = BindableProperty.Create("ListRelativeOrientation", typeof(ListOrientation), typeof(Tizen.NUI.Components.DropDown), ListOrientation.Left, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ if (newValue != null)
+ {
+ instance.privateListRelativeOrientation = (ListOrientation)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ return instance.privateListRelativeOrientation;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SpaceProperty = BindableProperty.Create("Space", typeof(Extents), typeof(Tizen.NUI.Components.DropDown), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ if (newValue != null)
+ {
+ instance.privateSpace = (Extents)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ return instance.privateSpace;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SpaceBetweenButtonTextAndIconProperty = BindableProperty.Create("SpaceBetweenButtonTextAndIcon", typeof(int), typeof(Tizen.NUI.Components.DropDown), 0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ if (newValue != null)
+ {
+ instance.privateSpaceBetweenButtonTextAndIcon = (int)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Tizen.NUI.Components.DropDown)bindable;
+ return instance.privateSpaceBetweenButtonTextAndIcon;
+ });
+
+
#region DropDown
private Button button = null;
private TextLabel headerText = null;
private ImageView listBackgroundImage = null;
private FlexibleView list = null;
private DropDownListBridge adapter = new DropDownListBridge();
- private DropDownAttributes dropDownAttributes = null;
private DropDownItemView touchedView = null;
private int selectedItemIndex = -1;
+ private Extents listPadding = null;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new DropDownStyle Style => ViewStyle as DropDownStyle;
+
/// <summary>
/// Creates a new instance of a DropDown.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public DropDown() : base()
{
- Initialize();
}
+
/// <summary>
/// Creates a new instance of a DropDown with style.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public DropDown(string style) : base(style)
{
- Initialize();
}
+
/// <summary>
/// Creates a new instance of a DropDown with attributes.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public DropDown(DropDownAttributes attributes) : base(attributes)
+ public DropDown(DropDownStyle attributes) : base(attributes)
{
- Initialize();
}
/// <summary>
}
/// <summary>
- /// Header text string in DropDown.
+ /// Space between button text and button icon in DropDown.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string HeaderText
+ public int SpaceBetweenButtonTextAndIcon
{
get
{
- return dropDownAttributes.HeaderTextAttributes?.Text.All;
+ return (int)GetValue(SpaceBetweenButtonTextAndIconProperty);
}
set
{
- if (value != null)
- {
- CreateHeaderTextAttributes();
- if (dropDownAttributes.HeaderTextAttributes.Text == null)
- {
- dropDownAttributes.HeaderTextAttributes.Text = new StringSelector();
- }
- dropDownAttributes.HeaderTextAttributes.Text.All = value;
- RelayoutRequest();
- }
+ SetValue(SpaceBetweenButtonTextAndIconProperty, value);
}
}
-
- /// <summary>
- /// Header text point size in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float HeaderTextPointSize
+ private int privateSpaceBetweenButtonTextAndIcon
{
get
{
- return dropDownAttributes.HeaderTextAttributes?.PointSize?.All ?? 0;
+ return (int)Style.SpaceBetweenButtonTextAndIcon;
}
set
{
- CreateHeaderTextAttributes();
- if (dropDownAttributes.HeaderTextAttributes.PointSize == null)
- {
- dropDownAttributes.HeaderTextAttributes.PointSize = new FloatSelector();
- }
- dropDownAttributes.HeaderTextAttributes.PointSize.All = value;
+ Style.SpaceBetweenButtonTextAndIcon = value;
RelayoutRequest();
}
}
/// <summary>
- /// Header text font family in DropDown.
+ /// Left space in DropDown.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string HeaderTextFontFamily
+ public Extents Space
{
get
{
- return dropDownAttributes.HeaderTextAttributes?.FontFamily;
+ return (Extents)GetValue(SpaceProperty);
}
set
{
- CreateHeaderTextAttributes();
- dropDownAttributes.HeaderTextAttributes.FontFamily = value;
- RelayoutRequest();
+ SetValue(SpaceProperty, value);
}
}
-
- /// <summary>
- /// Header text color in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Color HeaderTextColor
+ private Extents privateSpace
{
get
{
- return dropDownAttributes.HeaderTextAttributes?.TextColor?.All;
+ return (Extents)Style.Space;
}
set
{
- CreateHeaderTextAttributes();
- if (dropDownAttributes.HeaderTextAttributes.TextColor == null)
- {
- dropDownAttributes.HeaderTextAttributes.TextColor = new ColorSelector();
- }
- dropDownAttributes.HeaderTextAttributes.TextColor.All = value;
+ Style.Space = value;
RelayoutRequest();
}
}
/// <summary>
- /// Header text color selector in DropDown.
+ /// List relative orientation in DropDown.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ColorSelector HeaderTextColorSelector
+ public ListOrientation ListRelativeOrientation
{
get
{
- return dropDownAttributes.HeaderTextAttributes?.TextColor;
+ return (ListOrientation)GetValue(ListRelativeOrientationProperty);
}
set
{
- CreateHeaderTextAttributes();
- if (value != null)
- {
- dropDownAttributes.HeaderTextAttributes.TextColor = value.Clone() as ColorSelector;
- RelayoutRequest();
- }
+ SetValue(ListRelativeOrientationProperty, value);
}
}
-
- /// <summary>
- /// Button text string in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string ButtonText
+ private ListOrientation privateListRelativeOrientation
{
get
{
- return dropDownAttributes.ButtonAttributes?.TextAttributes?.Text.All;
+ return (ListOrientation)Style.ListRelativeOrientation;
}
set
{
- if (value != null)
- {
- CreateButtonTextAttributes();
- if (dropDownAttributes.ButtonAttributes.TextAttributes.Text == null)
- {
- dropDownAttributes.ButtonAttributes.TextAttributes.Text = new StringSelector();
- }
- dropDownAttributes.ButtonAttributes.TextAttributes.Text.All = value;
- RelayoutRequest();
- }
+ Style.ListRelativeOrientation = value;
+ RelayoutRequest();
}
}
/// <summary>
- /// Button text point size in DropDown.
+ /// Space in list.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float ButtonTextPointSize
+ public Extents ListMargin
{
get
{
- return dropDownAttributes.ButtonAttributes?.TextAttributes?.PointSize?.All ?? 0;
+ return (Extents)GetValue(ListMarginProperty);
}
set
{
- CreateButtonTextAttributes();
- if (dropDownAttributes.ButtonAttributes.TextAttributes.PointSize == null)
- {
- dropDownAttributes.ButtonAttributes.TextAttributes.PointSize = new FloatSelector();
- }
- dropDownAttributes.ButtonAttributes.TextAttributes.PointSize.All = value;
- RelayoutRequest();
+ SetValue(ListMarginProperty, value);
}
}
-
- /// <summary>
- /// Button text font family in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string ButtonTextFontFamily
+ private Extents privateListMargin
{
get
{
- return dropDownAttributes.ButtonAttributes?.TextAttributes?.FontFamily;
+ return Style.ListMargin;
}
set
{
- CreateButtonTextAttributes();
- dropDownAttributes.ButtonAttributes.TextAttributes.FontFamily = value;
+ Style.ListMargin = value;
RelayoutRequest();
}
}
/// <summary>
- /// Button text color in DropDown.
+ /// Focused item index in list.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Color ButtonTextColor
+ public int FocusedItemIndex
{
get
{
- return dropDownAttributes.ButtonAttributes?.TextAttributes?.TextColor?.All;
+ return (int)GetValue(FocusedItemIndexProperty);
}
set
{
- CreateButtonTextAttributes();
- if (dropDownAttributes.ButtonAttributes.TextAttributes.TextColor == null)
- {
- dropDownAttributes.ButtonAttributes.TextAttributes.TextColor = new ColorSelector();
- }
- dropDownAttributes.ButtonAttributes.TextAttributes.TextColor.All = value;
- RelayoutRequest();
+ SetValue(FocusedItemIndexProperty, value);
}
}
-
- /// <summary>
- /// Button text color selector in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ColorSelector ButtonTextColorSelector
+ private int privateFocusedItemIndex
{
get
{
- return dropDownAttributes.ButtonAttributes?.TextAttributes?.TextColor;
+ return (int)Style.FocusedItemIndex;
}
set
{
- CreateButtonTextAttributes();
- if (value != null)
- {
- dropDownAttributes.ButtonAttributes.TextAttributes.TextColor = value.Clone() as ColorSelector;
- RelayoutRequest();
- }
+ Style.FocusedItemIndex = value;
+ RelayoutRequest();
}
}
/// <summary>
- /// Button icon image's resource url in DropDown.
+ /// Selected item index in list.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string ButtonIconImageURL
+ public int SelectedItemIndex
{
get
{
- return dropDownAttributes.ButtonAttributes?.IconAttributes?.ResourceURL.All;
+ return (int)GetValue(SelectedItemIndexProperty);
}
set
{
- if (value != null)
- {
- CreateButtonIconAttributes();
- if (dropDownAttributes.ButtonAttributes.IconAttributes.ResourceURL == null)
- {
- dropDownAttributes.ButtonAttributes.IconAttributes.ResourceURL = new StringSelector();
- }
- dropDownAttributes.ButtonAttributes.IconAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
+ SetValue(SelectedItemIndexProperty, value);
}
}
-
- /// <summary>
- /// Button icon image's size in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Size ButtonIconSize
+ private int privateSelectedItemIndex
{
get
{
- return dropDownAttributes.ButtonAttributes?.IconAttributes?.Size;
+ return selectedItemIndex;
}
set
{
- if (value != null)
+ if (value == selectedItemIndex || adapter == null || value >= adapter.GetItemCount())
{
- CreateButtonIconAttributes();
- dropDownAttributes.ButtonAttributes.IconAttributes.Size = value;
- RelayoutRequest();
+ return;
}
+ UpdateSelectedItem(value);
}
}
/// <summary>
- /// Space between button text and button icon in DropDown.
+ /// List size in DropDown.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int SpaceBetweenButtonTextAndIcon
+ public Size ListSize
{
get
{
- return dropDownAttributes.SpaceBetweenButtonTextAndIcon;
+ return (Size)GetValue(ListSizeProperty);
}
set
{
- dropDownAttributes.SpaceBetweenButtonTextAndIcon = value;
- RelayoutRequest();
+ SetValue(ListSizeProperty, value);
}
}
-
- /// <summary>
- /// Left space in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int LeftSpace
+ private Size privateListSize
{
get
{
- return (int)dropDownAttributes.Space.X;
+ return Style.ListSize;
}
set
{
- dropDownAttributes.Space.X = value;
+ Style.ListSize = value;
RelayoutRequest();
}
}
/// <summary>
- /// Right space in DropDown.
+ /// List padding in DropDown.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int RightSpace
+ public Extents ListPadding
{
get
{
- return (int)dropDownAttributes.Space.Y;
+ return (Extents)GetValue(ListPaddingProperty);
}
set
{
- dropDownAttributes.Space.Y = value;
- RelayoutRequest();
+ SetValue(ListPaddingProperty, value);
}
}
-
- /// <summary>
- /// List background image's resource url in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string ListBackgroundImageURL
+ private Extents privateListPadding
{
get
{
- return dropDownAttributes.ListBackgroundImageAttributes?.ResourceURL?.All;
+ return listPadding;
}
set
{
- if (value != null)
- {
- CreateListBackgroundAttributes();
- if (dropDownAttributes.ListBackgroundImageAttributes.ResourceURL == null)
- {
- dropDownAttributes.ListBackgroundImageAttributes.ResourceURL = new StringSelector();
- }
- dropDownAttributes.ListBackgroundImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
- }
- }
+ Style.ListPadding.CopyFrom(value);
- /// <summary>
- /// List background image's border in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Rectangle ListBackgroundImageBorder
- {
- get
- {
- return dropDownAttributes.ListBackgroundImageAttributes?.Border?.All;
- }
- set
- {
- if (value != null)
+ if (null == listPadding)
{
- CreateListBackgroundAttributes();
- if (dropDownAttributes.ListBackgroundImageAttributes.Border == null)
+ listPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
{
- dropDownAttributes.ListBackgroundImageAttributes.Border = new RectangleSelector();
- }
- dropDownAttributes.ListBackgroundImageAttributes.Border.All = value;
- RelayoutRequest();
+ Style.ListPadding.Start = start;
+ Style.ListPadding.End = end;
+ Style.ListPadding.Top = top;
+ Style.ListPadding.Bottom = bottom;
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
}
- }
- }
-
- /// <summary>
- /// List relative orientation in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ListOrientation ListRelativeOrientation
- {
- get
- {
- return dropDownAttributes.ListRelativeOrientation;
- }
- set
- {
- dropDownAttributes.ListRelativeOrientation = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Left space in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int ListLeftMargin
- {
- get
- {
- return (int)dropDownAttributes.ListMargin.X;
- }
- set
- {
- dropDownAttributes.ListMargin.X = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Right space in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int ListRigthMargin
- {
- get
- {
- return (int)dropDownAttributes.ListMargin.Y;
- }
- set
- {
- dropDownAttributes.ListMargin.Y = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Top space in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int ListTopMargin
- {
- get
- {
- return (int)dropDownAttributes.ListMargin.Z;
- }
- set
- {
- dropDownAttributes.ListMargin.Z = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Bottom space in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int ListBottomMargin
- {
- get
- {
- return (int)dropDownAttributes.ListMargin.W;
- }
- set
- {
- dropDownAttributes.ListMargin.W = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Focused item index in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int FocusedItemIndex
- {
- get
- {
- return dropDownAttributes.FocusedItemIndex;
- }
- set
- {
- dropDownAttributes.FocusedItemIndex = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Selected item index in list.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int SelectedItemIndex
- {
- get
- {
- return selectedItemIndex;
- }
- set
- {
- if (value == selectedItemIndex || adapter == null || value >= adapter.GetItemCount())
+ else
{
- return;
+ listPadding.CopyFrom(value);
}
- UpdateSelectedItem(value);
- }
- }
- /// <summary>
- /// List size in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Size ListSize
- {
- get
- {
- return dropDownAttributes.ListSize;
- }
- set
- {
- dropDownAttributes.ListSize = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// List padding in DropDown.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Extents ListPadding
- {
- get
- {
- return dropDownAttributes.ListPadding;
- }
- set
- {
- dropDownAttributes.ListPadding = value;
RelayoutRequest();
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public void AddItem(DropDownItemData itemData)
+ public void AddItem(DropDownDataItem itemData)
{
adapter.InsertData(-1, itemData);
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public void InsertItem(DropDownItemData item, int index)
+ public void InsertItem(DropDownDataItem item, int index)
{
if (index < 0 || index >= adapter.GetItemCount())
{
list.DetachScrollBar();
}
- /// <summary>
- /// Update DropDown by attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
+ protected override void RegisterDetectionOfSubstyleChanges()
{
- if (dropDownAttributes.HeaderTextAttributes != null)
+ base.RegisterDetectionOfSubstyleChanges();
+
+ Style.PropertyChanged += DropDownAttributesPropertyChanged;
+ Style.HeaderText.PropertyChanged += HeaderTextAttributesPropertyChanged;
+ Style.Button.PropertyChanged += ButtonAttributesPropertyChanged;
+
+ Style.Button.Icon.PropertyChanged += IconStylePropertyChanged;
+ }
+
+ private void IconStylePropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ int iconWidth = 0;
+ int buttonTextWidth = 0;
+ if (e.PropertyName.Equals(ImageViewStyle.SizeProperty.PropertyName))
{
- if (headerText == null)
- {
- CreateHeaderText();
- }
- ApplyAttributes(headerText, dropDownAttributes.HeaderTextAttributes);
+ iconWidth = (int)Style.Button.Icon.Size.Width;
}
+ if (buttonText.NaturalSize2D != null)
+ {
+ buttonTextWidth = buttonText.NaturalSize2D.Width;
+ }
+
+ button.SizeWidth = iconWidth + (int)Style.SpaceBetweenButtonTextAndIcon + buttonTextWidth;
+ }
- if (dropDownAttributes.ButtonAttributes != null)
+ private void DropDownAttributesPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName.Equals("Space"))
{
- if (button == null)
- {
- CreateButton();
- }
- if (dropDownAttributes.Space != null)
- {
- button.Position2D.X = (int)dropDownAttributes.Space.X;
- }
+ button.Position2D.X = (int)Style.Space.Start;
+ }
+ }
- if (dropDownAttributes.ButtonAttributes.TextAttributes != null)
+ private void ButtonAttributesPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (null == button)
+ {
+ button = new Button()
{
- ApplyAttributes(buttonText, dropDownAttributes.ButtonAttributes.TextAttributes);
- button.TextSelector = dropDownAttributes.ButtonAttributes.TextAttributes.Text;
- if (dropDownAttributes.ButtonAttributes.TextAttributes.PointSize != null)
- {
- button.PointSize = dropDownAttributes.ButtonAttributes.TextAttributes.PointSize.All.Value;
- }
- button.FontFamily = dropDownAttributes.ButtonAttributes.TextAttributes.FontFamily;
- button.TextColorSelector = dropDownAttributes.ButtonAttributes.TextAttributes.TextColor;
- }
- if (dropDownAttributes.ButtonAttributes.IconAttributes != null)
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ IconRelativeOrientation = Components.Button.IconOrientation.Right,
+ };
+ button.Name = "DropDownButton";
+ button.ClickEvent += ButtonClickEvent;
+ Add(button);
+
+ button.ApplyStyle(Style.Button);
+ }
+
+ if (null == buttonText)
+ {
+ buttonText = new TextLabel()
{
- button.IconURLSelector = dropDownAttributes.ButtonAttributes.IconAttributes.ResourceURL;
- int iconWidth = 0;
- int buttonTextWidth = 0;
- if (dropDownAttributes.ButtonAttributes.IconAttributes.Size != null)
- {
- iconWidth = (int)dropDownAttributes.ButtonAttributes.IconAttributes.Size.Width;
- }
- if (buttonText.NaturalSize2D != null)
- {
- buttonTextWidth = buttonText.NaturalSize2D.Width;
- }
- button.SizeWidth = iconWidth + dropDownAttributes.SpaceBetweenButtonTextAndIcon + buttonTextWidth;
- }
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+ WidthResizePolicy = ResizePolicyType.UseNaturalSize,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ };
+ buttonText.Name = "DropDownButtonText";
+ Add(buttonText);
+ buttonText.Hide();
}
+ }
- if (dropDownAttributes.ListBackgroundImageAttributes != null)
+ private void HeaderTextAttributesPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (null == headerText)
+ {
+ headerText = new TextLabel();
+ headerText.Name = "DropDownHeaderText";
+ Add(headerText);
+
+ headerText.ApplyStyle(Style.HeaderText);
+ }
+ }
+
+ /// <summary>
+ /// Update DropDown by attributes.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void OnUpdate()
+ {
+ if (Style.ListBackgroundImage != null)
{
if (listBackgroundImage == null)
{
CreateListBackgroundImage();
CreateList();
}
- ApplyAttributes(listBackgroundImage, dropDownAttributes.ListBackgroundImageAttributes);
- list.FocusedItemIndex = dropDownAttributes.FocusedItemIndex;
- list.Size = dropDownAttributes.ListSize;
- list.Padding = dropDownAttributes.ListPadding;
+
+ int temp = (int)Style.FocusedItemIndex;
+ list.FocusedItemIndex = temp;
+ list.Size = Style.ListSize;
+ list.Padding = Style.ListPadding;
int listBackgroundImageX = 0;
int listBackgroundImageY = 0;
- if (dropDownAttributes.ListRelativeOrientation == ListOrientation.Left)
+ if (Style.ListRelativeOrientation == ListOrientation.Left)
{
- if (dropDownAttributes.ListMargin != null)
+ if (Style.ListMargin != null)
{
- listBackgroundImageX = (int)dropDownAttributes.ListMargin.X;
- listBackgroundImageY = (int)dropDownAttributes.ListMargin.Z;
+ listBackgroundImageX = (int)Style.ListMargin.Start;
+ listBackgroundImageY = (int)Style.ListMargin.Top;
}
}
- else if (dropDownAttributes.ListRelativeOrientation == ListOrientation.Right)
+ else if (Style.ListRelativeOrientation == ListOrientation.Right)
{
- if (dropDownAttributes.ListMargin != null)
+ if (Style.ListMargin != null)
{
int listWidth = 0;
if (list.Size2D != null)
{
listWidth = list.Size2D.Width;
}
- listBackgroundImageX = Size2D.Width - listWidth - (int)dropDownAttributes.ListMargin.Y;
- listBackgroundImageY = (int)dropDownAttributes.ListMargin.Z;
+ listBackgroundImageX = Size2D.Width - listWidth - (int)Style.ListMargin.End;
+ listBackgroundImageY = (int)Style.ListMargin.Top;
}
}
listBackgroundImage.Position2D = new Position2D(listBackgroundImageX, listBackgroundImageY);
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new DropDownAttributes();
- }
-
- private void Initialize()
- {
- dropDownAttributes = attributes as DropDownAttributes;
- if (dropDownAttributes == null)
- {
- throw new Exception("DropDown attribute parse error.");
- }
- ApplyAttributes(this, dropDownAttributes);
+ return new DropDownStyle();
}
private void OnClickEvent(object sender, ItemClickEventArgs e)
ItemClickEvent?.Invoke(sender, e);
}
- private void CreateHeaderText()
- {
- headerText = new TextLabel();
- headerText.Name = "DropDownHeaderText";
- Add(headerText);
- }
-
- private void CreateButton()
- {
- button = new Button()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- IconRelativeOrientation = Button.IconOrientation.Right,
- };
- button.Name = "DropDownButton";
- button.ClickEvent += ButtonClickEvent;
- Add(button);
-
- buttonText = new TextLabel()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- WidthResizePolicy = ResizePolicyType.UseNaturalSize,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- };
- buttonText.Name = "DropDownButtonText";
- Add(buttonText);
- buttonText.Hide();
- }
-
private void CreateList()
{
list = new FlexibleView();
{
if (selectedItemIndex != -1)
{
- DropDownItemData data = adapter.GetData(selectedItemIndex);
+ DropDownDataItem data = adapter.GetData(selectedItemIndex);
if(data != null)
{
data.IsSelected = false;
if (index != -1)
{
- DropDownItemData data = adapter.GetData(index);
+ DropDownDataItem data = adapter.GetData(index);
if (data != null)
{
data.IsSelected = true;
if (view != null)
{
view.IsSelected = true;
- button.Text = view.Text;
+ button.Style.Text.Text = view.Text;
}
}
private void CreateListBackgroundImage()
{
- listBackgroundImage = new ImageView
+ if (null == listBackgroundImage)
{
- Name = "ListBackgroundImage",
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- WidthResizePolicy = ResizePolicyType.FitToChildren,
- HeightResizePolicy = ResizePolicyType.FitToChildren,
- };
- Add(listBackgroundImage);
+ listBackgroundImage = new ImageView
+ {
+ Name = "ListBackgroundImage",
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+ WidthResizePolicy = ResizePolicyType.FitToChildren,
+ HeightResizePolicy = ResizePolicyType.FitToChildren,
+ };
+ Add(listBackgroundImage);
+ }
}
private void ButtonClickEvent(object sender, Button.ClickEventArgs e)
private void CreateHeaderTextAttributes()
{
- if (dropDownAttributes.HeaderTextAttributes == null)
+ if (Style.HeaderText == null)
{
- dropDownAttributes.HeaderTextAttributes = new TextAttributes()
+ Style.HeaderText = new TextLabelStyle()
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
private void CreateButtonAttributes()
{
- if (dropDownAttributes.ButtonAttributes == null)
+ if (Style.Button == null)
{
- dropDownAttributes.ButtonAttributes = new ButtonAttributes();
+ Style.Button = new ButtonStyle();
}
}
{
CreateButtonAttributes();
- if (dropDownAttributes.ButtonAttributes.TextAttributes == null)
+ if (Style.Button.Text== null)
{
- dropDownAttributes.ButtonAttributes.TextAttributes = new TextAttributes
+ Style.Button.Text= new TextLabelStyle
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
{
CreateButtonAttributes();
- if (dropDownAttributes.ButtonAttributes.IconAttributes == null)
+ if (Style.Button.Icon== null)
{
- dropDownAttributes.ButtonAttributes.IconAttributes = new ImageAttributes
+ Style.Button.Icon= new ImageViewStyle
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight,
private void CreateListBackgroundAttributes()
{
- if (dropDownAttributes.ListBackgroundImageAttributes == null)
+ if (Style.ListBackgroundImage == null)
{
- dropDownAttributes.ListBackgroundImageAttributes = new ImageAttributes
+ Style.ListBackgroundImage = new ImageViewStyle
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
}
#endregion
- #region DropDownItemData
+ #region DropDownDataItem
/// <summary>
- /// DropDownItemData is a class to record all data which will be applied to DropDown item.
+ /// DropDownDataItem is a class to record all data which will be applied to DropDown item.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class DropDownItemData
+ //[EditorBrowsable(EditorBrowsableState.Never)]
+ public class DropDownDataItem
{
- private DropDownItemAttributes itemDataAttributes = new DropDownItemAttributes();
+ private DropDownItemStyle itemDataStyle = new DropDownItemStyle();
/// <summary>
/// Creates a new instance of a DropDownItemData.
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public DropDownItemData()
+ public DropDownDataItem()
{
Initalize();
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public DropDownItemData(string style)
+ public DropDownDataItem(string style)
{
if(style != null)
{
- Attributes attributes = StyleManager.Instance.GetAttributes(style);
+ ViewStyle attributes = StyleManager.Instance.GetAttributes(style);
if(attributes == null)
{
throw new InvalidOperationException($"There is no style {style}");
}
- itemDataAttributes = attributes as DropDownItemAttributes;
+ itemDataStyle = attributes as DropDownItemStyle;
}
Initalize();
}
/// <summary>
- /// Creates a new instance of a DropDownItemData with attributes.
+ /// Creates a new instance of a DropDownItemData with style.
/// </summary>
- /// <param name="attributes">Create DropDownItemData by attributes customized by user.</param>
+ /// <param name="style">Create DropDownItemData by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public DropDownItemData(DropDownItemAttributes attributes)
+ public DropDownDataItem(DropDownItemStyle style)
{
- itemDataAttributes = attributes.Clone() as DropDownItemAttributes;
+ itemDataStyle.CopyFrom(style);
Initalize();
}
{
get
{
- return itemDataAttributes.Size;
+ return itemDataStyle.Size;
}
set
{
- itemDataAttributes.Size = value;
+ itemDataStyle.Size = value;
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ColorSelector BackgroundColorSelector
+ public Selector<Color> BackgroundColorSelector
{
get
{
- return itemDataAttributes.BackgroundColor;
+ return itemDataStyle.BackgroundColor;
}
set
{
- if (itemDataAttributes.BackgroundColor == null)
- {
- itemDataAttributes.BackgroundColor = value.Clone() as ColorSelector;
- }
- else
+ if (itemDataStyle.BackgroundColor == null)
{
- itemDataAttributes.BackgroundColor = value.Clone();
+ itemDataStyle.BackgroundColor = new Selector<Color>();
}
-
+
+ itemDataStyle.BackgroundColor.Clone(value);
}
}
{
get
{
- return itemDataAttributes.TextAttributes?.Text?.All;
+ return itemDataStyle.Text?.Text?.All;
}
set
{
CreateTextAttributes();
- if (itemDataAttributes.TextAttributes.Text == null)
+ if (itemDataStyle.Text.Text == null)
{
- itemDataAttributes.TextAttributes.Text = new StringSelector { All = value };
+ itemDataStyle.Text.Text = new Selector<string> { All = value };
}
else
{
- itemDataAttributes.TextAttributes.Text.All = value;
+ itemDataStyle.Text.Text.All = value;
}
}
}
{
get
{
- return itemDataAttributes.TextAttributes?.PointSize?.All ?? 0;
+ return itemDataStyle.Text?.PointSize?.All ?? 0;
}
set
{
CreateTextAttributes();
- if (itemDataAttributes.TextAttributes.PointSize == null)
+ if (itemDataStyle.Text.PointSize == null)
{
- itemDataAttributes.TextAttributes.PointSize = new FloatSelector { All = value };
+ itemDataStyle.Text.PointSize = new Selector<float?> { All = value };
}
else
{
- itemDataAttributes.TextAttributes.PointSize.All = value;
+ itemDataStyle.Text.PointSize.All = value;
}
}
}
{
get
{
- return itemDataAttributes.TextAttributes?.FontFamily;
+ return "";
+ //return itemDataAttributes.TextAttributes?.FontFamily?.GetValue(State);
}
set
{
CreateTextAttributes();
- itemDataAttributes.TextAttributes.FontFamily = value;
+ itemDataStyle.Text.FontFamily = value;
}
}
{
get
{
- return itemDataAttributes.TextAttributes?.Position;
+ return itemDataStyle.Text?.Position;
}
set
{
CreateTextAttributes();
- itemDataAttributes.TextAttributes.Position = value;
+ itemDataStyle.Text.Position = value;
}
}
{
get
{
- return itemDataAttributes.IconAttributes?.ResourceURL?.All;
+ return itemDataStyle.Icon?.ResourceUrl?.All;
}
set
{
CreateIconAttributes();
- if (itemDataAttributes.IconAttributes.ResourceURL == null)
+ if (itemDataStyle.Icon.ResourceUrl == null)
{
- itemDataAttributes.IconAttributes.ResourceURL = new StringSelector { All = value };
+ itemDataStyle.Icon.ResourceUrl = new Selector<string> { All = value };
}
else
{
- itemDataAttributes.IconAttributes.ResourceURL.All = value;
+ itemDataStyle.Icon.ResourceUrl.All = value;
}
}
}
{
get
{
- return itemDataAttributes.IconAttributes?.Size;
+ return itemDataStyle.Icon?.Size;
}
set
{
CreateIconAttributes();
- itemDataAttributes.IconAttributes.Size = value;
+ itemDataStyle.Icon.Size = value;
}
}
{
get
{
- return itemDataAttributes.IconAttributes.Position;
+ return itemDataStyle.Icon.Position;
}
set
{
CreateIconAttributes();
- itemDataAttributes.IconAttributes.Position = value;
+ itemDataStyle.Icon.Position = value;
}
}
{
get
{
- return itemDataAttributes.CheckImageAttributes?.ResourceURL?.All;
+ return itemDataStyle.CheckImage?.ResourceUrl?.All;
}
set
{
CreateCheckImageAttributes();
- if (itemDataAttributes.CheckImageAttributes.ResourceURL == null)
+ if (itemDataStyle.CheckImage.ResourceUrl == null)
{
- itemDataAttributes.CheckImageAttributes.ResourceURL = new StringSelector { All = value };
+ itemDataStyle.CheckImage.ResourceUrl = new Selector<string> { All = value };
}
else
{
- itemDataAttributes.CheckImageAttributes.ResourceURL.All = value;
+ itemDataStyle.CheckImage.ResourceUrl.All = value;
}
}
}
{
get
{
- return itemDataAttributes.CheckImageAttributes?.Size;
+ return itemDataStyle.CheckImage?.Size;
}
set
{
CreateCheckImageAttributes();
- itemDataAttributes.CheckImageAttributes.Size = value;
+ itemDataStyle.CheckImage.Size = value;
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImageRightSpace
+ public int CheckImageGapToBoundary
{
get
{
- return itemDataAttributes.CheckImageRightSpace;
+ return itemDataStyle.CheckImageGapToBoundary;
}
set
{
- itemDataAttributes.CheckImageRightSpace = value;
+ itemDataStyle.CheckImageGapToBoundary = value;
}
}
{
get
{
- return itemDataAttributes.IsSelected;
+ return itemDataStyle.IsSelected;
}
set
{
- itemDataAttributes.IsSelected = value;
+ itemDataStyle.IsSelected = value;
}
}
private void Initalize()
{
- if (itemDataAttributes == null)
+ if (itemDataStyle == null)
{
throw new Exception("Button attribute parse error.");
}
private void CreateTextAttributes()
{
- if(itemDataAttributes.TextAttributes == null)
+ if(itemDataStyle.Text== null)
{
- itemDataAttributes.TextAttributes = new TextAttributes
+ itemDataStyle.Text= new TextLabelStyle
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
private void CreateIconAttributes()
{
- if (itemDataAttributes.IconAttributes == null)
+ if (itemDataStyle.Icon== null)
{
- itemDataAttributes.IconAttributes = new ImageAttributes
+ itemDataStyle.Icon= new ImageViewStyle
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
private void CreateCheckImageAttributes()
{
- if (itemDataAttributes.CheckImageAttributes == null)
+ if (itemDataStyle.CheckImage== null)
{
- itemDataAttributes.CheckImageAttributes = new ImageAttributes
+ itemDataStyle.CheckImage= new ImageViewStyle
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
/// 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 BackgroundColorSelector
+ public Selector<Color> BackgroundColorSelector
{
get;
set;
/// 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
+ public float? PointSize
{
get
{
set
{
CreateText();
- mText.PointSize = value;
+ mText.PointSize = (float)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)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
return null;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class DropDownListBridge : FlexibleView.Adapter
{
- private List<DropDownItemData> mDatas = new List<DropDownItemData>();
+ private List<DropDownDataItem> mDatas = new List<DropDownDataItem>();
/// <summary>
/// Creates a new instance of a DropDownListBridge.
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public void InsertData(int position, DropDownItemData data)
+ public void InsertData(int position, DropDownDataItem data)
{
if(position == -1)
{
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public DropDownItemData GetData(int position)
+ public DropDownDataItem GetData(int position)
{
return mDatas[position];
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position)
{
- DropDownItemData listItemData = mDatas[position];
+ DropDownDataItem listItemData = mDatas[position];
if(listItemData == null)
{
return;
listItemView.CheckImageSize = listItemData.CheckImageSize;
if (listItemView.CheckImageSize != null)
{
- listItemView.CheckPosition = new Position(listItemView.Size2D.Width - listItemData.CheckImageRightSpace - listItemView.CheckImageSize.Width, (listItemView.Size2D.Height - listItemView.CheckImageSize.Height) / 2);
+ listItemView.CheckPosition = new Position(listItemView.Size2D.Width - listItemData.CheckImageGapToBoundary - listItemView.CheckImageSize.Width, (listItemView.Size2D.Height - listItemView.CheckImageSize.Height) / 2);
}
}
}
}
+ private new Extents padding;
/// <summary>
/// overwrite the Padding.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public new Extents Padding
{
- get;
- set;
+ get
+ {
+ if (null == padding)
+ {
+ padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ padding.Start = start;
+ padding.End = end;
+ padding.Top = top;
+ padding.Bottom = bottom;
+ }, 0, 0, 0, 0);
+ }
+
+ return padding;
+ }
+ set
+ {
+ if (null == padding)
+ {
+ padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ padding.Start = start;
+ padding.End = end;
+ padding.Top = top;
+ padding.Bottom = bottom;
+ }, 0, 0, 0, 0);
+ }
+
+ padding.CopyFrom(value);
+ }
}
/// <summary>
{
if (mLayout != null)
{
- mLayout.StopScroll();
+ mLayout.StopScroll(false);
}
if (mAdapter != null)
/// you can override it to create your own default attributes.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
return null;
}
{
offset = range - extent;
}
+ if (offset < 0)
+ {
+ offset = 0;
+ }
if (mScrollBar.Direction == ScrollBar.DirectionType.Vertical)
{
- mScrollBar.ThumbSize = new Size(thickness, length);
+ mScrollBar.Style.Thumb.Size = new Size(thickness, length);
}
else
{
- mScrollBar.ThumbSize = new Size(length, thickness);
+ mScrollBar.Style.Thumb.Size = new Size(length, thickness);
}
mScrollBar.MinValue = 0;
mScrollBar.MaxValue = (int)(range - extent);
{
if (e.PanGesture.State == Gesture.StateType.Started)
{
- mLayout.StopScroll();
+ mLayout.StopScroll(true);
}
else if (e.PanGesture.State == Gesture.StateType.Continuing)
{
Down
}
+ private readonly int SCROLL_ANIMATION_DURATION = 500;
+
private FlexibleView mFlexibleView;
private ChildHelper mChildHelper;
return;
}
- if (mScrollAni == null)
- {
- mScrollAni = new Animation();
- mScrollAni.Finished += OnScrollAnimationFinished;
- }
- else if (mScrollAni.State == Animation.States.Playing)
+ if (dx == 0)
{
- //StopScroll();
- mScrollAni.Stop(Animation.EndActions.StopFinal);
+ return;
}
- mScrollAni.Duration = 500;
- mScrollAni.DefaultAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOutSquare);
-
- mScrollAni.Clear();
int childCount = mChildHelper.GetChildCount();
if (immediate == true)
}
else
{
+ if (mScrollAni == null)
+ {
+ mScrollAni = new Animation();
+ mScrollAni.Duration = SCROLL_ANIMATION_DURATION;
+ mScrollAni.DefaultAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOutSquare);
+ }
+
+ // avoid out of boundary of flexibleview. delta value might be used for shadow.
+ // this must be done before animation clear.
+ if (childCount > 0)
+ {
+ ViewHolder vh = mChildHelper.GetChildAt(0);
+ if (vh.LayoutPosition == 0)
+ {
+ if ((int)(vh.Left + dx) > 0)
+ {
+ dx = 0 - vh.Left;
+ }
+ }
+
+ vh = mChildHelper.GetChildAt(childCount - 1);
+ if (vh.LayoutPosition == ItemCount - 1)
+ {
+ if ((int)(vh.Right + dx) < (int)Width + PaddingRight)
+ {
+ dx = Width + PaddingRight - vh.Right;
+ }
+ }
+ }
+
+ // save position before animation clear.
+ float[] childrenPositon = new float[childCount];
for (int i = childCount - 1; i >= 0; i--)
{
ViewHolder v = mChildHelper.GetChildAt(i);
+ childrenPositon[i] = v.ItemView.PositionX;
+ }
+
+ mScrollAni.Clear();
+ mScrollAni.Finished += OnScrollAnimationFinished;
+
+ for (int i = childCount - 1; i >= 0; i--)
+ {
+ ViewHolder v = mChildHelper.GetChildAt(i);
+ // set position again because position might be changed after animation clear.
+ v.ItemView.PositionX = childrenPositon[i];
mScrollAni.AnimateTo(v.ItemView, "PositionX", v.ItemView.PositionX + dx);
}
mScrollAni.Play();
return;
}
- if (mScrollAni == null)
- {
- mScrollAni = new Animation();
- mScrollAni.Finished += OnScrollAnimationFinished;
- }
- else if (mScrollAni.State == Animation.States.Playing)
+ if (dy == 0)
{
- //StopScroll();
- mScrollAni.Stop(Animation.EndActions.StopFinal);
+ return;
}
- mScrollAni.Duration = 500;
- mScrollAni.DefaultAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOutSquare);
-
- mScrollAni.Clear();
int childCount = mChildHelper.GetChildCount();
if (immediate == true)
}
else
{
+ if (mScrollAni == null)
+ {
+ mScrollAni = new Animation();
+ mScrollAni.Duration = SCROLL_ANIMATION_DURATION;
+ mScrollAni.DefaultAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOutSquare);
+ }
+
+ // avoid out of boundary of flexibleview. delta value might be used for shadow.
+ // this must be done before animation clear.
+ if (childCount > 0)
+ {
+ ViewHolder vh = mChildHelper.GetChildAt(0);
+ if (vh.LayoutPosition == 0)
+ {
+ if ((int)(vh.Top + dy) > 0)
+ {
+ dy = 0 - vh.Top;
+ }
+ }
+
+ vh = mChildHelper.GetChildAt(childCount - 1);
+ if (vh.LayoutPosition == ItemCount - 1)
+ {
+ if ((int)(vh.Bottom + dy) < (int)Height + PaddingBottom)
+ {
+ dy = Height + PaddingBottom - vh.Bottom;
+ }
+ }
+ }
+
+ // save position before animation clear.
+ float[] childPositon = new float[childCount];
+ for (int i = childCount - 1; i >= 0; i--)
+ {
+ ViewHolder v = mChildHelper.GetChildAt(i);
+ childPositon[i] = v.ItemView.PositionY;
+ }
+
+ mScrollAni.Clear();
+ mScrollAni.Finished += OnScrollAnimationFinished;
+
for (int i = childCount - 1; i >= 0; i--)
{
ViewHolder v = mChildHelper.GetChildAt(i);
+ // set position again because position might be changed after animation clear.
+ v.ItemView.PositionY = childPositon[i];
mScrollAni.AnimateTo(v.ItemView, "PositionY", v.ItemView.PositionY + dy);
}
mScrollAni.Play();
[EditorBrowsable(EditorBrowsableState.Never)]
protected abstract int GetNextPosition(int position, FlexibleView.LayoutManager.Direction direction);
+ /// <summary>
+ /// Retrieves the first visible item view.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual ViewHolder FindFirstVisibleItemView()
+ {
+ return null;
+ }
+
+ /// <summary>
+ /// Retrieves the last visible item view.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual ViewHolder FindLastVisibleItemView()
+ {
+ return null;
+ }
+
internal virtual ViewHolder OnFocusSearchFailed(FlexibleView.ViewHolder focused, LayoutManager.Direction direction, Recycler recycler)
{
return null;
mChildHelper = recyclerView.mChildHelper;
}
- internal void StopScroll()
+ internal void StopScroll(bool doSomethingAfterAnimationStopped)
{
if (mScrollAni != null && mScrollAni.State == Animation.States.Playing)
{
- mScrollAni.Stop(Animation.EndActions.StopFinal);
- mScrollAni.Clear();
- OnScrollAnimationFinished(mScrollAni, null);
+ mScrollAni.Finished -= OnScrollAnimationFinished;
+ mScrollAni.Stop();
+
+ if (doSomethingAfterAnimationStopped)
+ {
+ OnScrollAnimationFinished(mScrollAni, null);
+ }
}
}
private void OnScrollAnimationFinished(object sender, EventArgs e)
{
- RecycleChildrenInt(mFlexibleView.mRecycler);
+ foreach (ViewHolder holder in mPendingRecycleViews)
+ {
+ holder.PendingRecycle = false;
+ }
+ mPendingRecycleViews.Clear();
+
+ int start = NO_POSITION;
+ ViewHolder firstItemView = FindFirstVisibleItemView();
+ if (firstItemView != null)
+ start = firstItemView.LayoutPosition;
+ else
+ start = 0;
+
+ int itemCount = ChildCount;
+
+ int end = NO_POSITION;
+ ViewHolder lastItemView = FindLastVisibleItemView();
+ if (lastItemView != null)
+ end = lastItemView.LayoutPosition;
+ else
+ end = itemCount - 1;
+
+ List<ViewHolder> removedViewList = new List<ViewHolder>();
+ for (int i = 0; i < itemCount; i++)
+ {
+ ViewHolder v = GetChildAt(i);
+
+ //if item view of holder is visible, it should not be recycled.
+ if (v.LayoutPosition >= start && v.LayoutPosition <= end)
+ continue;
+
+ removedViewList.Add(v);
+ }
+
+ for (int i = 0; i < removedViewList.Count; i++)
+ {
+ ViewHolder v = removedViewList[i];
+ v.PendingRecycle = false;
+ mFlexibleView.mRecycler.RecycleView(v);
+ mChildHelper.RemoveView(v);
+ }
+
+ // relayout
}
private void AddViewInternal(ViewHolder holder, int index, bool disappearing)
internal override void EnsureAnchorReady(FlexibleView.Recycler recycler, AnchorInfo anchorInfo, int itemDirection)
{
bool layingOutInPrimaryDirection = (itemDirection == LayoutState.ITEM_DIRECTION_TAIL);
- int span = anchorInfo.Position;
+ int span = anchorInfo.Position % mSpanCount;
if (layingOutInPrimaryDirection)
{
// choose span 0
int bestSpan = span;
while (pos < indexLimit)
{
- int next = (pos + 1);
+ int next = (pos + 1) % mSpanCount;
if (next > bestSpan)
{
pos += 1;
return NO_POSITION;
}
+ /// <summary>
+ /// Retrieves the first visible item view.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override FlexibleView.ViewHolder FindFirstVisibleItemView()
+ {
+ int childCount = ChildCount;
+ if (mShouldReverseLayout == false)
+ {
+ for (int i = 0; i < childCount; i++)
+ {
+ FlexibleView.ViewHolder child = GetChildAt(i);
+ int end = (int)mOrientationHelper.GetViewHolderEnd(child);
+ if (end >= 0 && end < (int)mOrientationHelper.GetEnd())
+ {
+ return child;
+ }
+ }
+ }
+ else
+ {
+ for (int i = childCount - 1; i >= 0; i--)
+ {
+ FlexibleView.ViewHolder child = GetChildAt(i);
+ int end = (int)mOrientationHelper.GetViewHolderEnd(child);
+ if (end >= 0 && end < (int)mOrientationHelper.GetEnd())
+ {
+ return child;
+ }
+ }
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// Retrieves the last visible item view.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override FlexibleView.ViewHolder FindLastVisibleItemView()
+ {
+ int childCount = ChildCount;
+ if (mShouldReverseLayout == false)
+ {
+ for (int i = childCount - 1; i >= 0; i--)
+ {
+ FlexibleView.ViewHolder child = GetChildAt(i);
+ int start = (int)mOrientationHelper.GetViewHolderStart(child);
+ if (start > 0 && start < (int)mOrientationHelper.GetEnd())
+ {
+ return child;
+ }
+ }
+ }
+ else
+ {
+ for (int i = 0; i < childCount; i++)
+ {
+ FlexibleView.ViewHolder child = GetChildAt(i);
+ int start = (int)mOrientationHelper.GetViewHolderStart(child);
+ if (start > 0 && start < (int)mOrientationHelper.GetEnd())
+ {
+ return child;
+ }
+ }
+ }
+ return null;
+ }
+
internal virtual void LayoutChunk(FlexibleView.Recycler recycler,
LayoutState layoutState, LayoutChunkResult result)
{
return false;
}
- FlexibleView.ViewHolder anchorChild = FindFirstCompleteVisibleItemView();
+ FlexibleView.ViewHolder anchorChild = FindFirstVisibleItemView();
if (anchorChild == null)
{
- return false;
+ Log.Error("flexibleview", $"exception occurs when updating anchor information!");
+ anchorChild = GetChildAt(0);
}
anchorInfo.Position = anchorChild.LayoutPosition;
anchorInfo.Coordinate = mOrientationHelper.GetViewHolderStart(anchorChild);
mLayoutState.Extra = mOrientationHelper.GetStartAfterPadding();
}
- private FlexibleView.ViewHolder FindFirstVisibleItemView()
- {
- int childCount = ChildCount;
- if (mShouldReverseLayout == false)
- {
- for (int i = 0; i < childCount; i++)
- {
- FlexibleView.ViewHolder child = GetChildAt(i);
- if ((int)mOrientationHelper.GetViewHolderEnd(child) > 0)
- {
- return child;
- }
- }
- }
- else
- {
- for (int i = childCount - 1; i >= 0; i--)
- {
- FlexibleView.ViewHolder child = GetChildAt(i);
- if ((int)mOrientationHelper.GetViewHolderEnd(child) > 0)
- {
- return child;
- }
- }
- }
- return null;
- }
-
private FlexibleView.ViewHolder FindFirstCompleteVisibleItemView()
{
int childCount = ChildCount;
for (int i = 0; i < childCount; i++)
{
FlexibleView.ViewHolder child = GetChildAt(i);
- if ((int)mOrientationHelper.GetViewHolderStart(child) > 0)
+ int start = (int)mOrientationHelper.GetViewHolderStart(child);
+ if (start > 0 && start < (int)mOrientationHelper.GetEnd())
{
return child;
}
for (int i = childCount - 1; i >= 0; i--)
{
FlexibleView.ViewHolder child = GetChildAt(i);
- if ((int)mOrientationHelper.GetViewHolderStart(child) > 0)
- {
- return child;
- }
- }
- }
- return null;
- }
-
- private FlexibleView.ViewHolder FindLastVisibleItemView()
- {
- int childCount = ChildCount;
- if (mShouldReverseLayout == false)
- {
- for (int i = childCount - 1; i >= 0; i--)
- {
- FlexibleView.ViewHolder child = GetChildAt(i);
- if ((int)mOrientationHelper.GetViewHolderStart(child) < (int)mOrientationHelper.GetEnd())
- {
- return child;
- }
- }
- }
- else
- {
- for (int i = 0; i < childCount; i++)
- {
- FlexibleView.ViewHolder child = GetChildAt(i);
- if ((int)mOrientationHelper.GetViewHolderStart(child) < (int)mOrientationHelper.GetEnd())
+ int start = (int)mOrientationHelper.GetViewHolderStart(child);
+ if (start > 0 && start < (int)mOrientationHelper.GetEnd())
{
return child;
}
--- /dev/null
+/*
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components
+{
+ /// <summary>
+ /// The control component is class of image. Temporarily for SelectButton.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ImageControl : Control
+ {
+ /// <summary>
+ /// Control style.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ private ImageControlStyle imageControlStyle;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new ImageControlStyle Style => imageControlStyle;
+
+ internal ImageView imageView;
+
+ /// <summary>
+ /// Construct an empty Control.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageControl() : base()
+ {
+ }
+
+ /// <summary>
+ /// Construct with style.
+ /// </summary>
+ /// <param name="style">Create style customized by user</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageControl(ImageControlStyle style) : base(style)
+ {
+ }
+
+ /// <summary>
+ /// Construct with style
+ /// </summary>
+ /// <param name="style">Style to be applied</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageControl(string style) : base(style)
+ {
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override void ApplyStyle(ViewStyle viewStyle)
+ {
+ base.ApplyStyle(viewStyle);
+
+ ImageControlStyle imageControlStyle = viewStyle as ImageControlStyle;
+ if (null != imageControlStyle)
+ {
+ if (null == imageView)
+ {
+ imageView = new ImageView();
+ this.Add(imageView);
+ }
+ }
+
+ imageView.ApplyStyle(imageControlStyle.Image);
+ }
+
+ /// <summary>
+ /// Dispose Control and all children on it.
+ /// </summary>
+ /// <param name="type">Dispose type.</param>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (imageView != null)
+ {
+ Utility.Dispose(imageView);
+ }
+
+ base.Dispose(type);
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override ViewStyle GetViewStyle()
+ {
+ imageControlStyle = new ImageControlStyle();
+ return imageControlStyle;
+ }
+ }
+}
// the textField
private TextField textField = null;
// the attributes of the inputField
- private InputFieldAttributes inputFieldAttrs = null;
+ private InputFieldStyle inputFieldAttrs = null;
// the flag indicate should relayout the textField in base class
private bool relayoutTextField = true;
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public InputField(InputFieldAttributes attributes) : base(attributes)
+ public InputField(InputFieldStyle attributes) : base(attributes)
{
Initialize();
}
CreateTextFieldAttributes();
if (null == inputFieldAttrs.InputBoxAttributes.TextColor)
{
- inputFieldAttrs.InputBoxAttributes.TextColor = new ColorSelector();
+ inputFieldAttrs.InputBoxAttributes.TextColor = new Selector<Color>();
}
inputFieldAttrs.InputBoxAttributes.TextColor.All = value;
textField.TextColor = value;
CreateTextFieldAttributes();
if (null == inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor)
{
- inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor = new ColorSelector();
+ inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor = new Selector<Color>();
}
inputFieldAttrs.InputBoxAttributes.PlaceholderTextColor.All = value;
textField.PlaceholderTextColor = value;
CreateTextFieldAttributes();
if (null == inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor)
{
- inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor = new ColorSelector();
+ inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor = new Selector<Color>();
}
inputFieldAttrs.InputBoxAttributes.PrimaryCursorColor.All = value;
textField.PrimaryCursorColor = value;
}
/// <summary>
- /// Gets or sets secondary cursor color.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Color SecondaryCursorColor
- {
- get
- {
- return textField.SecondaryCursorColor;
- }
- set
- {
- CreateTextFieldAttributes();
- if (null == inputFieldAttrs.InputBoxAttributes.SecondaryCursorColor)
- {
- inputFieldAttrs.InputBoxAttributes.SecondaryCursorColor = new ColorSelector();
- }
- inputFieldAttrs.InputBoxAttributes.SecondaryCursorColor.All = value;
- textField.SecondaryCursorColor = value;
- }
- }
-
- /// <summary>
/// Gets or sets font family of text.
/// </summary>
/// <since_tizen> 6 </since_tizen>
}
/// <summary>
- /// Gets or sets point size of text.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float PointSize
- {
- get
- {
- return textField.PointSize;
- }
- set
- {
- CreateTextFieldAttributes();
- if (null == inputFieldAttrs.InputBoxAttributes.PointSize)
- {
- inputFieldAttrs.InputBoxAttributes.PointSize = new FloatSelector();
- }
- inputFieldAttrs.InputBoxAttributes.PointSize.All = value;
- textField.PointSize = value;
- }
- }
-
- /// <summary>
/// Gets or sets enable cursor blink.
/// </summary>
/// <since_tizen> 6 </since_tizen>
set
{
CreateTextFieldAttributes();
- inputFieldAttrs.InputBoxAttributes.EnableEllipsis = value;
+ inputFieldAttrs.InputBoxAttributes.Ellipsis = value;
textField.Ellipsis = value;
}
}
{
get
{
- return inputFieldAttrs.BackgroundImageAttributes?.ResourceURL?.All;
+ return inputFieldAttrs.BackgroundImageAttributes?.ResourceUrl?.All;
}
set
{
if (value != null)
{
CreateBackgroundAttributes();
- if (inputFieldAttrs.BackgroundImageAttributes.ResourceURL == null)
+ if (inputFieldAttrs.BackgroundImageAttributes.ResourceUrl == null)
{
- inputFieldAttrs.BackgroundImageAttributes.ResourceURL = new StringSelector();
+ inputFieldAttrs.BackgroundImageAttributes.ResourceUrl = new Selector<string>();
}
- inputFieldAttrs.BackgroundImageAttributes.ResourceURL.All = value;
+ inputFieldAttrs.BackgroundImageAttributes.ResourceUrl.All = value;
RelayoutRequest();
}
}
CreateBackgroundAttributes();
if (inputFieldAttrs.BackgroundImageAttributes.Border == null)
{
- inputFieldAttrs.BackgroundImageAttributes.Border = new RectangleSelector();
+ inputFieldAttrs.BackgroundImageAttributes.Border = new Selector<Rectangle>();
}
inputFieldAttrs.BackgroundImageAttributes.Border.All = value;
RelayoutRequest();
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new InputFieldAttributes();
+ return new InputFieldStyle();
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnUpdate()
{
- ApplyAttributes(this, inputFieldAttrs);
- ApplyAttributes(bgImage, inputFieldAttrs.BackgroundImageAttributes);
- ApplyAttributes(textField, inputFieldAttrs.InputBoxAttributes);
RelayoutComponent();
OnLayoutDirectionChanged();
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- InputFieldAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as InputFieldAttributes;
- if (tempAttributes != null)
+ InputFieldStyle tempStyle = StyleManager.Instance.GetAttributes(style) as InputFieldStyle;
+ if (tempStyle != null)
{
- attributes = inputFieldAttrs = tempAttributes;
+ Style.CopyFrom(tempStyle);
RelayoutRequest();
}
}
private void Initialize()
{
- inputFieldAttrs = attributes as InputFieldAttributes;
+ inputFieldAttrs = Style as InputFieldStyle;
if (null == inputFieldAttrs)
{
throw new Exception("Fail to get the InputField attributes.");
{
if (null == inputFieldAttrs.BackgroundImageAttributes)
{
- inputFieldAttrs.BackgroundImageAttributes = new ImageAttributes();
+ inputFieldAttrs.BackgroundImageAttributes = new ImageViewStyle();
}
}
{
if (null == inputFieldAttrs.InputBoxAttributes)
{
- inputFieldAttrs.InputBoxAttributes = new TextFieldAttributes();
+ inputFieldAttrs.InputBoxAttributes = new TextFieldStyle();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <since_tizen> 6 </since_tizen>
public class Loading : Control
{
- private LoadingAttributes loadingAttrs = null; // Loading Attributes
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ImagesProperty = BindableProperty.Create("Images", typeof(string[]), typeof(Loading), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Loading)bindable;
+ if (newValue != null)
+ {
+ instance.Style.Images = (string[])newValue;
+ instance.imageVisual.URLS = new List<string>((string[])newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Loading)bindable;
+ return instance.Style.Images;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new static readonly BindableProperty SizeProperty = BindableProperty.Create("Size", typeof(Size), typeof(Loading), new Size(0,0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Loading)bindable;
+ if (newValue != null)
+ {
+ Size size = (Size)newValue;
+ instance.Style.Size = size;
+ //insbase.Size = value;
+ instance.imageVisual.Size = new Size2D((int)size.Width, (int)size.Height);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Loading)bindable;
+ return instance.Style.Size;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FrameRateProperty = BindableProperty.Create("FrameRate", typeof(int), typeof(Loading), (int)(1000/16.6f), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Loading)bindable;
+ if (newValue != null)
+ {
+ int frameRate = (int)newValue;
+ if (0 != frameRate) //It will crash if 0
+ {
+ instance.Style.FrameRate.All = frameRate;
+ instance.imageVisual.FrameDelay = 1000.0f / frameRate;
+ }
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Loading)bindable;
+ return instance.Style.FrameRate?.All ?? (int)(1000/16.6f);
+ });
+
private AnimatedImageVisual imageVisual = null;
/// <summary>
- /// The constructor of Loading
+ /// The constructor of Loading.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public Loading() : base()
/// </summary>
/// <param name="style">The string to initialize the Loading.</param>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Loading(string style) : base(style)
{
}
/// <summary>
- /// The constructor of the Loading class with specific Attributes.
+ /// The constructor of the Loading class with specific style.
/// </summary>
- /// <param name="attributes">The Attributes object to initialize the Loading.</param>
+ /// <param name="style">The style object to initialize the Loading.</param>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Loading(LoadingAttributes attributes) : base(attributes)
+ public Loading(LoadingStyle style) : base(style)
{
Initialize();
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new LoadingStyle Style => ViewStyle as LoadingStyle;
+
/// <summary>
/// Gets or sets loading image resource array.
/// </summary>
{
get
{
- return loadingAttrs.ImageArray;
+ return Images;
}
set
{
- if (null != value)
- {
- loadingAttrs.ImageArray = value;
- imageVisual.URLS = new List<string>(value);
- }
+ Images = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets loading image resources.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string[] Images
+ {
+ get
+ {
+ return (string[])GetValue(ImagesProperty);
+ }
+ set
+ {
+ SetValue(ImagesProperty, value);
}
}
{
get
{
- return loadingAttrs.Size ?? new Size(100, 100);
+ return (Size)GetValue(SizeProperty);
}
set
{
- loadingAttrs.Size = value;
- base.Size = value;
- imageVisual.Size = new Size2D((int)value.Width, (int)value.Height);
+ SetValue(SizeProperty, value);
}
}
/// <summary>
- /// Gets or sets FPS of loading.
+ /// Gets or sets frame rate of loading.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public int FrameRate
{
get
{
- return loadingAttrs?.FrameRate?.All ?? (int)(1000.0f / 16.6f);
+ return (int)GetValue(FrameRateProperty);
}
set
{
- if (value != 0) //It will crash if 0
- {
- if (null == loadingAttrs.FrameRate)
- {
- loadingAttrs.FrameRate = new IntSelector();
- }
- loadingAttrs.FrameRate.All = value;
- imageVisual.FrameDelay = 1000.0f / value;
- }
+ SetValue(FrameRateProperty, value);
}
}
/// <summary>
- /// Get Loading attribues.
+ /// Get Loading style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new LoadingAttributes();
+ return new LoadingStyle();
}
/// <summary>
RemoveVisual("loadingImageVisual");
}
- //Release your own unmanaged resources here.
- //You should not access any managed member here except static instance.
- //because the execution order of Finalizes is non-deterministic.
- //Unreference this from if a static instance refer to this.
-
//You must call base.Dispose(type) just before exit.
base.Dispose(type);
}
- /// <summary>
- /// Update Loading by attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
- {
- }
-
private void Initialize()
{
- loadingAttrs = attributes as LoadingAttributes;
- if (null == loadingAttrs)
- {
- throw new Exception("Loading attribute parse error.");
- }
- ApplyAttributes(this, loadingAttrs);
-
imageVisual = new AnimatedImageVisual()
{
URLS = new List<string>(),
private void UpdateVisual()
{
- if (null != loadingAttrs.ImageArray)
+ if (null != Style.Images)
{
- imageVisual.URLS = new List<string>(loadingAttrs.ImageArray);
+ imageVisual.URLS = new List<string>(Style.Images);
}
- if (null != loadingAttrs.FrameRate)
+ if (null != Style.FrameRate?.All && 0 != Style.FrameRate.All.Value)
{
- imageVisual.FrameDelay = 1000.0f / (float)loadingAttrs.FrameRate.All;
+ imageVisual.FrameDelay = 1000.0f / (float)Style.FrameRate.All.Value;
}
- if (null != loadingAttrs.LoadingSize)
+ if (null != Style.LoadingSize)
{
- imageVisual.Size = new Size2D((int)loadingAttrs.LoadingSize.Width, (int)loadingAttrs.LoadingSize.Height);
+ imageVisual.Size = new Size2D((int)Style.LoadingSize.Width, (int)Style.LoadingSize.Height);
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class Pagination: Control
{
- private PaginationAttributes paginationAttributes;
+ private PaginationStyle paginationStyle;
private VisualView container;
}
/// <summary>
- /// Creates a new instance of a Pagination using attributes.
+ /// Creates a new instance of a Pagination using style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Pagination(PaginationAttributes attributes) : base(attributes)
+ public Pagination(PaginationStyle style) : base(style)
{
Initialize();
}
{
get
{
- return paginationAttributes?.IndicatorSize;
+ return paginationStyle?.IndicatorSize;
}
set
{
- if (value == null || paginationAttributes == null)
+ if (value == null || paginationStyle == null)
{
return;
}
- paginationAttributes.IndicatorSize = value;
- RelayoutRequest();
+ paginationStyle.IndicatorSize = value;
+ UpdateVisual();
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public string IndicatorBackgroundURL
- {
- get
- {
- return paginationAttributes?.IndicatorBackgroundURL;
- }
- set
- {
- if (value == null || paginationAttributes == null)
- {
- return;
- }
- paginationAttributes.IndicatorBackgroundURL = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Gets or sets the resource of the select indicator.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string IndicatorSelectURL
+ public Selector<string> IndicatorImageURL
{
get
{
- return paginationAttributes?.IndicatorSelectURL;
+ return paginationStyle?.IndicatorImageURL;
}
set
{
- if (value == null || paginationAttributes == null)
+ if (value == null || paginationStyle == null)
{
return;
}
- paginationAttributes.IndicatorSelectURL = value;
- RelayoutRequest();
+ paginationStyle.IndicatorImageURL = value;
+ UpdateVisual();
}
}
{
get
{
- return (int)paginationAttributes?.IndicatorSpacing;
+ return (int)paginationStyle?.IndicatorSpacing;
}
set
{
- if (paginationAttributes == null)
+ if (paginationStyle == null)
{
return;
}
- paginationAttributes.IndicatorSpacing = value;
- RelayoutRequest();
+ paginationStyle.IndicatorSpacing = value;
+ UpdateVisual();
}
}
container.RemoveVisual("Indicator" + i);
}
indicatorList.RemoveRange(value, indicatorCount - value);
- if(value <= 0)
- {
- container.RemoveVisual("SelectIndicator");
- }
- else if(selectedIndex >= value)
+ //if(value <= 0)
+ //{
+ // container.RemoveVisual("SelectIndicator");
+ //}
+ //else
+ if (selectedIndex >= value)
{
selectedIndex = 0;
SelectIn(indicatorList[selectedIndex]);
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Position2D GetIndicatorPosition(int index)
+ public Position GetIndicatorPosition(int index)
{
if (index < 0 || index >= indicatorList.Count)
{
return null;
}
- return new Vector2(indicatorList[index].Position.X + container.PositionX, indicatorList[index].Position.Y + container.PositionY);
+ return new Position(indicatorList[index].Position.X + container.PositionX, indicatorList[index].Position.Y + container.PositionY);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void SelectOut(VisualMap selectOutIndicator)
{
-
+ ImageVisual visual = selectOutIndicator as ImageVisual;
+ visual.URL = paginationStyle.IndicatorImageURL.Normal;
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void SelectIn(VisualMap selectInIndicator)
{
- selectIndicator.Position = selectInIndicator.Position;
+ //selectIndicator.Position = selectInIndicator.Position;
+ ImageVisual visual = selectInIndicator as ImageVisual;
+ visual.URL = paginationStyle.IndicatorImageURL.Selected;
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new PaginationAttributes();
+ return new PaginationStyle();
}
/// <summary>
base.Dispose(type);
}
- /// <summary>
- /// you can override it to update your own resources.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
- {
-
- for (int i = 0; i < indicatorList.Count; i++)
- {
- ImageVisual indicator = indicatorList[i];
- indicator.URL = paginationAttributes.IndicatorBackgroundURL;
- 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 = new Size2D((int)paginationAttributes.IndicatorSize.Width, (int)paginationAttributes.IndicatorSize.Height);
-
- //UpdateContainer();
- }
-
private void Initialize()
{
- paginationAttributes = attributes as PaginationAttributes;
- if (paginationAttributes == null)
+ paginationStyle = Style as PaginationStyle;
+ if (paginationStyle == null)
{
throw new Exception("Pagination attributes is null.");
}
};
this.Add(container);
- selectIndicator = new ImageVisual()
- {
- URL = " "
- };
- container.AddVisual("SelectIndicator", selectIndicator);
+ //selectIndicator = new ImageVisual()
+ //{
+ // URL = " "
+ //};
+ //container.AddVisual("SelectIndicator", selectIndicator);
}
private void CreateIndicator()
{
- if (paginationAttributes == null)
+ if (paginationStyle == null)
{
return;
}
ImageVisual indicator = new ImageVisual
{
- URL = paginationAttributes.IndicatorBackgroundURL,
- Size = new Size2D((int)paginationAttributes.IndicatorSize.Width, (int)paginationAttributes.IndicatorSize.Height)
+ URL = paginationStyle.IndicatorImageURL.Normal,
+ Size = new Size2D((int)paginationStyle.IndicatorSize.Width, (int)paginationStyle.IndicatorSize.Height)
};
- indicator.Position = new Position2D((int)(paginationAttributes.IndicatorSize.Width + paginationAttributes.IndicatorSpacing) * indicatorList.Count, 0);
+ indicator.Position = new Position2D((int)(paginationStyle.IndicatorSize.Width + paginationStyle.IndicatorSpacing) * indicatorList.Count, 0);
container.AddVisual("Indicator" + indicatorList.Count, indicator);
indicatorList.Add(indicator);
}
private void UpdateContainer()
{
- if (paginationAttributes == null)
+ if (paginationStyle == null)
{
return;
}
if (indicatorList.Count > 0)
{
- container.SizeWidth = (paginationAttributes.IndicatorSize.Width + paginationAttributes.IndicatorSpacing) * indicatorList.Count - paginationAttributes.IndicatorSpacing;
+ container.SizeWidth = (paginationStyle.IndicatorSize.Width + paginationStyle.IndicatorSpacing) * indicatorList.Count - paginationStyle.IndicatorSpacing;
}
else
{
container.SizeWidth = 0;
}
- container.SizeHeight = paginationAttributes.IndicatorSize.Height;
+ container.SizeHeight = paginationStyle.IndicatorSize.Height;
container.PositionX = (int)((this.SizeWidth - container.SizeWidth) / 2);
}
+
+ private void UpdateVisual()
+ {
+ if (null == paginationStyle.IndicatorSize) return;
+ if (null == paginationStyle.IndicatorImageURL) return;
+ if (indicatorCount < 0) return;
+
+ for (int i = 0; i < indicatorList.Count; i++)
+ {
+ ImageVisual indicator = indicatorList[i];
+ indicator.URL = paginationStyle.IndicatorImageURL.Normal;
+ indicator.Size = new Size2D((int)paginationStyle.IndicatorSize.Width, (int)paginationStyle.IndicatorSize.Height);
+ indicator.Position = new Position2D((int)(paginationStyle.IndicatorSize.Width + paginationStyle.IndicatorSpacing) * i, 0);
+ }
+
+ //selectIndicator.URL = paginationStyle.IndicatorSelectURL;
+ //selectIndicator.Size = new Size2D((int)paginationStyle.IndicatorSize.Width, (int)paginationStyle.IndicatorSize.Height);
+ }
}
}
using System;
using System.Collections.Generic;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
using System.ComponentModel;
namespace Tizen.NUI.Components
/// <since_tizen> 6 </since_tizen>
public class Popup : Control
{
- private ImageView backgroundImage;
- private ImageView shadowImage;
- private TextLabel titleText;
- private List<Button> buttonList;
- private List<string> buttonTextList = new List<string>();
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ButtonCountProperty = BindableProperty.Create("ButtonCount", typeof(int), typeof(Popup), 0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Popup)bindable;
+ if ((int)newValue != instance.buttonCount)
+ {
+ instance.buttonCount = (int)newValue;
+ instance.UpdateButton();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.buttonCount;
+ });
- private PopupAttributes popupAttributes;
- private int buttonCount = 0;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create("ShadowOffset", typeof(Vector4), typeof(Popup), new Vector4(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Popup)bindable;
+ if (newValue != null)
+ {
+ if (instance.Style.ShadowOffset == null)
+ {
+ instance.Style.ShadowOffset = new Vector4(0, 0, 0, 0);
+ }
+ instance.Style.ShadowOffset = (Vector4)newValue;
+ instance.UpdateShadow();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.ShadowOffset;
+ });
- /// <summary>
- /// Creates a new instance of a Popup.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- public Popup() : base()
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ButtonHeightProperty = BindableProperty.Create("ButtonHeight", typeof(int), typeof(Popup), default(int), propertyChanged: (bindable, oldValue, newValue) =>
{
- Initialize();
- }
+ var instance = (Popup)bindable;
+ if (newValue != null)
+ {
+ instance.Style.Buttons.Size.Height = (int)newValue;
+ instance.UpdateButton();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.Buttons?.Size?.Height ?? 0;
+ });
- /// <summary>
- /// Creates a new instance of a Popup with style.
- /// </summary>
- /// <param name="style">Create Popup by special style defined in UX.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Popup(string style) : base(style)
+ public static readonly BindableProperty ButtonTextPointSizeProperty = BindableProperty.Create("ButtonTextPointSize", typeof(float), typeof(Popup), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
- Initialize();
- }
+ var instance = (Popup)bindable;
+ if (newValue != null)
+ {
+ if (instance.Style.Buttons.Text.PointSize == null)
+ {
+ instance.Style.Buttons.Text.PointSize = new Selector<float?>();
+ }
+ instance.Style.Buttons.Text.PointSize.All = (float)newValue;
+ instance.UpdateButton();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.Buttons?.Text?.PointSize?.All ?? 0;
+ });
- /// <summary>
- /// Creates a new instance of a Popup with attributes.
- /// </summary>
- /// <param name="attributes">Create Popup by attributes customized by user.</param>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Popup(PopupAttributes attributes) : base(attributes)
+ public static readonly BindableProperty ButtonFontFamilyProperty = BindableProperty.Create("ButtonFontFamily", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
{
- Initialize();
- }
+ var instance = (Popup)bindable;
+ if (newValue != null)
+ {
+ instance.Style.Buttons.Text.FontFamily = (string)newValue;
+ instance.UpdateButton();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.Buttons?.Text?.FontFamily;
+ });
- /// <summary>
- /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- public event EventHandler<ButtonClickEventArgs> PopupButtonClickEvent;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ButtonTextColorProperty = BindableProperty.Create("ButtonTextColor", typeof(Color), typeof(Popup), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Popup)bindable;
+ if (newValue != null)
+ {
+ if (instance.Style.Buttons.Text.TextColor == null)
+ {
+ instance.Style.Buttons.Text.TextColor = new Selector<Color>();
+ }
+ instance.Style.Buttons.Text.TextColor.All = (Color)newValue;
+ //instance.UpdateButton();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.Buttons?.Text?.TextColor?.All;
+ });
- /// <summary>
- /// Title text string in Popup.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- public string TitleText
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ButtonOverLayBackgroundColorSelectorProperty = BindableProperty.Create("ButtonOverLayBackgroundColorSelector", typeof(Selector<Color>), typeof(Popup), new Selector<Color>(), propertyChanged: (bindable, oldValue, newValue) =>
{
- get
+ var instance = (Popup)bindable;
+ if (newValue != null)
{
- return popupAttributes?.TitleTextAttributes?.Text?.All;
+ instance.Style.Buttons.Overlay.BackgroundColor = (Selector<Color>)newValue;
+ instance.UpdateButton();
}
- set
- {
- if (value != null)
- {
- CreateTitleTextAttributes();
- if (popupAttributes.TitleTextAttributes.Text == null)
- {
- popupAttributes.TitleTextAttributes.Text = new StringSelector();
- }
- popupAttributes.TitleTextAttributes.Text.All = value;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.Buttons?.Overlay?.BackgroundColor;
+ });
- RelayoutRequest();
- }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ButtonTextAlignmentProperty = BindableProperty.Create("ButtonTextAlignment", typeof(HorizontalAlignment), typeof(Popup), new HorizontalAlignment(), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Popup)bindable;
+ if (newValue != null)
+ {
+ instance.Style.Buttons.Text.HorizontalAlignment = (HorizontalAlignment)newValue;
+ instance.UpdateButton();
}
- }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.Buttons?.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ });
- /// <summary>
- /// Button count in Popup.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- public int ButtonCount
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ButtonBackgroundProperty = BindableProperty.Create("ButtonBackground", typeof(string), typeof(Popup), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
{
- get
+ var instance = (Popup)bindable;
+ if (newValue != null)
{
- return buttonCount;
+ if (instance.Style.Buttons.Background.ResourceUrl == null)
+ {
+ instance.Style.Buttons.Background.ResourceUrl = new Selector<string>();
+ }
+ instance.Style.Buttons.Background.ResourceUrl.All = (string)newValue;
+ instance.UpdateButton();
}
- set
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.Buttons?.Background?.ResourceUrl?.All;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ButtonBackgroundBorderProperty = BindableProperty.Create("ButtonBackgroundBorder", typeof(Rectangle), typeof(Popup), new Rectangle(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Popup)bindable;
+ if (newValue != null)
{
- if (buttonCount != value)
+ if (instance.Style.Buttons.Background.Border == null)
{
- buttonCount = value;
- RelayoutRequest();
+ instance.Style.Buttons.Background.Border = new Selector<Rectangle>();
}
+ instance.Style.Buttons.Background.Border.All = (Rectangle)newValue;
+ instance.UpdateButton();
}
- }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Popup)bindable;
+ return instance.Style.Buttons?.Background?.Border?.All;
+ });
+
+ private TextLabel titleText;
+ private List<Button> buttonList;
+ private List<string> buttonTextList = new List<string>();
+
+ private int buttonCount = 0;
/// <summary>
- /// Content view in Popup, only can be gotten.
+ /// Creates a new instance of a Popup.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public View ContentView
+ public Popup() : base()
{
- get;
- private set;
+ Initialize();
}
/// <summary>
- /// Shadow image's resource url in Popup.
+ /// Creates a new instance of a Popup with style.
/// </summary>
+ /// <param name="style">Create Popup by special style defined in UX.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public string ShadowImageURL
+ public Popup(string style) : base(style)
{
- get
- {
- return popupAttributes?.ShadowImageAttributes?.ResourceURL?.All;
- }
- set
- {
- if (value != null)
- {
- CreateShadowAttributes();
- if (popupAttributes.ShadowImageAttributes.ResourceURL == null)
- {
- popupAttributes.ShadowImageAttributes.ResourceURL = new StringSelector();
- }
- popupAttributes.ShadowImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
- }
+ Initialize();
}
/// <summary>
- /// Shadow image's border in Popup.
+ /// Creates a new instance of a Popup with attributes.
/// </summary>
+ /// <param name="attributes">Create Popup by attributes customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Rectangle ShadowImageBorder
+ public Popup(PopupStyle attributes) : base(attributes)
{
- get
- {
- return popupAttributes?.ShadowImageAttributes?.Border?.All;
- }
- set
- {
- if (value != null)
- {
- CreateShadowAttributes();
- if (popupAttributes.ShadowImageAttributes.Border == null)
- {
- popupAttributes.ShadowImageAttributes.Border = new RectangleSelector();
- }
- popupAttributes.ShadowImageAttributes.Border.All = value;
- RelayoutRequest();
- }
- }
+ Initialize();
}
/// <summary>
- /// Background image's resource url in Popup.
+ /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ public event EventHandler<ButtonClickEventArgs> PopupButtonClickEvent;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public string BackgroundImageURL
+ public new PopupStyle Style => ViewStyle as PopupStyle;
+
+ /// <summary>
+ /// Title text string in Popup.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ public string TitleText
{
get
{
- return popupAttributes?.BackgroundImageAttributes?.ResourceURL?.All;
+ return Style.Title?.Text?.All;
}
set
{
if (value != null)
{
- CreateBackgroundAttributes();
- if (popupAttributes.BackgroundImageAttributes.ResourceURL == null)
+ //CreateTitleTextAttributes();
+ if (Style.Title.Text == null)
{
- popupAttributes.BackgroundImageAttributes.ResourceURL = new StringSelector();
+ Style.Title.Text = new StringSelector();
}
- popupAttributes.BackgroundImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.Title.Text.All = value;
+
+ //RelayoutRequest();
}
}
}
/// <summary>
- /// Background image's border in Popup.
+ /// Title text point size in Popup.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Rectangle BackgroundImageBorder
+ public float TitlePointSize
{
get
{
- return popupAttributes?.BackgroundImageAttributes?.Border?.All;
+ return Style.Title?.PointSize?.All ?? 0;
}
set
{
- if (value != null)
+ //CreateTitleTextAttributes();
+ if (Style.Title.PointSize == null)
{
- CreateBackgroundAttributes();
- if (popupAttributes.BackgroundImageAttributes.Border == null)
- {
- popupAttributes.BackgroundImageAttributes.Border = new RectangleSelector();
- }
- popupAttributes.BackgroundImageAttributes.Border.All = value;
- RelayoutRequest();
+ Style.Title.PointSize = new FloatSelector();
}
+ Style.Title.PointSize.All = value;
+ //RelayoutRequest();
}
}
/// <summary>
- /// Title text point size in Popup.
+ /// Title text color in Popup.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public float TitlePointSize
+ public Color TitleTextColor
{
get
{
- return popupAttributes?.TitleTextAttributes?.PointSize?.All ?? 0;
+ return Style.Title?.TextColor?.All;
}
set
{
- CreateTitleTextAttributes();
- if (popupAttributes.TitleTextAttributes.PointSize == null)
+ //CreateTitleTextAttributes();
+ if (Style.Title.TextColor == null)
{
- popupAttributes.TitleTextAttributes.PointSize = new FloatSelector();
+ Style.Title.TextColor = new ColorSelector();
}
- popupAttributes.TitleTextAttributes.PointSize.All = value;
- RelayoutRequest();
+ Style.Title.TextColor.All = value;
+ //RelayoutRequest();
}
}
/// <summary>
- /// Title text font family in Popup.
+ /// Title text horizontal alignment in Popup.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string TitleFontFamily
+ public HorizontalAlignment TitleTextHorizontalAlignment
{
get
{
- return popupAttributes?.TitleTextAttributes?.FontFamily;
+ return Style.Title?.HorizontalAlignment ?? HorizontalAlignment.Center;
}
set
{
- CreateTitleTextAttributes();
- popupAttributes.TitleTextAttributes.FontFamily = value;
- RelayoutRequest();
+ //CreateTitleTextAttributes();
+ Style.Title.HorizontalAlignment = value;
+ //RelayoutRequest();
}
}
/// <summary>
- /// Title text color in Popup.
+ /// Title text's position in Popup.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public Color TitleTextColor
+ public Position TitleTextPosition
{
get
{
- return popupAttributes?.TitleTextAttributes?.TextColor?.All;
+ return Style.Title?.Position ?? new Position(0, 0, 0);
}
set
{
- CreateTitleTextAttributes();
- if (popupAttributes.TitleTextAttributes.TextColor == null)
- {
- popupAttributes.TitleTextAttributes.TextColor = new ColorSelector();
- }
- popupAttributes.TitleTextAttributes.TextColor.All = value;
- RelayoutRequest();
+ //CreateTitleTextAttributes();
+ Style.Title.Position = value;
+ //RelayoutRequest();
}
}
/// <summary>
- /// Title text horizontal alignment in Popup.
+ /// Title text's height in Popup.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public HorizontalAlignment TitleTextHorizontalAlignment
+ public int TitleHeight
{
get
{
- return popupAttributes?.TitleTextAttributes?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ return (int)(Style.Title?.Size?.Height ?? 0);
}
set
{
- CreateTitleTextAttributes();
- popupAttributes.TitleTextAttributes.HorizontalAlignment = value;
- RelayoutRequest();
+ //CreateTitleTextAttributes();
+ Style.Title.Size.Height = value;
+ //RelayoutRequest();
}
}
/// <summary>
- /// Title text's position in Popup.
+ /// Content view in Popup, only can be gotten.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public Position TitleTextPosition
+ public View ContentView
{
- get
- {
- return popupAttributes?.TitleTextAttributes?.Position ?? new Position(0, 0, 0);
- }
- set
- {
- CreateTitleTextAttributes();
- popupAttributes.TitleTextAttributes.Position = value;
- RelayoutRequest();
- }
+ get;
+ private set;
}
/// <summary>
- /// Title text's height in Popup.
+ /// Button count in Popup.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public int TitleHeight
+ public int ButtonCount
{
get
{
- return (int)(popupAttributes?.TitleTextAttributes?.Size?.Height ?? 0);
+ return (int)GetValue(ButtonCountProperty);
}
set
{
- CreateTitleTextAttributes();
- popupAttributes.TitleTextAttributes.Size.Height = value;
- RelayoutRequest();
+ SetValue(ButtonCountProperty, value);
}
}
{
get
{
- return popupAttributes?.ShadowOffset;
+ return (Vector4)GetValue(ShadowOffsetProperty);
}
set
{
- if (value != null)
- {
- if (popupAttributes.ShadowOffset == null)
- {
- popupAttributes.ShadowOffset = new Vector4(0, 0, 0, 0);
- }
- popupAttributes.ShadowOffset = value;
- RelayoutRequest();
- }
+ SetValue(ShadowOffsetProperty, value);
}
}
{
get
{
- return (int)(popupAttributes?.ButtonAttributes?.Size?.Height ?? 0);
+ return (int)GetValue(ButtonHeightProperty);
}
set
{
- CreateButtonAttributes();
- popupAttributes.ButtonAttributes.Size.Height = value;
- RelayoutRequest();
+ SetValue(ButtonHeightProperty, value);
}
}
{
get
{
- return popupAttributes?.ButtonAttributes?.TextAttributes?.PointSize?.All ?? 0;
+ return (float)GetValue(ButtonTextPointSizeProperty);
}
set
{
- CreateButtonAttributes();
- if (popupAttributes.ButtonAttributes.TextAttributes.PointSize == null)
- {
- popupAttributes.ButtonAttributes.TextAttributes.PointSize = new FloatSelector();
- }
- popupAttributes.ButtonAttributes.TextAttributes.PointSize.All = value;
- RelayoutRequest();
+ SetValue(ButtonTextPointSizeProperty, value);
}
}
public string ButtonFontFamily
{
get
- {
- return popupAttributes?.ButtonAttributes?.TextAttributes?.FontFamily;
+ {
+ return (string)GetValue(ButtonFontFamilyProperty);
}
set
{
- CreateButtonAttributes();
- popupAttributes.ButtonAttributes.TextAttributes.FontFamily = value;
- RelayoutRequest();
+ SetValue(ButtonFontFamilyProperty, value);
}
}
{
get
{
- return popupAttributes?.ButtonAttributes?.TextAttributes?.TextColor?.All;
+ return (Color)GetValue(ButtonTextColorProperty);
}
set
{
- CreateButtonAttributes();
- if (popupAttributes.ButtonAttributes.TextAttributes.TextColor == null)
- {
- popupAttributes.ButtonAttributes.TextAttributes.TextColor = new ColorSelector();
- }
- popupAttributes.ButtonAttributes.TextAttributes.TextColor.All = value;
- RelayoutRequest();
+ SetValue(ButtonTextColorProperty, value);
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ColorSelector ButtonOverLayBackgroundColorSelector
+ public Selector<Color> ButtonOverLayBackgroundColorSelector
{
get
{
- return popupAttributes?.ButtonAttributes?.OverlayImageAttributes?.BackgroundColor;
+ return (Selector<Color>)GetValue(ButtonOverLayBackgroundColorSelectorProperty);
}
set
{
- if (value != null)
- {
- CreateButtonAttributes();
- popupAttributes.ButtonAttributes.OverlayImageAttributes.BackgroundColor = value.Clone() as ColorSelector;
- RelayoutRequest();
- }
+ SetValue(ButtonOverLayBackgroundColorSelectorProperty, value);
}
}
public HorizontalAlignment ButtonTextAlignment
{
get
- {
- return popupAttributes?.ButtonAttributes?.TextAttributes?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ {
+ return (HorizontalAlignment)GetValue(ButtonTextAlignmentProperty);
}
set
{
- CreateButtonAttributes();
- popupAttributes.ButtonAttributes.TextAttributes.HorizontalAlignment = value;
- RelayoutRequest();
+ SetValue(ButtonTextAlignmentProperty, value);
}
}
public string ButtonBackgroundImageURL
{
get
- {
- return popupAttributes?.ButtonAttributes?.BackgroundImageAttributes?.ResourceURL?.All;
+ {
+ return (string)GetValue(ButtonBackgroundProperty);
}
set
{
- if (value != null)
- {
- CreateButtonAttributes();
- if (popupAttributes.ButtonAttributes.BackgroundImageAttributes.ResourceURL == null)
- {
- popupAttributes.ButtonAttributes.BackgroundImageAttributes.ResourceURL = new StringSelector();
- }
- popupAttributes.ButtonAttributes.BackgroundImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
+ SetValue(ButtonBackgroundProperty, value);
}
}
{
get
{
- return popupAttributes?.ButtonAttributes?.BackgroundImageAttributes?.Border?.All;
+
+ return (Rectangle)GetValue(ButtonBackgroundBorderProperty);
}
set
{
- if (value != null)
- {
- CreateButtonAttributes();
- if (popupAttributes.ButtonAttributes.BackgroundImageAttributes.Border == null)
- {
- popupAttributes.ButtonAttributes.BackgroundImageAttributes.Border = new RectangleSelector();
- }
- popupAttributes.ButtonAttributes.BackgroundImageAttributes.Border.All = value;
- RelayoutRequest();
- }
+ SetValue(ButtonBackgroundBorderProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new Size2D Size2D
+ {
+ get
+ {
+ return base.Size2D;
+ }
+ set
+ {
+ base.Size2D = value;
+ UpdateShadow();
}
}
}
}
buttonTextList[index] = text;
- RelayoutRequest();
+ UpdateButton();
}
/// <summary>
titleText.Dispose();
titleText = null;
}
- if (backgroundImage != null)
- {
- Remove(backgroundImage);
- backgroundImage.Dispose();
- backgroundImage = null;
- }
- if (shadowImage != null)
- {
- Remove(shadowImage);
- shadowImage.Dispose();
- shadowImage = null;
- }
if (ContentView != null)
{
Remove(ContentView);
base.OnFocusLost();
}
- /// <summary>
- /// Get Popup attribues.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
- {
- return new PopupAttributes();
- }
-
- /// <summary>
- /// Update Popup by attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
+ public override void ApplyStyle(ViewStyle viewStyle)
{
- int w = 0;
- int h = 0;
- int titleX = 0;
- int titleY = 0;
- int titleH = 0;
- int buttonH = 0;
+ base.ApplyStyle(viewStyle);
- if (popupAttributes.ShadowImageAttributes != null)
- {
- if (shadowImage == null)
- {
- shadowImage = new ImageView();
- Add(shadowImage);
- }
- ApplyAttributes(shadowImage, popupAttributes.ShadowImageAttributes);
- w = Size2D.Width;
- h = Size2D.Height;
- if (popupAttributes.ShadowOffset != null)
- {
- w = (int)(Size2D.Width + popupAttributes.ShadowOffset.W + popupAttributes.ShadowOffset.X);
- h = (int)(Size2D.Height + popupAttributes.ShadowOffset.Y + popupAttributes.ShadowOffset.Z);
- }
+ PopupStyle popupStyle = viewStyle as PopupStyle;
- shadowImage.Size2D = new Size2D(w, h);
- }
-
- if (popupAttributes.BackgroundImageAttributes != null)
+ if (null != popupStyle)
{
- if (backgroundImage == null)
- {
- backgroundImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
- Add(backgroundImage);
- }
- ApplyAttributes(backgroundImage, popupAttributes.BackgroundImageAttributes);
- }
-
- if (popupAttributes.TitleTextAttributes != null)
- {
- if (titleText == null)
+ if (null == titleText)
{
titleText = new TextLabel();
Add(titleText);
}
- ApplyAttributes(titleText, popupAttributes.TitleTextAttributes);
-
- if (titleText.Text != null && titleText.Text != "")
- {
- popupAttributes.TitleTextAttributes.Text = new StringSelector { All = titleText.Text };
- w = (int)(Size2D.Width - titleText.PositionX * 2);
-
- if (popupAttributes.TitleTextAttributes.Size != null)
- {
- titleH = (int)titleText.Size.Height;
- }
- titleText.Size2D = new Size2D(w, titleH);
-
- if (popupAttributes.TitleTextAttributes.Position != null)
- {
- titleX = (int)popupAttributes.TitleTextAttributes.Position.X;
- titleY = (int)popupAttributes.TitleTextAttributes.Position.Y;
- }
- }
- else
- {
- titleText.Size2D = new Size2D(0, 0);
- }
-
-
+ titleText.ApplyStyle(Style.Title);
}
- ContentView.RaiseToTop();
-
- if (popupAttributes.ButtonAttributes != null && popupAttributes.ButtonAttributes.Size != null)
- {
- UpdateButton(buttonCount);
-
- if (buttonList != null)
- {
- 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);
-
- LayoutChild();
}
/// <summary>
- /// Layout child in Popup and it can be override by user.
+ /// Get Popup attribues.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected virtual void LayoutChild()
+ protected override ViewStyle GetViewStyle()
{
- if (popupAttributes == null)
- {
- return;
- }
-
- if(titleText != null)
- {
- if(LayoutDirection == ViewLayoutDirectionType.RTL)
- {
- if (popupAttributes.TitleTextAttributes != null)
- {
- popupAttributes.TitleTextAttributes.HorizontalAlignment = HorizontalAlignment.End;
- }
- titleText.HorizontalAlignment = HorizontalAlignment.End;
- }
- else if(LayoutDirection == ViewLayoutDirectionType.LTR)
- {
- if (popupAttributes.TitleTextAttributes != null)
- {
- popupAttributes.TitleTextAttributes.HorizontalAlignment = HorizontalAlignment.Begin;
- }
- titleText.HorizontalAlignment = HorizontalAlignment.Begin;
- }
- }
-
- if(buttonList != null && buttonList.Count > 0)
- {
- int pos = 0;
- if (LayoutDirection == ViewLayoutDirectionType.RTL)
- {
- for (int i = buttonList.Count - 1; i >= 0; i--)
- {
- buttonList[i].PositionX = pos;
- pos += buttonList[i].Size2D.Width;
- }
- }
- else
- {
- for (int i = 0; i < buttonList.Count; i++)
- {
- buttonList[i].PositionX = pos;
- pos += buttonList[i].Size2D.Width;
- }
- }
- }
+ return new PopupStyle();
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- PopupAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as PopupAttributes;
+ PopupStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as PopupStyle;
if (tempAttributes != null)
{
- attributes = popupAttributes = tempAttributes;
+ Style.CopyFrom(tempAttributes);
RelayoutRequest();
}
}
private void Initialize()
{
- popupAttributes = attributes as PopupAttributes;
- if (popupAttributes == null)
- {
- throw new Exception("Popup attribute parse error.");
- }
-
- ApplyAttributes(this, popupAttributes);
LeaveRequired = true;
+ // ContentView
ContentView = new View()
{
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
};
Add(ContentView);
ContentView.RaiseToTop();
- }
-
- private void CreateShadowAttributes()
- {
- if (popupAttributes.ShadowImageAttributes == null)
- {
- popupAttributes.ShadowImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- };
- }
- }
- private void CreateBackgroundAttributes()
- {
- if (popupAttributes.BackgroundImageAttributes == null)
+ // Title
+ if (null == titleText)
{
- popupAttributes.BackgroundImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
+ titleText = new TextLabel();
+ Add(titleText);
}
- }
- private void CreateTitleTextAttributes()
- {
- if (popupAttributes.TitleTextAttributes == null)
- {
- popupAttributes.TitleTextAttributes = new TextAttributes()
- {
- Size = new Size(0, 0),
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- HorizontalAlignment = HorizontalAlignment.Begin,
- VerticalAlignment = VerticalAlignment.Bottom
- };
- }
+ buttonList = new List<Button>();
}
- private void CreateButtonAttributes()
+ private void UpdateButton()
{
- if (popupAttributes.ButtonAttributes == null)
- {
- popupAttributes.ButtonAttributes = new ButtonAttributes()
- {
- Size = new Size(0, 0),
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
- PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
- TextAttributes = new TextAttributes
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center
- },
- BackgroundImageAttributes = new ImageAttributes
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- Border = new RectangleSelector { All = new Rectangle(0, 0, 0, 0) },
- },
- OverlayImageAttributes = new ImageAttributes
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- Border = new RectangleSelector { All = new Rectangle(0, 0, 0, 0) },
- },
- };
- }
- }
+ if (buttonCount <= 0) return;
+ if (buttonTextList.Count != buttonCount) return;
- private void UpdateButton(int count)
- {
- if(buttonList != null && buttonCount == buttonList.Count)
- {
- for (int i = 0; i < count; i++)
- {
- buttonList[i].TextColor = popupAttributes.ButtonAttributes.TextAttributes.TextColor.All;
- }
- return;
- }
-
if (buttonList != null)
{
foreach (Button btn in buttonList)
btn.Dispose();
}
buttonList.Clear();
- buttonList = null;
}
- if(count <= 0)
- {
- return;
+
+ int buttonWidth = Size2D.Width / buttonCount;
+ int buttonHeight = (int)Style.Buttons.Size.Height;
+ for (int i = 0; i < buttonCount; i++)
+ {
+ Button btn = new Button(Style.Buttons);
+ btn.Size2D = new Size2D(buttonWidth, buttonHeight);
+ btn.Style.Text.Text = buttonTextList[i];
+ btn.ClickEvent += ButtonClickEvent;
+
+ this.Add(btn);
+ buttonList.Add(btn);
}
- int buttonWidth = Size2D.Width / count;
- int buttonHeight = (int)popupAttributes.ButtonAttributes.Size.Height;
+
int pos = 0;
- buttonList = new List<Button>();
- for (int i = 0; i < count; i++)
+ if (buttonList != null && buttonList.Count > 0)
{
- Button btn = null;
- popupAttributes.ButtonAttributes.Size.Width = buttonWidth;
- btn = new Button(popupAttributes.ButtonAttributes);
- btn.Position2D = new Position2D(pos, 0);
-
- if (i >= buttonTextList.Count)
+ if (LayoutDirection == ViewLayoutDirectionType.RTL)
{
- buttonTextList.Add("");
+ for (int i = buttonList.Count - 1; i >= 0; i--)
+ {
+ buttonList[i].PositionX = pos;
+ pos += buttonList[i].Size2D.Width;
+ }
+ }
+ else
+ {
+ for (int i = 0; i < buttonList.Count; i++)
+ {
+ buttonList[i].PositionX = pos;
+ pos += buttonList[i].Size2D.Width;
+ }
}
- btn.Text = buttonTextList[i];
- btn.ClickEvent += ButtonClickEvent;
- pos += buttonWidth;
- this.Add(btn);
- buttonList.Add(btn);
}
+
+ UpdateContentView();
}
private void ButtonClickEvent(object sender, Button.ClickEventArgs e)
}
}
}
+ private void UpdateShadow()
+ {
+ if (Style.ShadowOffset == null) return;
+ int w = 0;
+ int h = 0;
+ if (Style.Shadow != null)
+ {
+ w = (int)(Size2D.Width + Style.ShadowOffset.W + Style.ShadowOffset.X);
+ h = (int)(Size2D.Height + Style.ShadowOffset.Y + Style.ShadowOffset.Z);
+
+ shadowImage.Size2D = new Size2D(w, h);
+ }
+ }
+
+ private void UpdateTitle()
+ {
+ int w = 0;
+ int h = 0;
+ int titleX = 0;
+ int titleY = 0;
+ int titleH = 0;
+ int buttonH = 0;
+
+ if (Style.Title != null)
+ {
+ if (titleText.Text != null && titleText.Text != "")
+ {
+ Style.Title.Text = new Selector<string> { All = titleText.Text };
+ w = (int)(Size2D.Width - titleText.PositionX * 2);
+
+ if (Style.Title.Size != null)
+ {
+ titleH = (int)titleText.Size.Height;
+ }
+ titleText.Size2D = new Size2D(w, titleH);
+ }
+ else
+ {
+ titleText.Size2D = new Size2D(0, 0);
+ }
+ }
+
+ if (titleText != null)
+ {
+ if (LayoutDirection == ViewLayoutDirectionType.RTL)
+ {
+ if (Style.Title != null)
+ {
+ Style.Title.HorizontalAlignment = HorizontalAlignment.End;
+ }
+ titleText.HorizontalAlignment = HorizontalAlignment.End;
+ }
+ else if (LayoutDirection == ViewLayoutDirectionType.LTR)
+ {
+ if (Style.Title != null)
+ {
+ Style.Title.HorizontalAlignment = HorizontalAlignment.Begin;
+ }
+ titleText.HorizontalAlignment = HorizontalAlignment.Begin;
+ }
+ }
+
+ UpdateContentView();
+ }
+
+ private void UpdateContentView()
+ {
+ int titleX = 0;
+ int titleY = 0;
+ int titleH = 0;
+ if (Style.Title.Size != null)
+ {
+ titleH = (int)titleText.Size.Height;
+ }
+ if (Style.Title.Position != null)
+ {
+ titleX = (int)Style.Title.Position.X;
+ titleY = (int)Style.Title.Position.Y;
+ }
+ int buttonH = (int)Style.Buttons.Size.Height;
+
+ ContentView.Size2D = new Size2D(Size2D.Width - titleX * 2, Size2D.Height - titleY - titleH - buttonH);
+ ContentView.Position2D = new Position2D(titleX, titleY + titleH);
+ ContentView.RaiseToTop();
+ }
/// <summary>
/// ButtonClickEventArgs is a class to record button click event arguments which will sent to user.
*/
using System;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
using System.ComponentModel;
namespace Tizen.NUI.Components
/// <since_tizen> 6 </since_tizen>
public class Progress : Control
{
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MaxValueProperty = BindableProperty.Create("MaxValue", typeof(float), typeof(Progress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Progress)bindable;
+ if (newValue != null)
+ {
+ instance.maxValue = (float)newValue;
+ instance.UpdateValue();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Progress)bindable;
+ return instance.maxValue;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MinValueProperty = BindableProperty.Create("MinValue", typeof(float), typeof(Progress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Progress)bindable;
+ if (newValue != null)
+ {
+ instance.minValue = (float)newValue;
+ instance.UpdateValue();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Progress)bindable;
+ return instance.minValue;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create("currentValue", typeof(float), typeof(Progress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Progress)bindable;
+ if (newValue != null)
+ {
+ if ((float)newValue > instance.maxValue || (float)newValue < instance.minValue)
+ {
+ return;
+ }
+ instance.currentValue = (float)newValue;
+ instance.UpdateValue();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Progress)bindable;
+ return instance.currentValue;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected ProgressAttributes progressAttrs = null;
+ public static readonly BindableProperty BufferValueProperty = BindableProperty.Create("bufferValue", typeof(float), typeof(Progress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Progress)bindable;
+ if (newValue != null)
+ {
+ if ((float)newValue > instance.maxValue || (float)newValue < instance.minValue)
+ {
+ return;
+ }
+ instance.bufferValue = (float)newValue;
+ instance.UpdateValue();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Progress)bindable;
+ return instance.bufferValue;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ProgressStateProperty = BindableProperty.Create("state", typeof(ProgressStatusType), typeof(Progress), ProgressStatusType.Indeterminate, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Progress)bindable;
+ if (newValue != null)
+ {
+ instance.state = (ProgressStatusType)newValue;
+ instance.UpdateStates();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Progress)bindable;
+ return instance.state;
+ });
+
/// 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 ProgressStatusType state = ProgressStatusType.Indeterminate;
private const float round = 0.5f;
- private ImageView trackObj = null;
- private ImageView progressObj = null;
- private ImageView bufferObj = null;
- private ImageView loadingObj = null;
+ private ImageView trackImage = null;
+ private ImageView progressImage = null;
+ private ImageView bufferImage = null;
private float maxValue = 100;
private float minValue = 0;
private float currentValue = 0;
/// <summary>
/// The constructor of the Progress class with specific Attributes.
/// </summary>
- /// <param name="attributes">The Attributes object to initialize the Progress.</param>
+ /// <param name="progressStyle">The Attributes object to initialize the Progress.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Progress(ProgressAttributes attributes) : base(attributes)
+ public Progress(ProgressStyle progressStyle) : base(progressStyle)
{
Initialize();
}
Indeterminate
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new ProgressStyle Style => ViewStyle as ProgressStyle;
+
/// <summary>
/// The property to get/set Track image object URL of the Progress.
/// </summary>
{
get
{
- return progressAttrs.TrackImageAttributes?.ResourceURL?.All;
+ return Style.Track?.ResourceUrl?.All;
}
set
{
- CreateTrackImageAttributes();
- if (progressAttrs.TrackImageAttributes.ResourceURL == null)
+ //CreateTrackImageAttributes();
+ if (Style.Track.ResourceUrl == null)
{
- progressAttrs.TrackImageAttributes.ResourceURL = new StringSelector();
+ Style.Track.ResourceUrl = new StringSelector();
}
- progressAttrs.TrackImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.Track.ResourceUrl.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return progressAttrs.ProgressImageAttributes?.ResourceURL?.All;
+ return Style.Progress?.ResourceUrl?.All;
}
set
{
- CreateProgressImageAttributes();
- if (progressAttrs.ProgressImageAttributes.ResourceURL == null)
+ //CreateProgressImageAttributes();
+ if (Style.Progress.ResourceUrl == null)
{
- progressAttrs.ProgressImageAttributes.ResourceURL = new StringSelector();
+ Style.Progress.ResourceUrl = new StringSelector();
}
- progressAttrs.ProgressImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.Progress.ResourceUrl.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return progressAttrs.BufferImageAttributes?.ResourceURL?.All;
+ return Style.Buffer?.ResourceUrl?.All;
}
set
{
- CreateBufferImageAttributes();
- if (progressAttrs.BufferImageAttributes.ResourceURL == null)
+ //CreateBufferImageAttributes();
+ if (Style.Buffer.ResourceUrl == null)
{
- progressAttrs.BufferImageAttributes.ResourceURL = new StringSelector();
+ Style.Buffer.ResourceUrl = new StringSelector();
}
- progressAttrs.BufferImageAttributes.ResourceURL.All = value;
+ Style.Buffer.ResourceUrl.All = value;
RelayoutRequest();
}
}
{
get
{
- return progressAttrs.TrackImageAttributes?.BackgroundColor?.All;
+ return Style.Track?.BackgroundColor?.All;
}
set
{
- CreateTrackImageAttributes();
- if (progressAttrs.TrackImageAttributes.BackgroundColor == null)
+ //CreateTrackImageAttributes();
+ if (Style.Track.BackgroundColor == null)
{
- progressAttrs.TrackImageAttributes.BackgroundColor = new ColorSelector();
+ Style.Track.BackgroundColor = new ColorSelector();
}
- progressAttrs.TrackImageAttributes.BackgroundColor.All = value;
- RelayoutRequest();
+ Style.Track.BackgroundColor.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return progressAttrs.ProgressImageAttributes?.BackgroundColor?.All;
+ return Style.Progress?.BackgroundColor?.All;
}
set
{
- CreateProgressImageAttributes();
- if (null == progressAttrs.ProgressImageAttributes.BackgroundColor)
+ //CreateProgressImageAttributes();
+ if (null == Style.Progress.BackgroundColor)
{
- progressAttrs.ProgressImageAttributes.BackgroundColor = new ColorSelector();
+ Style.Progress.BackgroundColor = new ColorSelector();
}
- progressAttrs.ProgressImageAttributes.BackgroundColor.All = value;
- RelayoutRequest();
+ Style.Progress.BackgroundColor.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return progressAttrs.BufferImageAttributes?.BackgroundColor?.All;
+ return Style.Buffer?.BackgroundColor?.All;
}
set
{
- CreateBufferImageAttributes();
- if (null == progressAttrs.BufferImageAttributes.BackgroundColor)
+ //CreateBufferImageAttributes();
+ if (null == Style.Buffer.BackgroundColor)
{
- progressAttrs.BufferImageAttributes.BackgroundColor = new ColorSelector();
+ Style.Buffer.BackgroundColor = new ColorSelector();
}
- progressAttrs.BufferImageAttributes.BackgroundColor.All = value;
- RelayoutRequest();
+ Style.Buffer.BackgroundColor.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return maxValue;
+ return (float)GetValue(MaxValueProperty);
}
set
{
- maxValue = value;
- UpdateValue();
+ SetValue(MaxValueProperty, value);
}
}
{
get
{
- return minValue;
+ return (float)GetValue(MinValueProperty);
}
set
{
- minValue = value;
- UpdateValue();
+ SetValue(MinValueProperty, value);
}
}
{
get
{
- return currentValue;
+ return (float)GetValue(CurrentValueProperty);
}
set
{
- if (value > maxValue || value < minValue)
- {
- return;
- }
- currentValue = value;
- UpdateValue();
+ SetValue(CurrentValueProperty, value);
}
}
{
get
{
- return bufferValue;
+ return (float)GetValue(BufferValueProperty);
}
set
{
- if (value > maxValue || value < minValue)
- {
- return;
- }
- bufferValue = value;
- UpdateValue();
+ SetValue(BufferValueProperty, value);
}
}
{
get
{
- return state;
+ return (ProgressStatusType)GetValue(ProgressStateProperty);
}
set
{
- state = value;
- UpdateStates();
+ SetValue(ProgressStateProperty, value);
}
}
//Called by User
//Release your own managed resources here.
//You should release all of your own disposable objects here.
- Utility.Dispose(trackObj);
- Utility.Dispose(progressObj);
- Utility.Dispose(bufferObj);
- Utility.Dispose(loadingObj);
+ Utility.Dispose(trackImage);
+ Utility.Dispose(progressImage);
+ Utility.Dispose(bufferImage);
}
- //Release your own unmanaged resources here.
- //You should not access any managed member here except static instance.
- //because the execution order of Finalizes is non-deterministic.
- //Unreference this from if a static instance refer to this.
-
//You must call base.Dispose(type) just before exit.
base.Dispose(type);
}
/// <summary>
- /// The method to update Attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
- {
- ApplyAttributes(this, progressAttrs);
- ApplyAttributes(trackObj, progressAttrs.TrackImageAttributes);
- ApplyAttributes(progressObj, progressAttrs.ProgressImageAttributes);
- ApplyAttributes(loadingObj, progressAttrs.LoadingImageAttributes);
- ApplyAttributes(bufferObj, progressAttrs.BufferImageAttributes);
- }
-
- /// <summary>
/// Theme change callback when theme is changed, this callback will be trigger.
/// </summary>
/// <param name="sender">serder object</param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- ProgressAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as ProgressAttributes;
- if (null != tempAttributes)
+ ProgressStyle tempStyle = StyleManager.Instance.GetAttributes(style) as ProgressStyle;
+ if (null != tempStyle)
{
- attributes = progressAttrs = tempAttributes;
+ Style.CopyFrom(tempStyle);
RelayoutRequest();
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void UpdateValue()
{
- if (null == trackObj || null == progressObj)
+ if (null == trackImage || null == progressImage)
{
return;
}
float height = this.SizeHeight;
float progressRatio = (float)(currentValue - minValue) / (float)(maxValue - minValue);
float progressWidth = width * progressRatio;
- progressObj.Size2D = new Size2D((int)(progressWidth + round), (int)height); //Add const round to reach Math.Round function.
- if (null != bufferObj)
+ progressImage.Size2D = new Size2D((int)(progressWidth + round), (int)height); //Add const round to reach Math.Round function.
+ if (null != bufferImage)
{
if (bufferValue < minValue || bufferValue > maxValue)
{
float bufferRatio = (float)(bufferValue - minValue) / (float)(maxValue - minValue);
float bufferWidth = width * bufferRatio;
- bufferObj.Size2D = new Size2D((int)(bufferWidth + round), (int)height); //Add const round to reach Math.Round function.
+ bufferImage.Size2D = new Size2D((int)(bufferWidth + round), (int)height); //Add const round to reach Math.Round function.
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new ProgressAttributes();
+ return new ProgressStyle();
}
/// <summary>
{
if (state == ProgressStatusType.Buffering)
{
- bufferObj.Show();
- loadingObj.Hide();
- progressObj.Hide();
+ bufferImage.Show();
+ progressImage.Hide();
}
else if (state == ProgressStatusType.Determinate)
{
- bufferObj.Hide();
- loadingObj.Hide();
- progressObj.Show();
+ bufferImage.Hide();
+ progressImage.Show();
UpdateValue();
}
else
{
- bufferObj.Hide();
- loadingObj.Show();
- progressObj.Hide();
+ bufferImage.Hide();
+ progressImage.Hide();
}
}
private void Initialize()
{
- progressAttrs = attributes as ProgressAttributes;
- if (null == progressAttrs)
- {
- throw new Exception("Progress attribute parse error.");
- }
-
// create necessary components
InitializeTrack();
InitializeBuffer();
InitializeProgress();
- InitializeLoading();
}
private void InitializeTrack()
{
- if (null == trackObj)
+ if (null == trackImage)
{
- trackObj = new ImageView
+ trackImage = new ImageView
{
WidthResizePolicy = ResizePolicyType.FillToParent,
HeightResizePolicy = ResizePolicyType.FillToParent,
PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft
+ ParentOrigin = NUI.ParentOrigin.TopLeft,
+ PivotPoint = NUI.PivotPoint.TopLeft
};
- Add(trackObj);
+ Add(trackImage);
+ trackImage.ApplyStyle(Style.Track);
}
}
private void InitializeProgress()
{
- if (null == progressObj)
+ if (null == progressImage)
{
- progressObj = new ImageView
+ progressImage = new ImageView
{
WidthResizePolicy = ResizePolicyType.FillToParent,
HeightResizePolicy = ResizePolicyType.FillToParent,
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
PivotPoint = Tizen.NUI.PivotPoint.TopLeft
};
- Add(progressObj);
+ Add(progressImage);
+ progressImage.ApplyStyle(Style.Progress);
}
}
private void InitializeBuffer()
{
- if (null == bufferObj)
+ if (null == bufferImage)
{
- bufferObj = new ImageView
+ bufferImage = new ImageView
{
WidthResizePolicy = ResizePolicyType.FillToParent,
HeightResizePolicy = ResizePolicyType.FillToParent,
ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
PivotPoint = Tizen.NUI.PivotPoint.TopLeft
};
- Add(bufferObj);
- }
- }
-
- private void InitializeLoading()
- {
- if (null == loadingObj)
- {
- loadingObj = new ImageView
- {
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft
- };
- Add(loadingObj);
- }
- }
-
- private void CreateTrackImageAttributes()
- {
- if (null == progressAttrs.TrackImageAttributes)
- {
- progressAttrs.TrackImageAttributes = new ImageAttributes();
- }
- }
-
- private void CreateProgressImageAttributes()
- {
- if (null == progressAttrs.ProgressImageAttributes)
- {
- progressAttrs.ProgressImageAttributes = new ImageAttributes();
- }
- }
-
- private void CreateBufferImageAttributes()
- {
- if (null == progressAttrs.BufferImageAttributes)
- {
- progressAttrs.BufferImageAttributes = new ImageAttributes();
+ Add(bufferImage);
+ bufferImage.ApplyStyle(Style.Buffer);
}
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public RadioButton(SelectButtonAttributes attrs) : base(attrs) { }
+ public RadioButton(SelectButtonStyle attrs) : base(attrs) { }
/// <summary>
/// Get RadioButtonGroup to which this selections belong.
/// </summary>
using System;
using Tizen.NUI.BaseComponents;
using System.ComponentModel;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <since_tizen> 6 </since_tizen>
public class ScrollBar : Control
{
- private ScrollBarAttributes scrollBarAttrs;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty DirectionProperty = BindableProperty.Create("Direction", typeof(DirectionType), typeof(ScrollBar), DirectionType.Horizontal, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (ScrollBar)bindable;
+ if (newValue != null)
+ {
+ instance.Style.Direction = (DirectionType?)newValue;
+ instance.UpdateValue();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (ScrollBar)bindable;
+ return instance.Style.Direction;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MaxValueProperty = BindableProperty.Create("MaxValue", typeof(int), typeof(ScrollBar), default(int), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (ScrollBar)bindable;
+ if (newValue != null)
+ {
+ if ((int)newValue >= 0)
+ {
+ instance.maxValue = (int)newValue;
+ instance.UpdateValue();
+ }
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (ScrollBar)bindable;
+ return instance.maxValue;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MinValueProperty = BindableProperty.Create("MinValue", typeof(int), typeof(ScrollBar), default(int), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (ScrollBar)bindable;
+ if (newValue != null)
+ {
+ if ((int)newValue >= 0)
+ {
+ instance.minValue = (int)newValue;
+ instance.UpdateValue();
+ }
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (ScrollBar)bindable;
+ return instance.minValue;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create("CurrentValue", typeof(int), typeof(ScrollBar), default(int), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (ScrollBar)bindable;
+ if (newValue != null)
+ {
+ if ((int)newValue >= 0)
+ {
+ instance.curValue = (int)newValue;
+ instance.UpdateValue();
+ }
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (ScrollBar)bindable;
+ return instance.curValue;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty DurationProperty = BindableProperty.Create("Duration", typeof(uint), typeof(ScrollBar), default(uint), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (ScrollBar)bindable;
+ if (newValue != null)
+ {
+ instance.Style.Duration = (uint)newValue;
+ if (instance.scrollAniPlayer != null)
+ {
+ instance.scrollAniPlayer.Duration = (int)newValue;
+ }
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (ScrollBar)bindable;
+ return instance.Style.Duration;
+ });
+
private ImageView trackImage;
private ImageView thumbImage;
private Animation scrollAniPlayer = null;
private int curValue;
/// <summary>
- /// The constructor of ScrollBar
+ /// The constructor of ScrollBar.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public ScrollBar() : base()
}
/// <summary>
- /// The constructor of ScrollBar with specific Attributes.
+ /// The constructor of ScrollBar with specific style.
/// </summary>
- /// <param name="attributes">The Attributes object to initialize the ScrollBar.</param>
+ /// <param name="style">The style object to initialize the ScrollBar.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public ScrollBar(ScrollBarAttributes attributes) : base(attributes)
+ public ScrollBar(ScrollBarStyle style) : base(style)
{
Initialize();
}
}
#region public property
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new ScrollBarStyle Style => ViewStyle as ScrollBarStyle;
/// <summary>
/// The property to get/set the direction of the ScrollBar.
{
get
{
- return scrollBarAttrs.Direction.Value;
+ return (DirectionType)GetValue(DirectionProperty);
}
set
{
- scrollBarAttrs.Direction = value;
- RelayoutRequest();
+ SetValue(DirectionProperty, value);
}
}
{
get
{
- if (scrollBarAttrs.ThumbImageAttributes.Size == null)
+ if (Style.Thumb.Size == null)
{
- scrollBarAttrs.ThumbImageAttributes.Size = new Size();
+ Style.Thumb.Size = new Size();
}
- return scrollBarAttrs.ThumbImageAttributes.Size;
+ return Style.Thumb.Size;
}
set
{
- if (scrollBarAttrs.ThumbImageAttributes.Size == null)
+ if (Style.Thumb.Size == null)
{
- scrollBarAttrs.ThumbImageAttributes.Size = new Size();
+ Style.Thumb.Size = new Size();
}
if (thumbImage != null)
{
- scrollBarAttrs.ThumbImageAttributes.Size.Width = value.Width;
- scrollBarAttrs.ThumbImageAttributes.Size.Height = value.Height;
+ Style.Thumb.Size.Width = value.Width;
+ Style.Thumb.Size.Height = value.Height;
RelayoutRequest();
}
}
{
get
{
- return scrollBarAttrs.TrackImageAttributes.ResourceURL.All;
+ return Style.Track.ResourceUrl.All;
}
set
{
if (trackImage != null)
{
- if (scrollBarAttrs.TrackImageAttributes.ResourceURL == null)
+ if (Style.Track.ResourceUrl == null)
{
- scrollBarAttrs.TrackImageAttributes.ResourceURL = new StringSelector();
+ Style.Track.ResourceUrl = new StringSelector();
}
- scrollBarAttrs.TrackImageAttributes.ResourceURL.All = value;
+ Style.Track.ResourceUrl.All = value;
}
RelayoutRequest();
}
{
get
{
- return scrollBarAttrs.TrackImageAttributes.BackgroundColor?.All;
+ return Style.Track.BackgroundColor?.All;
}
set
{
- if (scrollBarAttrs.TrackImageAttributes.BackgroundColor == null)
+ if (Style.Track.BackgroundColor == null)
{
- scrollBarAttrs.TrackImageAttributes.BackgroundColor = new ColorSelector { All = value };
+ Style.Track.BackgroundColor = new ColorSelector { All = value };
}
else
{
- scrollBarAttrs.TrackImageAttributes.BackgroundColor.All = value;
+ Style.Track.BackgroundColor.All = value;
}
RelayoutRequest();
}
{
get
{
- return scrollBarAttrs.ThumbImageAttributes.BackgroundColor?.All;
+ return Style.Thumb.BackgroundColor?.All;
}
set
{
- if(scrollBarAttrs.ThumbImageAttributes.BackgroundColor == null)
+ if(Style.Thumb.BackgroundColor == null)
{
- scrollBarAttrs.ThumbImageAttributes.BackgroundColor = new ColorSelector { All = value };
+ Style.Thumb.BackgroundColor = new ColorSelector { All = value };
}
else
{
- scrollBarAttrs.ThumbImageAttributes.BackgroundColor.All = value;
+ Style.Thumb.BackgroundColor.All = value;
}
RelayoutRequest();
}
{
get
{
- return maxValue;
+ return (int)GetValue(MaxValueProperty);
}
set
{
- if(value >= 0)
- {
- maxValue = value;
- RelayoutRequest();
- }
+ SetValue(MaxValueProperty, value);
}
}
{
get
{
- return minValue;
+ return (int)GetValue(MinValueProperty);
}
set
{
- if(value >= 0)
- {
- minValue = value;
- RelayoutRequest();
- }
+ SetValue(MinValueProperty, value);
}
}
{
get
{
- return curValue;
+ return (int)GetValue(CurrentValueProperty);
}
set
{
- if(value >= 0)
- {
- curValue = value;
- RelayoutRequest();
- }
+ SetValue(CurrentValueProperty, value);
}
}
{
get
{
- return scrollBarAttrs.Duration;
+ return (uint)GetValue(DurationProperty);
}
set
{
- scrollBarAttrs.Duration = value;
- if (scrollAniPlayer != null)
- {
- scrollAniPlayer.Duration = (int)value;
- }
+ SetValue(DurationProperty, value);
}
}
#endregion
/// </code>
/// </example>
/// <since_tizen> 6 </since_tizen>
- public void SetCurrentValue(int currentValue, bool EnableAnimation = true)
+ public void SetCurrentValue(int currentValue, bool enableAnimation = true)
{
if (currentValue < minValue || currentValue > maxValue)
{
throw new ArgumentOutOfRangeException("Wrong Current value. It shoud be greater than the Min value, and less than the Max value!");
}
- enableAni = EnableAnimation;
+ enableAni = enableAnimation;
CurrentValue = currentValue;
}
//Release your own managed resources here.
//You should release all of your own disposable objects here.
- if (trackImage != null)
- {
- Utility.Dispose(trackImage);
- }
-
- if (thumbImage != null)
- {
- Utility.Dispose(thumbImage);
- }
+ Utility.Dispose(trackImage);
+ Utility.Dispose(thumbImage);
if (scrollAniPlayer != null)
{
scrollAniPlayer.Dispose();
scrollAniPlayer = null;
}
- // UIDirectionChangedEvent -= OnUIDirectionChangedEvent;
}
//Release your own unmanaged resources here.
}
/// <summary>
- /// The method to update Attributes.
+ /// Get Scrollbar style.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
+ protected override ViewStyle GetViewStyle()
{
- ApplyAttributes(this, scrollBarAttrs);
- ApplyAttributes(trackImage, scrollBarAttrs.TrackImageAttributes);
- ApplyAttributes(thumbImage, scrollBarAttrs.ThumbImageAttributes);
- if (enableAni)
- {
- UpdateValue(true);
- enableAni = false;
- }
- else
- {
- UpdateValue();
- }
- }
-
- /// <summary>
- /// Get Scrollbar attribues.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
- {
- return new ScrollBarAttributes()
- {
- ThumbImageAttributes = new ImageAttributes
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed,
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft
- },
- TrackImageAttributes = new ImageAttributes
- {
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft
- }
-
- };
+ return new ScrollBarStyle();
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- ScrollBarAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as ScrollBarAttributes;
- if (tempAttributes != null)
+ ScrollBarStyle tempStyle = StyleManager.Instance.GetAttributes(style) as ScrollBarStyle;
+ if (tempStyle != null)
{
- attributes = scrollBarAttrs = tempAttributes;
- RelayoutRequest();
+ Style.CopyFrom(tempStyle);
+ UpdateValue();
}
}
private void Initialize()
{
- scrollBarAttrs = this.attributes as ScrollBarAttributes;
- if(scrollBarAttrs == null)
- {
- throw new Exception("ScrollBar attribute parse error.");
- }
-
this.Focusable = false;
trackImage = new ImageView
WidthResizePolicy = ResizePolicyType.FillToParent,
HeightResizePolicy = ResizePolicyType.FillToParent,
PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft
-
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft
};
+ this.Add(trackImage);
+ trackImage.ApplyStyle(Style.Track);
+
thumbImage = new ImageView
{
Focusable = false,
WidthResizePolicy = ResizePolicyType.Fixed,
HeightResizePolicy = ResizePolicyType.Fixed,
PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft
+ ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.CenterLeft
};
-
- Add(trackImage);
- Add(thumbImage);
+ this.Add(thumbImage);
+ thumbImage.ApplyStyle(Style.Thumb);
scrollAniPlayer = new Animation(334);
scrollAniPlayer.DefaultAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear);
RelayoutRequest();
}
- private void UpdateValue(bool enableAni = false)
+ private void UpdateValue()
{
- if (trackImage == null || thumbImage == null || scrollBarAttrs.Direction == null)
- {
- return;
- }
+ if (minValue >= maxValue || curValue < minValue || curValue > maxValue) return;
- if (minValue >= maxValue || curValue < minValue || curValue > maxValue)
- {
- return;
- }
float width = (float)Size2D.Width;
float height = (float)Size2D.Height;
float thumbW = 0.0f;
float thumbH = 0.0f;
- if (scrollBarAttrs.ThumbImageAttributes.Size == null)
+ if (Style.Thumb.Size == null)
{
return;
}
else
{
- thumbW = scrollBarAttrs.ThumbImageAttributes.Size.Width;
- thumbH = scrollBarAttrs.ThumbImageAttributes.Size.Height;
+ thumbW = Style.Thumb.Size.Width;
+ thumbH = Style.Thumb.Size.Height;
}
float ratio = (float)(curValue - minValue) / (float)(maxValue - minValue);
- if (scrollBarAttrs.Direction == DirectionType.Horizontal)
+ if (Style.Direction == DirectionType.Horizontal)
{
if (LayoutDirection == ViewLayoutDirectionType.RTL)
{
float posY = (height - thumbH) / 2.0f;
thumbImagePosX = posX;
- if (scrollAniPlayer != null)
+ if (null != scrollAniPlayer)
{
scrollAniPlayer.Stop();
}
}
else
{
- if (scrollAniPlayer != null)
+ if (null != scrollAniPlayer)
{
scrollAniPlayer.Clear();
scrollAniPlayer.AnimateTo(thumbImage, "PositionX", posX);
float posY = ratio * (height - thumbH);
thumbImagePosY = posY;
- if (scrollAniPlayer != null)
+ if (null != scrollAniPlayer)
{
scrollAniPlayer.Stop();
}
}
else
{
- if (scrollAniPlayer != null)
+ if (null != scrollAniPlayer)
{
scrollAniPlayer.Clear();
scrollAniPlayer.AnimateTo(thumbImage, "PositionY", posY);
}
}
}
+
+ if (enableAni) enableAni = false;
}
private DirectionType CurrentDirection()
{
DirectionType dir = DirectionType.Horizontal;
- if (scrollBarAttrs != null)
+ if (null != Style.Direction)
{
- if (scrollBarAttrs.Direction != null)
- {
- dir = scrollBarAttrs.Direction.Value;
- }
+ dir = Style.Direction.Value;
}
return dir;
}
}
}
- return (int)curValue;
+ return curValue;
}
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected SelectGroup itemGroup = null;
- private ImageView checkShadowImage;
- private ImageView checkBackgroundImage;
- private ImageView checkImage;
+ private ImageControl selectableImage;
- private SelectButtonAttributes selectButtonAttributes;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new SelectButtonStyle Style => ViewStyle as SelectButtonStyle;
/// <summary>
/// Creates a new instance of a SelectButton.
{
Initialize();
}
+
/// <summary>
/// Creates a new instance of a SelectButton with style.
/// </summary>
}
/// <summary>
- /// Creates a new instance of a SelectButton with attributes.
+ /// Creates a new instance of a SelectButton with style.
/// </summary>
- /// <param name="attributes">Create SelectButton by attributes customized by user.</param>
+ /// <param name="style">Create SelectButton by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public SelectButton(SelectButtonAttributes attributes) : base(attributes)
+ public SelectButton(SelectButtonStyle style) : base(style)
{
Initialize();
}
}
/// <summary>
- /// Check image's resource url in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string CheckImageURL
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.ResourceURL?.All;
- }
- set
- {
- if (value != null)
- {
- CreateCheckImageAttributes();
- if (selectButtonAttributes.CheckImageAttributes.ResourceURL == null)
- {
- selectButtonAttributes.CheckImageAttributes.ResourceURL = new StringSelector();
- }
- selectButtonAttributes.CheckImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// Check image's resource url selector in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector CheckImageURLSelector
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.ResourceURL;
- }
- set
- {
- if (value != null)
- {
- CreateCheckImageAttributes();
- selectButtonAttributes.CheckImageAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// Check image's opacity in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float CheckImageOpacity
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.Opacity?.All ?? 0;
- }
- set
- {
- CreateCheckImageAttributes();
- if (selectButtonAttributes.CheckImageAttributes.Opacity == null)
- {
- selectButtonAttributes.CheckImageAttributes.Opacity = new FloatSelector();
- }
- selectButtonAttributes.CheckImageAttributes.Opacity.All = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Check image's opacity selector in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public FloatSelector CheckImageOpacitySelector
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.Opacity;
- }
- set
- {
- if (value != null)
- {
- CreateCheckImageAttributes();
- selectButtonAttributes.CheckImageAttributes.Opacity = value.Clone() as FloatSelector;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// Check image's size in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public Size CheckImageSize
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.Size ?? new Size(0, 0, 0);
- }
- set
- {
- CreateCheckImageAttributes();
- selectButtonAttributes.CheckImageAttributes.Size = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Background image's resource url in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string CheckBackgroundImageURL
- {
- get
- {
- return selectButtonAttributes?.CheckBackgroundImageAttributes?.ResourceURL?.All;
- }
- set
- {
- if (value != null)
- {
- CreateCheckBackgroundImageAttributes();
- if (selectButtonAttributes.CheckBackgroundImageAttributes.ResourceURL == null)
- {
- selectButtonAttributes.CheckBackgroundImageAttributes.ResourceURL = new StringSelector();
- }
- selectButtonAttributes.CheckBackgroundImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// Background image's resource url selector in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector CheckBackgroundImageURLSelector
- {
- get
- {
- return selectButtonAttributes?.CheckBackgroundImageAttributes?.ResourceURL;
- }
- set
- {
- if (value != null)
- {
- CreateCheckBackgroundImageAttributes();
- selectButtonAttributes.CheckBackgroundImageAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// Background image's opacity in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float CheckBackgroundImageOpacity
- {
- get
- {
- return selectButtonAttributes?.CheckBackgroundImageAttributes?.Opacity?.All ?? 0;
- }
- set
- {
- CreateCheckBackgroundImageAttributes();
- if (selectButtonAttributes.CheckBackgroundImageAttributes.Opacity == null)
- {
- selectButtonAttributes.CheckBackgroundImageAttributes.Opacity = new FloatSelector();
- }
- selectButtonAttributes.CheckBackgroundImageAttributes.Opacity.All = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Background image's opacity selector in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public FloatSelector CheckBackgroundImageOpacitySelector
- {
- get
- {
- return selectButtonAttributes?.CheckBackgroundImageAttributes?.Opacity;
- }
- set
- {
- if (value != null)
- {
- CreateCheckBackgroundImageAttributes();
- selectButtonAttributes.CheckBackgroundImageAttributes.Opacity = value.Clone() as FloatSelector;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// Shadow image's resource url in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string CheckShadowImageURL
- {
- get
- {
- return selectButtonAttributes?.CheckShadowImageAttributes?.ResourceURL?.All;
- }
- set
- {
- if (value != null)
- {
- CreateCheckShadowImageAttributes();
- if (selectButtonAttributes.CheckShadowImageAttributes.ResourceURL == null)
- {
- selectButtonAttributes.CheckShadowImageAttributes.ResourceURL = new StringSelector();
- }
- selectButtonAttributes.CheckShadowImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// Shadow image's resource url selector in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector CheckShadowImageURLSelector
- {
- get
- {
- return selectButtonAttributes?.CheckShadowImageAttributes?.ResourceURL;
- }
- set
- {
- if (value != null)
- {
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckShadowImageAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// Shadow image's opacity in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public float CheckShadowImageOpacity
- {
- get
- {
- return selectButtonAttributes?.CheckShadowImageAttributes?.Opacity?.All ?? 0;
- }
- set
- {
- CreateCheckShadowImageAttributes();
- if (selectButtonAttributes.CheckShadowImageAttributes.Opacity == null)
- {
- selectButtonAttributes.CheckShadowImageAttributes.Opacity = new FloatSelector();
- }
- selectButtonAttributes.CheckShadowImageAttributes.Opacity.All = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Shadow image's opacity selector in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public FloatSelector CheckShadowImageOpacitySelector
- {
- get
- {
- return selectButtonAttributes?.CheckShadowImageAttributes?.Opacity;
- }
- set
- {
- if (value != null)
- {
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckShadowImageAttributes.Opacity = value.Clone() as FloatSelector;
- RelayoutRequest();
- }
- }
- }
-
- /// <summary>
- /// CheckImage left padding in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImagePaddingLeft
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.PaddingLeft ?? 0;
- }
- set
- {
- CreateCheckImageAttributes();
- CreateCheckBackgroundImageAttributes();
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckImageAttributes.PaddingLeft = value;
- selectButtonAttributes.CheckBackgroundImageAttributes.PaddingLeft = value;
- selectButtonAttributes.CheckShadowImageAttributes.PaddingLeft = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// CheckImage right padding in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImagePaddingRight
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.PaddingRight ?? 0;
- }
- set
- {
- CreateCheckImageAttributes();
- CreateCheckBackgroundImageAttributes();
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckImageAttributes.PaddingRight = value;
- selectButtonAttributes.CheckBackgroundImageAttributes.PaddingRight = value;
- selectButtonAttributes.CheckShadowImageAttributes.PaddingRight = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// CheckImage top padding in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImagePaddingTop
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.PaddingTop ?? 0;
- }
- set
- {
- CreateCheckImageAttributes();
- CreateCheckBackgroundImageAttributes();
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckImageAttributes.PaddingTop = value;
- selectButtonAttributes.CheckBackgroundImageAttributes.PaddingTop = value;
- selectButtonAttributes.CheckShadowImageAttributes.PaddingTop = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// CheckImage bottom padding in SelectButton.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int CheckImagePaddingBottom
- {
- get
- {
- return selectButtonAttributes?.CheckImageAttributes?.PaddingBottom ?? 0;
- }
- set
- {
- CreateCheckImageAttributes();
- CreateCheckBackgroundImageAttributes();
- CreateCheckShadowImageAttributes();
- selectButtonAttributes.CheckImageAttributes.PaddingBottom = value;
- selectButtonAttributes.CheckBackgroundImageAttributes.PaddingBottom = value;
- selectButtonAttributes.CheckShadowImageAttributes.PaddingBottom = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
/// Theme change callback when theme is changed, this callback will be trigger.
/// </summary>
/// <since_tizen> 6 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- SelectButtonAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as SelectButtonAttributes;
+ SelectButtonStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as SelectButtonStyle;
if (tempAttributes != null)
{
- attributes = selectButtonAttributes = tempAttributes;
- RelayoutRequest();
+ Style.CopyFrom(tempAttributes);
+ UpdateUIContent();
}
}
if (type == DisposeTypes.Explicit)
{
- if (checkShadowImage != null)
- {
- Remove(checkShadowImage);
- checkShadowImage.Dispose();
- checkShadowImage = null;
- }
- if (checkBackgroundImage != null)
- {
- Remove(checkBackgroundImage);
- checkBackgroundImage.Dispose();
- checkBackgroundImage = null;
- }
- if (checkImage != null)
+ if (selectableImage != null)
{
- Remove(checkImage);
- checkImage.Dispose();
- checkImage = null;
+ Remove(selectableImage);
+ selectableImage.Dispose();
+ selectableImage = null;
}
}
base.Dispose(type);
}
- /// <summary>
- /// Update SelectButton by attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
+ private void UpdateUIContent()
{
- if (selectButtonAttributes.CheckImageAttributes != null)
- {
- if (checkImage == null)
- {
- checkImage = new ImageView();
- checkImage.Name = "CheckImage";
- Add(checkImage);
- }
- ApplyAttributes(checkImage, selectButtonAttributes.CheckImageAttributes);
- }
- else
- {
- if (checkImage != null)
- {
- Remove(checkImage);
- checkImage.Dispose();
- checkImage = null;
- }
- }
-
- if (selectButtonAttributes.CheckShadowImageAttributes != null)
- {
- if (checkShadowImage == null)
- {
- checkShadowImage = new ImageView();
- checkShadowImage.Name = "CheckShadowImage";
- Add(checkShadowImage);
- }
- ApplyAttributes(checkShadowImage, selectButtonAttributes.CheckShadowImageAttributes);
- }
- else
- {
- if (checkShadowImage != null)
- {
- Remove(checkShadowImage);
- checkShadowImage.Dispose();
- checkShadowImage = null;
- }
- }
-
- if (selectButtonAttributes.CheckBackgroundImageAttributes != null)
- {
- if (checkBackgroundImage == null)
- {
- checkBackgroundImage = new ImageView();
- checkBackgroundImage.Name = "CheckBackgroundImage";
- Add(checkBackgroundImage);
- }
- ApplyAttributes(checkBackgroundImage, selectButtonAttributes.CheckBackgroundImageAttributes);
- }
- else
- {
- if (checkBackgroundImage != null)
- {
- Remove(checkBackgroundImage);
- checkBackgroundImage.Dispose();
- checkBackgroundImage = null;
- }
- }
-
UpdateTextAttributes();
base.OnUpdate();
- checkShadowImage?.RaiseToTop();
- checkBackgroundImage?.RaiseToTop();
- checkImage?.RaiseToTop();
+ selectableImage?.RaiseToTop();
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool OnTouch(Touch touch)
{
- if (IsEnabled == false)
+ if (false == IsEnabled)
{
return false;
}
+
PointStateType state = touch.GetState(0);
bool ret = base.OnTouch(touch);
switch (state)
return ret;
}
+ /// 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 void ApplyStyle(ViewStyle viewStyle)
+ {
+ base.ApplyStyle(viewStyle);
+
+ SelectButtonStyle selectButtonStyle = viewStyle as SelectButtonStyle;
+
+ if (null != selectButtonStyle)
+ {
+ if (selectableImage == null)
+ {
+ selectableImage = new ImageControl();
+ selectableImage.Name = "SelectableImage";
+ Add(selectableImage);
+
+ selectableImage.RaiseToTop();
+ }
+
+ selectableImage.ApplyStyle(selectButtonStyle.SelectableImage);
+ }
+ }
+
/// <summary>
/// Get SelectButton attribues.
/// </summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new SelectButtonAttributes();
+ return new SelectButtonStyle();
}
/// <summary>
private void Initialize()
{
- selectButtonAttributes = attributes as SelectButtonAttributes;
- if (selectButtonAttributes == null)
+ if (selectableImage == null)
{
- throw new Exception("SelectButton attribute parse error.");
+ selectableImage = new ImageControl();
+ selectableImage.Name = "SelectableImage";
+ Add(selectableImage);
+
+ selectableImage.RaiseToTop();
}
- selectButtonAttributes.IsSelectable = true;
+ Style.SelectableImage.PositionUsesPivotPoint = true;
+ Style.SelectableImage.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft;
+ Style.SelectableImage.PivotPoint = Tizen.NUI.PivotPoint.TopLeft;
+
+ Style.IsSelectable = true;
LayoutDirectionChanged += SelectButtonLayoutDirectionChanged;
}
private void UpdateTextAttributes()
{
- if (selectButtonAttributes.TextAttributes != null)
+ if (Style.Text != null)
{
- selectButtonAttributes.TextAttributes.PositionUsesPivotPoint = true;
- selectButtonAttributes.TextAttributes.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft;
- selectButtonAttributes.TextAttributes.PivotPoint = Tizen.NUI.PivotPoint.TopLeft;
- selectButtonAttributes.TextAttributes.WidthResizePolicy = ResizePolicyType.Fixed;
- selectButtonAttributes.TextAttributes.HeightResizePolicy = ResizePolicyType.Fixed;
+ Style.Text.PositionUsesPivotPoint = true;
+ Style.Text.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft;
+ Style.Text.PivotPoint = Tizen.NUI.PivotPoint.TopLeft;
+ Style.Text.WidthResizePolicy = ResizePolicyType.Fixed;
+ Style.Text.HeightResizePolicy = ResizePolicyType.Fixed;
- int iconWidth = (int)CheckImageSize.Width;
+ int iconWidth = (int)selectableImage.SizeWidth;
- int textPaddingLeft = selectButtonAttributes.TextAttributes.PaddingLeft;
- int textPaddingRight = selectButtonAttributes.TextAttributes.PaddingRight;
+ int textPaddingLeft = Style.Text.Padding.Start;
+ int textPaddingRight = Style.Text.Padding.End;
- if(selectButtonAttributes.TextAttributes.Size == null)
+ if(Style.Text.Size == null)
{
- selectButtonAttributes.TextAttributes.Size = new Size(Size2D.Width - iconWidth - CheckImagePaddingLeft - CheckImagePaddingRight - textPaddingLeft - textPaddingRight, Size2D.Height);
+ Style.Text.Size = new Size(Size2D.Width - iconWidth - selectableImage.Padding.Start - selectableImage.Padding.End - textPaddingLeft - textPaddingRight, Size2D.Height);
}
- if(selectButtonAttributes.TextAttributes.Position == null)
+ if(Style.Text.Position == null)
{
- selectButtonAttributes.TextAttributes.Position = new Position(CheckImagePaddingLeft + iconWidth + CheckImagePaddingRight + textPaddingLeft, 0);
+ Style.Text.Position = new Position(selectableImage.Padding.Start + iconWidth + selectableImage.Padding.End + textPaddingLeft, 0);
}
-
- selectButtonAttributes.TextAttributes.VerticalAlignment = VerticalAlignment.Center;
+
+ Style.Text.VerticalAlignment = VerticalAlignment.Center;
}
}
private void SelectButtonLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e)
{
- if (selectButtonAttributes == null || selectButtonAttributes.TextAttributes == null)
+ if (Style == null || Style.Text == null)
{
return;
}
UpdateTextAttributes();
- int iconWidth = (int)CheckImageSize.Width;
+ int iconWidth = (int)selectableImage.SizeWidth;
- int textPaddingLeft = selectButtonAttributes.TextAttributes.PaddingLeft;
- int textPaddingRight = selectButtonAttributes.TextAttributes.PaddingRight;
+ int textPaddingLeft = Style.Text.Padding.Start;
+ int textPaddingRight = Style.Text.Padding.End;
int pos = 0;
if (LayoutDirection == ViewLayoutDirectionType.RTL)
{
- selectButtonAttributes.TextAttributes.HorizontalAlignment = HorizontalAlignment.End;
- selectButtonAttributes.TextAttributes.Position.X = textPaddingRight;
- pos = (int)(selectButtonAttributes.TextAttributes.Size.Width) + textPaddingLeft + textPaddingRight;
- if (IconPadding != null)
+ Style.Text.HorizontalAlignment = HorizontalAlignment.End;
+ Style.Text.Position.X = textPaddingRight;
+ pos = (int)(Style.Text.Size.Width) + textPaddingLeft + textPaddingRight;
+ if (Style.Icon.Padding != null)
{
- pos += IconPadding.End;
+ pos += Style.Icon.Padding.End;
}
}
else if (LayoutDirection == ViewLayoutDirectionType.LTR)
{
- selectButtonAttributes.TextAttributes.HorizontalAlignment = HorizontalAlignment.Begin;
- selectButtonAttributes.TextAttributes.Position.X = iconWidth + textPaddingLeft;
- if (IconPadding != null)
+ Style.Text.HorizontalAlignment = HorizontalAlignment.Begin;
+ Style.Text.Position.X = iconWidth + textPaddingLeft;
+ if (Style.Icon.Padding != null)
{
- selectButtonAttributes.TextAttributes.Position.X += (IconPadding.Start + IconPadding.End);
- pos = IconPadding.Start;
+ Style.Text.Position.X += (Style.Icon.Padding.Start + Style.Icon.Padding.End);
+ pos = Style.Icon.Padding.Start;
}
}
-
- checkShadowImage.Position2D.X = checkBackgroundImage.Position2D.X = checkImage.Position2D.X = pos;
+ selectableImage.Position2D.X = pos;
}
private void OnSelect()
}
}
- private void CreateCheckImageAttributes()
- {
- if (selectButtonAttributes.CheckImageAttributes == null)
- {
- selectButtonAttributes.CheckImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- };
- }
- }
-
- private void CreateCheckBackgroundImageAttributes()
- {
- if (selectButtonAttributes.CheckBackgroundImageAttributes == null)
- {
- selectButtonAttributes.CheckBackgroundImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- };
- }
- }
-
- private void CreateCheckShadowImageAttributes()
- {
- if (selectButtonAttributes.CheckShadowImageAttributes == null)
- {
- selectButtonAttributes.CheckShadowImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- };
- }
- }
-
/// <summary>
/// SelectEventArgs is a class to record item selected arguments which will sent to user.
/// </summary>
using System;
using Tizen.NUI.BaseComponents;
using System.ComponentModel;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
private TextLabel lowIndicatorText = null;
// the high indicator text object
private TextLabel highIndicatorText = null;
- // the attributes of the slider
- private SliderAttributes sliderAttrs = null;
// the direction type
private DirectionType direction = DirectionType.Horizontal;
// the indicator type
// the track thickness value
private uint? trackThickness = null;
// the value of the space between track and indicator object
- private uint? spaceBetweenTrackAndIndicator = null;
-
+ private Extents _spaceBetweenTrackAndIndicator = null;
+ private Extents spaceBetweenTrackAndIndicator
+ {
+ get
+ {
+ if (null == _spaceBetweenTrackAndIndicator)
+ {
+ _spaceBetweenTrackAndIndicator = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ Extents extents = new Extents(start, end, top, bottom);
+ _spaceBetweenTrackAndIndicator.CopyFrom(extents);
+ }, 0, 0, 0, 0);
+ }
+
+ return _spaceBetweenTrackAndIndicator;
+ }
+ }
+
+
private PanGestureDetector panGestureDetector = null;
private float currentSlidedOffset;
private EventHandler<ValueChangedArgs> valueChangedHandler;
bool isFocused = false;
bool isPressed = false;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty IndicatorTypeProperty = BindableProperty.Create("IndicatorType", typeof(IndicatorType), typeof(Slider), IndicatorType.None, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Slider)bindable;
+ if (newValue != null)
+ {
+ instance.privateIndicatorType = (IndicatorType)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Slider)bindable;
+ return instance.privateIndicatorType;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SpaceBetweenTrackAndIndicatorProperty = BindableProperty.Create("SpaceBetweenTrackAndIndicator", typeof(uint), typeof(Slider), (uint)0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Slider)bindable;
+ if (newValue != null)
+ {
+ instance.privateSpaceBetweenTrackAndIndicator = (uint)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Slider)bindable;
+ return instance.privateSpaceBetweenTrackAndIndicator;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TrackThicknessProperty = BindableProperty.Create("TrackThickness", typeof(uint), typeof(Slider), (uint)0, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Slider)bindable;
+ if (newValue != null)
+ {
+ instance.privateTrackThickness = (uint)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Slider)bindable;
+ return instance.privateTrackThickness;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TrackPaddingProperty = BindableProperty.Create("TrackPadding", typeof(Extents), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Slider)bindable;
+ if (newValue != null)
+ {
+ instance.privateTrackPadding.CopyFrom((Extents)newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Slider)bindable;
+ return instance.privateTrackPadding;
+ });
+
/// <summary>
/// The constructor of the Slider class.
/// </summary>
}
/// <summary>
- /// The constructor of the Slider class with specific Attributes.
+ /// The constructor of the Slider class with specific style.
/// </summary>
- /// <param name="attributes">The Attributes object to initialize the Slider</param>
+ /// <param name="style">The style object to initialize the Slider</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Slider(SliderAttributes attributes) : base(attributes)
+ public Slider(SliderStyle style) : base(style)
{
Initialize();
}
Text
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new SliderStyle Style => ViewStyle as SliderStyle;
+
/// <summary>
/// Gets or sets the direction type of slider.
/// </summary>
{
get
{
+ return (IndicatorType)GetValue(IndicatorTypeProperty);
+ }
+ set
+ {
+ SetValue(IndicatorTypeProperty, value);
+ }
+ }
+ private IndicatorType privateIndicatorType
+ {
+ get
+ {
return indicatorType;
}
set
{
get
{
- return sliderAttrs.ThumbAttributes?.Size;
+ return Style.Thumb?.Size;
}
set
{
- CreateThumbAttributes();
- sliderAttrs.ThumbAttributes.Size = value;
- RelayoutRequest();
- }
- }
-
- /// <summary>
- /// Gets or sets the resource url selector of the thumb image background object.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StringSelector ThumbImageBackgroundURLSelector
- {
- get
- {
- return sliderAttrs.ThumbBackgroundAttributes?.ResourceURL;
- }
- set
- {
- CreateThumbBackgroundAttributes();
- if (value != null)
- {
- sliderAttrs.ThumbBackgroundAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
- }
+ Style.Thumb.Size = value;
}
}
{
get
{
- return sliderAttrs.ThumbAttributes?.ResourceURL?.All;
+ return Style.Thumb?.ResourceUrl?.All;
}
set
{
- CreateThumbAttributes();
- if (sliderAttrs.ThumbAttributes.ResourceURL == null)
+ if (Style.Thumb.ResourceUrl == null)
{
- sliderAttrs.ThumbAttributes.ResourceURL = new StringSelector();
+ Style.Thumb.ResourceUrl = new StringSelector();
}
- sliderAttrs.ThumbAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.Thumb.ResourceUrl.All = value;
}
}
{
get
{
- return sliderAttrs.ThumbAttributes?.ResourceURL;
+ return (StringSelector)Style.Thumb?.ResourceUrl;
}
set
{
- CreateThumbAttributes();
if (value != null)
{
- sliderAttrs.ThumbAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
+ Style.Thumb.ResourceUrl = value.Clone() as StringSelector;
}
}
}
{
get
{
- return sliderAttrs.BackgroundTrackAttributes?.BackgroundColor?.All;
+ return Style.Track?.BackgroundColor?.All;
}
set
{
- CreateBackgroundTrackAttributes();
- if (sliderAttrs.BackgroundTrackAttributes.BackgroundColor == null)
+ if (Style.Track.BackgroundColor == null)
{
- sliderAttrs.BackgroundTrackAttributes.BackgroundColor = new ColorSelector();
+ Style.Track.BackgroundColor = new ColorSelector();
}
- sliderAttrs.BackgroundTrackAttributes.BackgroundColor.All = value;
- RelayoutRequest();
+ Style.Track.BackgroundColor.All = value;
}
}
{
get
{
- return sliderAttrs.SlidedTrackAttributes?.BackgroundColor?.All;
+ return Style.Progress?.BackgroundColor?.All;
}
set
{
- CreateSlidedTrackAttributes();
- if (sliderAttrs.SlidedTrackAttributes.BackgroundColor == null)
+ if (Style.Progress.BackgroundColor == null)
{
- sliderAttrs.SlidedTrackAttributes.BackgroundColor = new ColorSelector();
+ Style.Progress.BackgroundColor = new ColorSelector();
}
- sliderAttrs.SlidedTrackAttributes.BackgroundColor.All = value;
- RelayoutRequest();
+ Style.Progress.BackgroundColor.All = value;
}
}
{
get
{
+ return (uint)GetValue(TrackThicknessProperty);
+ }
+ set
+ {
+ SetValue(TrackThicknessProperty, value);
+ }
+ }
+ private uint privateTrackThickness
+ {
+ get
+ {
return trackThickness ?? 0;
}
set
{
get
{
- return sliderAttrs.LowIndicatorImageAttributes?.ResourceURL?.All;
+ return Style.LowIndicatorImage?.ResourceUrl?.All;
}
set
{
- CreateLowIndicatorImageAttributes();
- if (sliderAttrs.LowIndicatorImageAttributes.ResourceURL == null)
+ if (Style.LowIndicatorImage.ResourceUrl == null)
{
- sliderAttrs.LowIndicatorImageAttributes.ResourceURL = new StringSelector();
+ Style.LowIndicatorImage.ResourceUrl = new StringSelector();
}
- sliderAttrs.LowIndicatorImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.LowIndicatorImage.ResourceUrl.All = value;
}
}
{
get
{
- return sliderAttrs.HighIndicatorImageAttributes?.ResourceURL?.All;
+ return Style.HighIndicatorImage?.ResourceUrl?.All;
}
set
{
- CreateHighIndicatorImageAttributes();
- if (sliderAttrs.HighIndicatorImageAttributes.ResourceURL == null)
+ if (Style.HighIndicatorImage.ResourceUrl == null)
{
- sliderAttrs.HighIndicatorImageAttributes.ResourceURL = new StringSelector();
+ Style.HighIndicatorImage.ResourceUrl = new StringSelector();
}
- sliderAttrs.HighIndicatorImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.HighIndicatorImage.ResourceUrl.All = value;
}
}
{
get
{
- return sliderAttrs.LowIndicatorTextAttributes?.Text?.All;
+ return Style.LowIndicator?.Text?.All;
}
set
{
- CreateLowIndicatorTextAttributes();
- if (sliderAttrs.LowIndicatorTextAttributes.Text == null)
+ if (Style.LowIndicator.Text == null)
{
- sliderAttrs.LowIndicatorTextAttributes.Text = new StringSelector();
+ Style.LowIndicator.Text = new StringSelector();
}
- sliderAttrs.LowIndicatorTextAttributes.Text.All = value;
- RelayoutRequest();
+ Style.LowIndicator.Text.All = value;
}
}
{
get
{
- return sliderAttrs.HighIndicatorTextAttributes?.Text?.All;
+ return Style.HighIndicator?.Text?.All;
}
set
{
- CreateHighIndicatorTextAttributes();
- if (sliderAttrs.HighIndicatorTextAttributes.Text == null)
+ if (Style.HighIndicator.Text == null)
{
- sliderAttrs.HighIndicatorTextAttributes.Text = new StringSelector();
+ Style.HighIndicator.Text = new StringSelector();
}
- sliderAttrs.HighIndicatorTextAttributes.Text.All = value;
- RelayoutRequest();
+ Style.HighIndicator.Text.All = value;
}
}
{
get
{
- return highIndicatorSize;
+ return Style.HighIndicator.Size;
}
set
{
- highIndicatorSize = value;
- UpdateHighIndicatorSize();
- UpdateBgTrackSize();
- UpdateBgTrackPosition();
- UpdateValue();
+ Style.HighIndicator.Size = value;
}
}
{
get
{
- return spaceBetweenTrackAndIndicator.Value;
+ return (uint)GetValue(SpaceBetweenTrackAndIndicatorProperty);
}
set
{
- spaceBetweenTrackAndIndicator = value;
+ SetValue(SpaceBetweenTrackAndIndicatorProperty, value);
+ }
+ }
+ private uint privateSpaceBetweenTrackAndIndicator
+ {
+ get
+ {
+ return TrackPadding.Start;
+ }
+ set
+ {
+ ushort val = (ushort)value;
+ TrackPadding = new Extents(val, val, val, val);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the value of the space between track and indicator.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Extents TrackPadding
+ {
+ get
+ {
+ return (Extents)GetValue(TrackPaddingProperty);
+ }
+ set
+ {
+ SetValue(TrackPaddingProperty, value);
+ }
+ }
+ private Extents privateTrackPadding
+ {
+ get
+ {
+ return spaceBetweenTrackAndIndicator;
+ }
+ set
+ {
+ spaceBetweenTrackAndIndicator.CopyFrom(value);
UpdateComponentByIndicatorTypeChanged();
UpdateBgTrackSize();
UpdateBgTrackPosition();
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new SliderAttributes();
+ return new SliderStyle();
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnUpdate()
{
- if (sliderAttrs.BackgroundTrackAttributes != null && bgTrackImage == null)
- {
- bgTrackImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- PositionUsesPivotPoint = true
- };
- this.Add(bgTrackImage);
- bgTrackImage.TouchEvent += OnTouchEventForBgTrack;
- }
- if (sliderAttrs.SlidedTrackAttributes != null && slidedTrackImage == null)
- {
- slidedTrackImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed
- };
- if (bgTrackImage != null)
- {
- bgTrackImage.Add(slidedTrackImage);
- }
- }
- if (sliderAttrs.ThumbBackgroundAttributes != null && bgThumbImage == null)
- {
- bgThumbImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed
- };
- if (slidedTrackImage != null)
- {
- slidedTrackImage.Add(bgThumbImage);
- }
- }
- if (sliderAttrs.ThumbAttributes != null && thumbImage == null)
- {
- thumbImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- ParentOrigin = NUI.ParentOrigin.Center,
- PivotPoint = NUI.PivotPoint.Center,
- PositionUsesPivotPoint = true
- };
- if (bgThumbImage != null)
- {
- bgThumbImage.Add(thumbImage);
- }
- thumbImage.TouchEvent += OnTouchEventForThumb;
-
- panGestureDetector = new PanGestureDetector();
- panGestureDetector.Attach(thumbImage);
- panGestureDetector.Detected += OnPanGestureDetected;
- }
- if (sliderAttrs.LowIndicatorImageAttributes != null && lowIndicatorImage == null)
- {
- lowIndicatorImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed
- };
- this.Add(lowIndicatorImage);
- }
- if (sliderAttrs.HighIndicatorImageAttributes != null && highIndicatorImage == null)
- {
- highIndicatorImage = new ImageView()
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed
- };
- this.Add(highIndicatorImage);
- }
- if (sliderAttrs.LowIndicatorTextAttributes != null && lowIndicatorText == null)
- {
- lowIndicatorText = new TextLabel()
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed
- };
- this.Add(lowIndicatorText);
- }
- if (sliderAttrs.HighIndicatorTextAttributes != null && highIndicatorText == null)
- {
- highIndicatorText = new TextLabel()
- {
- WidthResizePolicy = ResizePolicyType.Fixed,
- HeightResizePolicy = ResizePolicyType.Fixed
- };
- this.Add(highIndicatorText);
- }
-
- ApplyAttributes(bgTrackImage, sliderAttrs.BackgroundTrackAttributes);
- ApplyAttributes(slidedTrackImage, sliderAttrs.SlidedTrackAttributes);
- ApplyAttributes(bgThumbImage, sliderAttrs.ThumbBackgroundAttributes);
- ApplyAttributes(thumbImage, sliderAttrs.ThumbAttributes);
- ApplyAttributes(lowIndicatorImage, sliderAttrs.LowIndicatorImageAttributes);
- ApplyAttributes(highIndicatorImage, sliderAttrs.HighIndicatorImageAttributes);
- ApplyAttributes(lowIndicatorText, sliderAttrs.LowIndicatorTextAttributes);
- ApplyAttributes(highIndicatorText, sliderAttrs.HighIndicatorTextAttributes);
-
RelayoutBaseComponent();
UpdateComponentByIndicatorTypeChanged();
UpdateBgTrackSize();
UpdateBgTrackPosition();
UpdateLowIndicatorSize();
- UpdateHighIndicatorSize();
UpdateValue();
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- SliderAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as SliderAttributes;
+ SliderStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as SliderStyle;
if (tempAttributes != null)
{
- attributes = sliderAttrs = tempAttributes;
+ Style.CopyFrom(tempAttributes);
RelayoutRequest();
}
}
- private void Initialize()
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override void ApplyStyle(ViewStyle viewStyle)
{
- sliderAttrs = attributes as SliderAttributes;
- if (null == sliderAttrs)
+ base.ApplyStyle(viewStyle);
+
+ SliderStyle sliderStyle = viewStyle as SliderStyle;
+
+ if (null != sliderStyle.Progress)
{
- throw new Exception("Fail to get the slider attributes.");
+ CreateSlidedTrackAttributes();
+ }
+
+ if (null != sliderStyle.LowIndicator)
+ {
+ CreateLowIndicatorTextAttributes();
}
- ApplyAttributes(this, sliderAttrs);
+ if (null != sliderStyle.HighIndicator)
+ {
+ CreateHighIndicatorTextAttributes();
+ }
+ if (null != sliderStyle.Track)
+ {
+ CreateBackgroundTrackAttributes();
+ }
+
+ if (null != sliderStyle.Thumb)
+ {
+ CreateThumbAttributes();
+ }
+
+ if (null != sliderStyle.ThumbBackground)
+ {
+ CreateThumbBackgroundAttributes();
+ }
+ }
+
+ private void Initialize()
+ {
currentSlidedOffset = 0;
isFocused = false;
isPressed = false;
private void CreateSlidedTrackAttributes()
{
- if (null == sliderAttrs.SlidedTrackAttributes)
+ if (null == slidedTrackImage)
{
- sliderAttrs.SlidedTrackAttributes = new ImageAttributes();
+ slidedTrackImage = new ImageView()
+ {
+ WidthResizePolicy = ResizePolicyType.Fixed,
+ HeightResizePolicy = ResizePolicyType.Fixed
+ };
+
+ if (bgTrackImage != null)
+ {
+ bgTrackImage.Add(slidedTrackImage);
+ }
+
+ if (null != bgThumbImage)
+ {
+ slidedTrackImage.Add(bgThumbImage);
+ }
}
- }
- private void CreateLowIndicatorImageAttributes()
- {
- if (null == sliderAttrs.LowIndicatorImageAttributes)
+ if (null == Style.Progress)
{
- sliderAttrs.LowIndicatorImageAttributes = new ImageAttributes();
+ Style.Progress = new ImageViewStyle();
}
+
+ slidedTrackImage.ApplyStyle(Style.Progress);
}
private void CreateLowIndicatorTextAttributes()
{
- if (null == sliderAttrs.LowIndicatorTextAttributes)
+ if (null == lowIndicatorText)
{
- sliderAttrs.LowIndicatorTextAttributes = new TextAttributes();
+ lowIndicatorText = new TextLabel()
+ {
+ WidthResizePolicy = ResizePolicyType.Fixed,
+ HeightResizePolicy = ResizePolicyType.Fixed
+ };
+ this.Add(lowIndicatorText);
+ }
+
+ if (null == Style.LowIndicator)
+ {
+ Style.LowIndicator = new TextLabelStyle();
}
+
+ lowIndicatorText.ApplyStyle(Style.LowIndicator);
}
private void CreateHighIndicatorTextAttributes()
{
- if (null == sliderAttrs.HighIndicatorTextAttributes)
+ if (null == highIndicatorText)
{
- sliderAttrs.HighIndicatorTextAttributes = new TextAttributes();
+ highIndicatorText = new TextLabel()
+ {
+ WidthResizePolicy = ResizePolicyType.Fixed,
+ HeightResizePolicy = ResizePolicyType.Fixed
+ };
+ this.Add(highIndicatorText);
}
- }
- private void CreateHighIndicatorImageAttributes()
- {
- if (null == sliderAttrs.HighIndicatorImageAttributes)
+ if (null == Style.HighIndicator)
{
- sliderAttrs.HighIndicatorImageAttributes = new ImageAttributes();
+ Style.HighIndicator = new TextLabelStyle();
}
+
+ highIndicatorText.ApplyStyle(Style.HighIndicator);
}
private void CreateBackgroundTrackAttributes()
{
- if (null == sliderAttrs.BackgroundTrackAttributes)
+ if (null == bgTrackImage)
{
- sliderAttrs.BackgroundTrackAttributes = new ImageAttributes();
+ bgTrackImage = new ImageView()
+ {
+ WidthResizePolicy = ResizePolicyType.Fixed,
+ HeightResizePolicy = ResizePolicyType.Fixed,
+ ParentOrigin = Tizen.NUI.ParentOrigin.Center,
+ PivotPoint = Tizen.NUI.PivotPoint.Center,
+ PositionUsesPivotPoint = true
+ };
+ this.Add(bgTrackImage);
+
+ if (null != slidedTrackImage)
+ {
+ bgTrackImage.Add(slidedTrackImage);
+ }
+
+ bgTrackImage.TouchEvent += OnTouchEventForBgTrack;
}
+
+ if (null == Style.Track)
+ {
+ Style.Track = new ImageViewStyle();
+ }
+
+ bgTrackImage.ApplyStyle(Style.Track);
}
private void CreateThumbAttributes()
{
- if (null == sliderAttrs.ThumbAttributes)
+ if (null == thumbImage)
{
- sliderAttrs.ThumbAttributes = new ImageAttributes();
+ thumbImage = new ImageView()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ ParentOrigin = NUI.ParentOrigin.Center,
+ PivotPoint = NUI.PivotPoint.Center,
+ PositionUsesPivotPoint = true
+ };
+ if (bgThumbImage != null)
+ {
+ bgThumbImage.Add(thumbImage);
+ }
+ thumbImage.TouchEvent += OnTouchEventForThumb;
+
+ panGestureDetector = new PanGestureDetector();
+ panGestureDetector.Attach(thumbImage);
+ panGestureDetector.Detected += OnPanGestureDetected;
}
+
+ if (null == Style.Thumb)
+ {
+ Style.Thumb= new ImageViewStyle();
+ }
+
+ thumbImage.ApplyStyle(Style.Thumb);
}
private void CreateThumbBackgroundAttributes()
{
- if (null == sliderAttrs.ThumbBackgroundAttributes)
+ if (null == bgThumbImage)
+ {
+ bgThumbImage = new ImageView()
+ {
+ WidthResizePolicy = ResizePolicyType.Fixed,
+ HeightResizePolicy = ResizePolicyType.Fixed
+ };
+
+ if (slidedTrackImage != null)
+ {
+ slidedTrackImage.Add(bgThumbImage);
+ }
+
+ if (null != thumbImage)
+ {
+ bgThumbImage.Add(thumbImage);
+ }
+ }
+
+ if (null == Style.ThumbBackground)
{
- sliderAttrs.ThumbBackgroundAttributes = new ImageAttributes();
+ Style.ThumbBackground= new ImageViewStyle();
}
+
+ bgThumbImage.ApplyStyle(Style.ThumbBackground);
}
private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
}
else
{
- if (lowIndicatorImage != null && sliderAttrs != null && sliderAttrs.LowIndicatorImageAttributes != null && sliderAttrs.LowIndicatorImageAttributes.Size != null)
- {
- lowIndicatorImage.Size = sliderAttrs.LowIndicatorImageAttributes.Size;
- }
- if (lowIndicatorText != null && sliderAttrs != null && sliderAttrs.LowIndicatorTextAttributes != null && sliderAttrs.LowIndicatorTextAttributes.Size != null)
- {
- lowIndicatorText.Size = sliderAttrs.LowIndicatorTextAttributes.Size;
- }
- }
- }
-
- private void UpdateHighIndicatorSize()
- {
- if (highIndicatorSize != null)
- {
- if (highIndicatorImage != null)
- {
- highIndicatorImage.Size = highIndicatorSize;
- }
- if (highIndicatorText != null)
- {
- highIndicatorText.Size = highIndicatorSize;
- }
- }
- else
- {
- if (highIndicatorImage != null && sliderAttrs != null && sliderAttrs.HighIndicatorImageAttributes != null && sliderAttrs.HighIndicatorImageAttributes.Size != null)
+ if (lowIndicatorImage != null && Style != null && Style.LowIndicatorImage!= null && Style.LowIndicatorImage.Size != null)
{
- highIndicatorImage.Size = sliderAttrs.HighIndicatorImageAttributes.Size;
+ lowIndicatorImage.Size = Style.LowIndicatorImage.Size;
}
- if (highIndicatorText != null && sliderAttrs != null && sliderAttrs.HighIndicatorTextAttributes != null && sliderAttrs.HighIndicatorTextAttributes.Size != null)
+ if (lowIndicatorText != null && Style != null && Style.LowIndicator!= null && Style.LowIndicator.Size != null)
{
- highIndicatorText.Size = sliderAttrs.HighIndicatorTextAttributes.Size;
+ lowIndicatorText.Size = Style.LowIndicator.Size;
}
}
}
}
else
{
- if (sliderAttrs != null && sliderAttrs.TrackThickness != null)
+ if (Style != null && Style.TrackThickness != null)
{
- curTrackThickness = sliderAttrs.TrackThickness.Value;
+ curTrackThickness = Style.TrackThickness.Value;
}
}
return curTrackThickness;
uint curSpace = 0;
if (spaceBetweenTrackAndIndicator != null)
{
- curSpace = spaceBetweenTrackAndIndicator.Value;
+ curSpace = spaceBetweenTrackAndIndicator.Start;
}
else
{
- if (sliderAttrs != null && sliderAttrs.SpaceBetweenTrackAndIndicator != null)
+ if (Style != null && Style.TrackPadding != null)
{
- curSpace = sliderAttrs.SpaceBetweenTrackAndIndicator.Value;
+ curSpace = Style.TrackPadding.Start;
}
}
return curSpace;
private IndicatorType CurrentIndicatorType()
{
IndicatorType type = IndicatorType.None;
- if (sliderAttrs != null)
+ if (Style != null)
{
- type = sliderAttrs.IndicatorType;
+ type = (IndicatorType)Style.IndicatorType;
}
return type;
}
}
else
{
- if (sliderAttrs != null && sliderAttrs.LowIndicatorImageAttributes != null && sliderAttrs.LowIndicatorImageAttributes.Size != null)
+ if (Style != null && Style.LowIndicatorImage!= null && Style.LowIndicatorImage.Size != null)
{
- size = sliderAttrs.LowIndicatorImageAttributes.Size;
+ size = Style.LowIndicatorImage.Size;
}
}
return size;
}
else
{
- if (sliderAttrs != null && sliderAttrs.HighIndicatorImageAttributes != null && sliderAttrs.HighIndicatorImageAttributes.Size != null)
+ if (Style != null && Style.HighIndicatorImage!= null && Style.HighIndicatorImage.Size != null)
{
- size = sliderAttrs.HighIndicatorImageAttributes.Size;
+ size = Style.HighIndicatorImage.Size;
}
}
return size;
}
else
{
- if (sliderAttrs != null && sliderAttrs.LowIndicatorTextAttributes != null && sliderAttrs.LowIndicatorTextAttributes.Size != null)
+ if (Style != null && Style.LowIndicator!= null && Style.LowIndicator.Size != null)
{
- size = sliderAttrs.LowIndicatorTextAttributes.Size;
+ size = Style.LowIndicator.Size;
}
}
return size;
}
else
{
- if (sliderAttrs != null && sliderAttrs.HighIndicatorTextAttributes != null && sliderAttrs.HighIndicatorTextAttributes.Size != null)
+ if (Style != null && Style.HighIndicator!= null && Style.HighIndicator.Size != null)
{
- size = sliderAttrs.HighIndicatorTextAttributes.Size;
+ size = Style.HighIndicator.Size;
}
}
return size;
{
return;
}
- if (thumbImage == null || sliderAttrs == null)
+ if (thumbImage == null || Style == null)
{
return;
}
if (!isFocused && !isPressed)
{
- State = ControlStates.Normal;
- ApplyAttributes(bgThumbImage, sliderAttrs.ThumbBackgroundAttributes);
- ApplyAttributes(thumbImage, sliderAttrs.ThumbAttributes);
+ ControlState = ControlStates.Normal;
if (stateChangedHandler != null)
{
StateChangedArgs args = new StateChangedArgs();
- args.CurrentState = ControlStates.Normal;
+ args.CurrentState = (ControlStates)ControlStates.Normal;
stateChangedHandler(this, args);
}
}
else if (isPressed)
{
- State = ControlStates.Pressed;
- ApplyAttributes(bgThumbImage, sliderAttrs.ThumbBackgroundAttributes);
- ApplyAttributes(thumbImage, sliderAttrs.ThumbAttributes);
+ ControlState = ControlStates.Pressed;
if (stateChangedHandler != null)
{
StateChangedArgs args = new StateChangedArgs();
- args.CurrentState = ControlStates.Pressed;
+ args.CurrentState = (ControlStates)ControlStates.Pressed;
stateChangedHandler(this, args);
}
}
else if (!isPressed && isFocused)
{
- State = ControlStates.Focused;
- ApplyAttributes(bgThumbImage, sliderAttrs.ThumbBackgroundAttributes);
- ApplyAttributes(thumbImage, sliderAttrs.ThumbAttributes);
+ ControlState = ControlStates.Focused;
if (stateChangedHandler != null)
{
StateChangedArgs args = new StateChangedArgs();
- args.CurrentState = ControlStates.Focused;
+ args.CurrentState = (ControlStates)ControlStates.Focused;
stateChangedHandler(this, args);
}
}
public class Switch : Button
{
private const int aniTime = 100; // will be defined in const file later
- private ImageView switchBackgroundImage;
- private ImageView switchHandlerImage;
+ private ImageView trackImage;
+ private ImageView thumbImage;
private Animation handlerAni = null;
- private SwitchAttributes switchAttributes;
/// <summary>
/// Creates a new instance of a Switch.
}
/// <summary>
- /// Creates a new instance of a Switch with attributes.
+ /// Creates a new instance of a Switch with style.
/// </summary>
- /// <param name="attrs">Create Switch by attributes customized by user.</param>
+ /// <param name="style">Create Switch by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Switch(SwitchAttributes attrs) : base(attrs)
+ public Switch(SwitchStyle style) : base(style)
{
Initialize();
}
/// <since_tizen> 6 </since_tizen>
public event EventHandler<SelectEventArgs> SelectedEvent;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new SwitchStyle Style => ViewStyle as SwitchStyle;
+
/// <summary>
/// Background image's resource url in Switch.
/// </summary>
{
get
{
- return switchAttributes?.SwitchBackgroundImageAttributes?.ResourceURL?.All;
+ return Style.Track?.ResourceUrl?.All;
}
set
{
if (value != null)
{
- CreateSwitchBackgroundImageAttributes();
- if (switchAttributes.SwitchBackgroundImageAttributes.ResourceURL == null)
+ if (Style.Track.ResourceUrl == null)
{
- switchAttributes.SwitchBackgroundImageAttributes.ResourceURL = new StringSelector();
+ Style.Track.ResourceUrl = new StringSelector();
}
- switchAttributes.SwitchBackgroundImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.Track.ResourceUrl.All = value;
}
}
}
{
get
{
- return switchAttributes?.SwitchBackgroundImageAttributes?.ResourceURL;
+ return (StringSelector)Style.Track?.ResourceUrl;
}
set
{
if (value != null)
{
- CreateSwitchBackgroundImageAttributes();
- switchAttributes.SwitchBackgroundImageAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
+ Style.Track.ResourceUrl = value.Clone() as StringSelector;
}
}
}
{
get
{
- return switchAttributes?.SwitchHandlerImageAttributes?.ResourceURL?.All;
+ return Style.Thumb?.ResourceUrl?.All;
}
set
{
if (value != null)
{
- CreateSwitchHandlerImageAttributes();
- if (switchAttributes.SwitchHandlerImageAttributes.ResourceURL == null)
+ if (Style.Thumb.ResourceUrl == null)
{
- switchAttributes.SwitchHandlerImageAttributes.ResourceURL = new StringSelector();
+ Style.Thumb.ResourceUrl = new StringSelector();
}
- switchAttributes.SwitchHandlerImageAttributes.ResourceURL.All = value;
- RelayoutRequest();
+ Style.Thumb.ResourceUrl.All = value;
}
}
}
{
get
{
- return switchAttributes?.SwitchHandlerImageAttributes?.ResourceURL;
+ return (StringSelector)Style.Thumb?.ResourceUrl;
}
set
{
if (value != null)
{
- CreateSwitchHandlerImageAttributes();
- switchAttributes.SwitchHandlerImageAttributes.ResourceURL = value.Clone() as StringSelector;
- RelayoutRequest();
+ Style.Thumb.ResourceUrl = value.Clone() as StringSelector;
}
}
}
{
get
{
- return switchAttributes?.SwitchHandlerImageAttributes?.Size ?? new Size(0, 0);
+ return Style.Thumb?.Size ?? new Size(0, 0);
}
set
{
- CreateSwitchHandlerImageAttributes();
- switchAttributes.SwitchHandlerImageAttributes.Size = value;
- RelayoutRequest();
+ Style.Thumb.Size = value;
}
}
/// <since_tizen> 6 </since_tizen>
protected override void Dispose(DisposeTypes type)
{
- if (disposed)
- {
- return;
- }
+ if (disposed) return;
if (type == DisposeTypes.Explicit)
{
- if (handlerAni != null)
+ if (null != handlerAni)
{
if (handlerAni.State == Animation.States.Playing)
{
handlerAni = null;
}
- if (switchHandlerImage != null)
- {
- Utility.Dispose(switchHandlerImage);
- }
- if (switchBackgroundImage != null)
- {
- Utility.Dispose(switchBackgroundImage);
- }
+ Utility.Dispose(thumbImage);
+ Utility.Dispose(trackImage);
}
base.Dispose(type);
}
/// <summary>
- /// Update Switch by attributes.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
- {
- base.OnUpdate();
-
- if (switchAttributes.SwitchBackgroundImageAttributes != null)
- {
- if (switchBackgroundImage == null)
- {
- switchBackgroundImage = new ImageView()
- {
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- PositionUsesPivotPoint = true,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- };
- switchBackgroundImage.Name = "SwitchBackgroundImage";
- Add(switchBackgroundImage);
- }
- ApplyAttributes(switchBackgroundImage, switchAttributes.SwitchBackgroundImageAttributes);
-
- if (switchAttributes.SwitchHandlerImageAttributes != null)
- {
- if (switchHandlerImage == null)
- {
- switchHandlerImage = new ImageView()
- {
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- PositionUsesPivotPoint = true,
- };
- switchHandlerImage.Name = "SwitchHandlerImage";
- switchBackgroundImage.Add(switchHandlerImage);
- }
- ApplyAttributes(switchHandlerImage, switchAttributes.SwitchHandlerImageAttributes);
- }
- }
- }
-
- /// <summary>
/// Called after a key event is received by the view that has had its focus set.
/// </summary>
/// <param name="key">The key event.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool OnKey(Key key)
{
- if (IsEnabled == false)
- {
- return false;
- }
+ if (!IsEnabled) return false;
+
bool ret = base.OnKey(key);
if (key.State == Key.StateType.Up)
{
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool OnTouch(Touch touch)
{
- if(IsEnabled == false)
- {
- return false;
- }
+ if(!IsEnabled) return false;
+
PointStateType state = touch.GetState(0);
bool ret = base.OnTouch(touch);
switch (state)
/// Get Switch attribues.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new SwitchAttributes();
+ return new SwitchStyle();
}
private void Initialize()
{
- switchAttributes = attributes as SwitchAttributes;
- if (switchAttributes == null)
+ Style.IsSelectable = true;
+ handlerAni = new Animation(aniTime);
+ trackImage = new ImageView()
{
- throw new Exception("Switch attribute parse error.");
- }
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+ PositionUsesPivotPoint = true,
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ Name = "SwitchBackgroundImage",
+ };
+ Add(trackImage);
+ trackImage.ApplyStyle(Style.Track);
- switchAttributes.IsSelectable = true;
- CreateHandlerAnimation();
+ thumbImage = new ImageView()
+ {
+ ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
+ PositionUsesPivotPoint = true,
+ Name = "SwitchHandlerImage",
+ };
+ trackImage.Add(thumbImage);
+ thumbImage.ApplyStyle(Style.Thumb);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- SwitchAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as SwitchAttributes;
- if (tempAttributes != null)
+ SwitchStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as SwitchStyle;
+ if (null != tempAttributes)
{
- attributes = switchAttributes = tempAttributes;
- RelayoutRequest();
- }
- }
-
- private void CreateSwitchBackgroundImageAttributes()
- {
- if (switchAttributes.SwitchBackgroundImageAttributes == null)
- {
- switchAttributes.SwitchBackgroundImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- };
- }
- }
-
- private void CreateSwitchHandlerImageAttributes()
- {
- if (switchAttributes.SwitchHandlerImageAttributes == null)
- {
- switchAttributes.SwitchHandlerImageAttributes = new ImageAttributes()
- {
- PositionUsesPivotPoint = true,
- };
- }
- }
-
- private void CreateHandlerAnimation()
- {
- if (handlerAni == null)
- {
- handlerAni = new Animation(aniTime);
+ Style.CopyFrom(tempAttributes);
}
}
handlerAni.Stop();
}
handlerAni.Clear();
- if (switchHandlerImage != null)
- {
- handlerAni.AnimateTo(switchHandlerImage, "PositionX", Size2D.Width - switchHandlerImage.Size2D.Width - switchHandlerImage.Position2D.X);
- }
- if (switchBackgroundImage != null)
- {
- switchBackgroundImage.Opacity = 0.5f; ///////need defined by UX
- handlerAni.AnimateTo(switchBackgroundImage, "Opacity", 1);
- }
+ handlerAni.AnimateTo(thumbImage, "PositionX", Size2D.Width - thumbImage.Size2D.Width - thumbImage.Position2D.X);
+ trackImage.Opacity = 0.5f; ///////need defined by UX
+ handlerAni.AnimateTo(trackImage, "Opacity", 1);
handlerAni.Play();
if (SelectedEvent != null)
private List<TabItem> itemList = new List<TabItem>();
private int curIndex = 0;
private View underline = null;
- private TabAttributes tabAttributes = null;
private Animation underlineAni = null;
private bool isNeedAnimation = false;
+ private Extents space;
/// <summary>
/// Creates a new instance of a Tab.
}
/// <summary>
- /// Creates a new instance of a Tab with attributes.
+ /// Creates a new instance of a Tab with style.
/// </summary>
- /// <param name="attributes">Create Tab by attributes customized by user.</param>
+ /// <param name="style">Create Tab by style customized by user.</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Tab(TabAttributes attributes) : base(attributes)
+ public Tab(TabStyle style) : base(style)
{
Initialize();
}
/// <since_tizen> 6 </since_tizen>
public event EventHandler<ItemChangedEventArgs> ItemChangedEvent;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new TabStyle Style => ViewStyle as TabStyle;
+
/// <summary>
/// Selected item's index in Tab.
/// </summary>
{
get
{
- return tabAttributes.UseTextNaturalSize;
+ return Style.UseTextNaturalSize;
}
set
{
- tabAttributes.UseTextNaturalSize = value;
+ Style.UseTextNaturalSize = value;
RelayoutRequest();
}
}
{
get
{
- return tabAttributes.ItemSpace;
+ return Style.ItemSpace;
}
set
{
- tabAttributes.ItemSpace = value;
+ Style.ItemSpace = value;
RelayoutRequest();
}
}
{
get
{
- if(null == tabAttributes || null == tabAttributes.Space)
- {
- return null;
- }
- else
- {
- return new Extents((ushort)tabAttributes.Space.X, (ushort)tabAttributes.Space.Y, (ushort)tabAttributes.Space.Z, (ushort)tabAttributes.Space.W);
- }
+ return ItemPadding;
+ }
+ set
+ {
+ ItemPadding = value;
+ }
+ }
+
+ /// <summary>
+ /// Item paddings in Tab. Sequence as Left, Right, Top, Bottom
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Extents ItemPadding
+ {
+ get
+ {
+ return space;
}
set
{
if(null != value)
{
- tabAttributes.Space = new Vector4(value.Start, value.End, value.Top, value.Bottom);
+ Style.ItemPadding.CopyFrom(value);
+
+ if (null == space)
+ {
+ space = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ Style.ItemPadding.Start = start;
+ Style.ItemPadding.End = end;
+ Style.ItemPadding.Top = top;
+ Style.ItemPadding.Bottom = bottom;
+ RelayoutRequest();
+ }, value.Start, value.End, value.Top, value.Bottom);
+ }
+ else
+ {
+ space.CopyFrom(value);
+ }
+
RelayoutRequest();
}
}
{
get
{
- return tabAttributes.UnderLineAttributes?.Size;
+ return Style.UnderLine?.Size;
}
set
{
if (value != null)
{
- CreateUnderLineAttributes();
- tabAttributes.UnderLineAttributes.Size = value;
- RelayoutRequest();
+ //CreateUnderLineAttributes();
+ Style.UnderLine.Size = value;
+ //RelayoutRequest();
}
}
}
{
get
{
- return tabAttributes.UnderLineAttributes?.BackgroundColor?.All;
+ return Style.UnderLine?.BackgroundColor?.All;
}
set
{
if (value != null)
{
- CreateUnderLineAttributes();
- if (tabAttributes.UnderLineAttributes.BackgroundColor == null)
+ //CreateUnderLineAttributes();
+ if (Style.UnderLine.BackgroundColor == null)
{
- tabAttributes.UnderLineAttributes.BackgroundColor = new ColorSelector();
+ Style.UnderLine.BackgroundColor = new ColorSelector();
}
- tabAttributes.UnderLineAttributes.BackgroundColor.All = value;
- RelayoutRequest();
+ Style.UnderLine.BackgroundColor.All = value;
+ //RelayoutRequest();
}
}
}
{
get
{
- return tabAttributes.TextAttributes?.PointSize?.All ?? 0;
+ return Style.Text?.PointSize?.All ?? 0;
}
set
{
- CreateTextAttributes();
- if (tabAttributes.TextAttributes.PointSize == null)
+ //CreateTextAttributes();
+ if (Style.Text.PointSize == null)
{
- tabAttributes.TextAttributes.PointSize = new FloatSelector();
+ Style.Text.PointSize = new FloatSelector();
}
- tabAttributes.TextAttributes.PointSize.All = value;
- RelayoutRequest();
+ Style.Text.PointSize.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return tabAttributes.TextAttributes?.FontFamily;
+ return Style.Text?.FontFamily.All;
}
set
{
- CreateTextAttributes();
- tabAttributes.TextAttributes.FontFamily = value;
- RelayoutRequest();
+ //CreateTextAttributes();
+ Style.Text.FontFamily.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return tabAttributes.TextAttributes?.TextColor?.All;
+ return Style.Text?.TextColor?.All;
}
set
{
- CreateTextAttributes();
- if (tabAttributes.TextAttributes.TextColor == null)
+ //CreateTextAttributes();
+ if (Style.Text.TextColor == null)
{
- tabAttributes.TextAttributes.TextColor = new ColorSelector();
+ Style.Text.TextColor = new ColorSelector();
}
- tabAttributes.TextAttributes.TextColor.All = value;
- RelayoutRequest();
+ Style.Text.TextColor.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return tabAttributes.TextAttributes.TextColor;
+ return (ColorSelector)Style.Text.TextColor;
}
set
{
if (value != null)
{
- CreateTextAttributes();
- tabAttributes.TextAttributes.TextColor = value.Clone() as ColorSelector;
- RelayoutRequest();
+ //CreateTextAttributes();
+ Style.Text.TextColor = value.Clone() as ColorSelector;
+ //RelayoutRequest();
}
}
}
UpdateItems();
}
+ /// 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 void ApplyStyle(ViewStyle viewStyle)
+ {
+ base.ApplyStyle(viewStyle);
+
+ TabStyle tabStyle = viewStyle as TabStyle;
+
+ if (null != tabStyle)
+ {
+ if (null == underline)
+ {
+ underline = new View()
+ {
+ PositionUsesPivotPoint = true,
+ ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
+ PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+ };
+ Add(underline);
+ CreateUnderLineAnimation();
+ }
+
+ underline.ApplyStyle(Style.UnderLine);
+ }
+ }
+
/// <summary>
/// Dispose Tab and all children on it.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnUpdate()
{
- if (tabAttributes.UnderLineAttributes != null)
- {
- if (underline == null)
- {
- underline = new View()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
- PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
- };
- Add(underline);
- CreateUnderLineAnimation();
- }
- ApplyAttributes(underline, tabAttributes.UnderLineAttributes);
- }
-
- if (tabAttributes.TextAttributes != null)
- {
- if (curIndex >= 0 && curIndex < itemList.Count)
- {
- itemList[curIndex].UpdateItemText(tabAttributes.TextAttributes);
- }
- }
-
LayoutChild();
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new TabAttributes();
+ return new TabStyle();
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
{
- TabAttributes tempAttributes = StyleManager.Instance.GetAttributes(style) as TabAttributes;
+ TabStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as TabStyle;
if (tempAttributes != null)
{
- tempAttributes.UseTextNaturalSize = tabAttributes.UseTextNaturalSize; // keep IsNatureTextWidth as original
- attributes = tabAttributes = tempAttributes;
- RelayoutRequest();
+ Style.CopyFrom(tempAttributes);
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void LayoutChild()
{
- if (tabAttributes == null || itemList == null)
+ if (itemList == null)
{
return;
}
+
int totalNum = itemList.Count;
if (totalNum == 0)
{
return;
}
- int preX = (int)tabAttributes.Space.X;
+ int preX = (int)Style.ItemPadding.Start;
int preW = 0;
- int itemSpace = tabAttributes.ItemSpace;
+ int itemSpace = Style.ItemSpace;
if (LayoutDirection == ViewLayoutDirectionType.LTR)
{
- if (tabAttributes.UseTextNaturalSize == true)
+ if (Style.UseTextNaturalSize == true)
{
for (int i = 0; i < totalNum; i++)
{
- preW = (itemList[i].TextItem.NaturalSize2D != null ? itemList[i].TextItem.NaturalSize2D.Width : 0);
+ preW = (itemList[i].NaturalSize2D != null ? itemList[i].NaturalSize2D.Width : 0);
itemList[i].Position2D.X = preX;
itemList[i].Size2D.Width = preW;
preX = itemList[i].Position2D.X + preW + itemSpace;
}
else
{
- preW = (Size2D.Width - (int)tabAttributes.Space.X - (int)tabAttributes.Space.Y) / totalNum;
+ preW = (Size2D.Width - (int)Style.ItemPadding.Start - (int)Style.ItemPadding.End) / totalNum;
for (int i = 0; i < totalNum; i++)
{
itemList[i].Position2D.X = preX;
}
else
{
- preX = (int)tabAttributes.Space.Y;
- if (tabAttributes.UseTextNaturalSize == true)
+ preX = (int)Style.ItemPadding.End;
+ if (Style.UseTextNaturalSize == true)
{
int w = Size2D.Width;
for (int i = 0; i < totalNum; i++)
{
- preW = (itemList[i].TextItem.NaturalSize2D != null ? itemList[i].TextItem.NaturalSize2D.Width : 0);
+ preW = (itemList[i].NaturalSize2D != null ? itemList[i].NaturalSize2D.Width : 0);
itemList[i].Position2D.X = w - preW - preX;
itemList[i].Size2D.Width = preW;
preX = w - itemList[i].Position2D.X + itemSpace;
}
else
{
- preW = (Size2D.Width - (int)tabAttributes.Space.X - (int)tabAttributes.Space.Y) / totalNum;
+ preW = (Size2D.Width - (int)Style.ItemPadding.Start - (int)Style.ItemPadding.End) / totalNum;
for (int i = totalNum - 1; i >= 0; i--)
{
itemList[i].Position2D.X = preX;
private void Initialize()
{
- tabAttributes = attributes as TabAttributes;
- if (tabAttributes == null)
- {
- throw new Exception("Tab attribute parse error.");
- }
-
- ApplyAttributes(this, tabAttributes);
LayoutDirectionChanged += OnLayoutDirectionChanged;
}
private void AddItemByIndex(TabItemData itemData, int index)
{
int h = 0;
- int topSpace = (int)tabAttributes.Space.Z;
- if (tabAttributes.UnderLineAttributes != null && tabAttributes.UnderLineAttributes.Size != null)
+ int topSpace = (int)Style.ItemPadding.Top;
+ if (Style.UnderLine != null && Style.UnderLine.Size != null)
{
- h = (int)tabAttributes.UnderLineAttributes.Size.Height;
+ h = (int)Style.UnderLine.Size.Height;
}
+
Tab.TabItem item = new TabItem();
- ApplyAttributes(item.TextItem, tabAttributes.TextAttributes);
- item.TextItem.Text = itemData.Text;
+ item.TextItem.ApplyStyle(Style.Text);
+
+ item.Text = itemData.Text;
item.Size2D.Height = Size2D.Height - h - topSpace;
item.Position2D.Y = topSpace;
item.TouchEvent += ItemTouchEvent;
Add(item);
- if(index >= itemList.Count)
+ if (index >= itemList.Count)
{
itemList.Add(item);
}
LayoutChild();
if (itemList != null && curIndex >= 0 && curIndex < itemList.Count)
{
- itemList[curIndex].State = ControlStates.Selected;
- itemList[curIndex].UpdateItemText(tabAttributes.TextAttributes);
+ itemList[curIndex].ControlState = ControlStates.Selected;
UpdateUnderLinePos();
}
else
private void CreateUnderLineAttributes()
{
- if (tabAttributes.UnderLineAttributes == null)
+ if (Style.UnderLine == null)
{
- tabAttributes.UnderLineAttributes = new ViewAttributes()
+ Style.UnderLine = new ViewStyle()
{
PositionUsesPivotPoint = true,
ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
}
}
- private void CreateTextAttributes()
- {
- if (tabAttributes.TextAttributes == null)
- {
- tabAttributes.TextAttributes = new TextAttributes()
- {
- PositionUsesPivotPoint = true,
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,
- PivotPoint = Tizen.NUI.PivotPoint.Center,
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent
- };
- }
- }
-
private void CreateUnderLineAnimation()
{
if (underlineAni == null)
private void UpdateUnderLinePos()
{
- if (underline == null || tabAttributes.UnderLineAttributes == null || tabAttributes.UnderLineAttributes.Size == null
+ if (underline == null || Style.UnderLine == null || Style.UnderLine.Size == null
|| itemList == null || itemList.Count <= 0)
{
return;
}
- tabAttributes.UnderLineAttributes.Size.Width = itemList[curIndex].Size2D.Width;
+ Style.UnderLine.Size.Width = itemList[curIndex].Size2D.Width;
- underline.Size2D = new Size2D(itemList[curIndex].Size2D.Width, (int)tabAttributes.UnderLineAttributes.Size.Height);
- underline.BackgroundColor = tabAttributes.UnderLineAttributes.BackgroundColor.All;
+ underline.Size2D = new Size2D(itemList[curIndex].Size2D.Width, (int)Style.UnderLine.Size.Height);
+ underline.BackgroundColor = Style.UnderLine.BackgroundColor.All;
if (isNeedAnimation)
{
CreateUnderLineAnimation();
};
ItemChangedEvent?.Invoke(this, e);
- itemList[curIndex].State = ControlStates.Normal;
- itemList[curIndex].UpdateItemText(tabAttributes.TextAttributes);
+ itemList[curIndex].ControlState = ControlStates.Normal;
curIndex = item.Index;
- itemList[curIndex].State = ControlStates.Selected;
- itemList[curIndex].UpdateItemText(tabAttributes.TextAttributes);
+ itemList[curIndex].ControlState = ControlStates.Selected;
UpdateUnderLinePos();
}
return true;
}
- internal class TabItem : Control
+ internal class TabItem : View
{
public TabItem() : base()
{
Add(TextItem);
}
+ internal int Index
+ {
+ get;
+ set;
+ }
+
public string Text
{
get
}
}
- internal int Index
- {
- get;
- set;
- }
-
internal TextLabel TextItem
{
get;
set;
}
-
- protected override void Dispose(DisposeTypes type)
- {
- if (disposed)
- {
- return;
- }
-
- if (type == DisposeTypes.Explicit)
- {
- if (TextItem != null)
- {
- Remove(TextItem);
- TextItem.Dispose();
- TextItem = null;
- }
- }
-
- base.Dispose(type);
- }
-
- protected override Attributes GetAttributes()
- {
- return null;
- }
-
- internal void UpdateItemText(TextAttributes attrs)
- {
- ApplyAttributes(TextItem, attrs);
- }
}
/// <summary>
using System;
using Tizen.NUI.BaseComponents;
using System.ComponentModel;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.Components
{
/// <since_tizen> 6 </since_tizen>
public class Toast : Control
{
- /// <summary>
- /// textLabels.
- /// </summary>
- protected TextLabel[] textLabels = null;
- private ToastAttributes toastAttributes = null;
- private string[] textArray = null;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MessageProperty = BindableProperty.Create("Message", typeof(string), typeof(Toast), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Toast)bindable;
+ if (newValue != null)
+ {
+ instance.strText = (string)(newValue);
+ instance.textLabel.Text = instance.strText;
+ instance.UpdateText();
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Toast)bindable;
+ return instance.strText;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty DurationProperty = BindableProperty.Create("Duration", typeof(uint), typeof(Toast), default(uint), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var instance = (Toast)bindable;
+ if (newValue != null)
+ {
+ instance.Style.Duration = (uint)newValue;
+ instance.timer.Interval = (uint)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var instance = (Toast)bindable;
+ return instance.Style.Duration ?? instance.duration;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static Toast FromText(string text, uint duration)
+ {
+ Toast toast = new Toast();
+ toast.Message = text;
+ toast.Duration = duration;
+ return toast;
+ }
+
+ private Window window = null;
+ protected TextLabel[] textLabels = null;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected TextLabel textLabel = null;
+
+ private string strText = null;
private NPatchVisual toastBackground = null;
private Timer timer = null;
+ private string[] textArray = null;
private readonly int maxTextAreaWidth = 808;
- private readonly uint textLineHeight = 56;
- private readonly uint textLineSpace = 4;
- private readonly float textPointSize = 38;
private readonly int textPaddingLeft = 96;
- //private readonly int textPaddingRight = 96;
private readonly int textPaddingTop = 38;
- //private readonly int textPaddingBottom = 38;
private readonly uint duration = 3000;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new ToastStyle Style => ViewStyle as ToastStyle;
+
/// <summary>
/// Construct Toast with null.
/// </summary>
}
/// <summary>
- /// The constructor of the Toast class with specific Attributes.
+ /// The constructor of the Toast class with specific Style.
/// </summary>
- /// <param name="attributes">Construct Attributes</param>
+ /// <param name="Style">Construct Style</param>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Toast(ToastAttributes attributes) : base(attributes)
+ public Toast(ToastStyle style) : base(style)
{
Initialize();
}
if (null != value)
{
textArray = value;
- SetToastText();
- RelayoutRequest();
+ string message = "";
+ foreach (string text in textArray)
+ {
+ message += text + "\n";
+ }
+ Message = message;
}
}
}
{
get
{
- return toastAttributes.TextAttributes?.PointSize?.All ?? textPointSize;
+ return (float)Style.Text?.PointSize?.All;
}
set
{
- CreateTextAttributes();
- if (null == toastAttributes.TextAttributes.PointSize)
+ if (null == Style.Text.PointSize)
{
- toastAttributes.TextAttributes.PointSize = new FloatSelector();
+ Style.Text.PointSize = new FloatSelector();
}
- toastAttributes.TextAttributes.PointSize.All = value;
- RelayoutRequest();
+ Style.Text.PointSize.All = value;
}
}
{
get
{
- return toastAttributes.TextAttributes?.FontFamily;
+ return Style.Text?.FontFamily.All;
}
set
{
- CreateTextAttributes();
- toastAttributes.TextAttributes.FontFamily = value;
- RelayoutRequest();
+ Style.Text.FontFamily = value;
}
}
{
get
{
- return toastAttributes.TextAttributes?.TextColor?.All;
+ return Style.Text?.TextColor?.All;
}
set
{
- CreateTextAttributes();
- if (null == toastAttributes.TextAttributes.TextColor)
+ //CreateTextAttributes();
+ if (null == Style.Text.TextColor)
{
- toastAttributes.TextAttributes.TextColor = new ColorSelector();
+ Style.Text.TextColor = new ColorSelector();
}
- toastAttributes.TextAttributes.TextColor.All = value;
- RelayoutRequest();
+ Style.Text.TextColor.All = value;
+ //RelayoutRequest();
}
}
{
get
{
- return toastAttributes.TextAttributes?.HorizontalAlignment ?? HorizontalAlignment.Center;
+ return Style.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
}
set
{
- CreateTextAttributes();
- toastAttributes.TextAttributes.HorizontalAlignment = value;
- RelayoutRequest();
+ //CreateTextAttributes();
+ Style.Text.HorizontalAlignment = value;
+ //RelayoutRequest();
}
}
- /// <summary>
- /// Gets or sets background image resource of toast.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public string BackgroundImageURL
+ public void Post(Window win)
{
- get
- {
- return toastAttributes.BackgroundImageAttributes?.ResourceURL?.All;
- }
- set
- {
- if (null != value)
- {
- CreateBackgroundAttributes();
- if (toastAttributes.BackgroundImageAttributes != null)
- {
- if (null == toastAttributes.BackgroundImageAttributes?.ResourceURL)
- {
- toastAttributes.BackgroundImageAttributes.ResourceURL = new StringSelector();
- }
-
- toastAttributes.BackgroundImageAttributes.ResourceURL.All = value;
- SetToastBackground();
- }
- }
- }
+ window = win;
+ window.Add(this);
+ this.Position.X = (window.Size.Width - this.Size.Width) / 2;
+ this.Position.Y = (window.Size.Height - this.Size.Height) / 2;
}
/// <summary>
- /// Gets or sets background image's border of toast.
+ /// Gets or sets the text toast.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Rectangle BackgroundImageBorder
+ public string Message
{
get
{
- return toastAttributes.BackgroundImageAttributes?.Border?.All;
+ return (string)GetValue(MessageProperty);
}
set
{
- if (null != value)
- {
- CreateBackgroundAttributes();
- if (toastAttributes.BackgroundImageAttributes != null)
- {
- if (null == toastAttributes.BackgroundImageAttributes.Border)
- {
- toastAttributes.BackgroundImageAttributes.Border = new RectangleSelector();
- }
- toastAttributes.BackgroundImageAttributes.Border.All = value;
- SetToastBackground();
- }
- }
+ SetValue(MessageProperty, value);
}
}
{
get
{
- if (null != toastAttributes?.TextAttributes)
- {
- return new Extents((ushort)toastAttributes.TextAttributes.PaddingLeft, (ushort)toastAttributes.TextAttributes.PaddingRight, (ushort)toastAttributes.TextAttributes.PaddingTop, (ushort)toastAttributes.TextAttributes.PaddingBottom);
- }
- else
- {
- return null;
- }
+ return Style.Text.Padding;
}
set
{
if (null != value)
{
- CreateTextAttributes();
- toastAttributes.TextAttributes.PaddingLeft = value.Start;
- toastAttributes.TextAttributes.PaddingRight = value.End;
- toastAttributes.TextAttributes.PaddingTop = value.Top;
- toastAttributes.TextAttributes.PaddingBottom = value.Bottom;
- RelayoutRequest();
+ //CreateTextAttributes();
+ Style.Text.Padding.CopyFrom(value);
+
+ //if (null == textPadding)
+ //{
+ // textPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ // {
+ // toastAttributes.TextAttributes.Padding.Start = start;
+ // toastAttributes.TextAttributes.Padding.End = end;
+ // toastAttributes.TextAttributes.Padding.Top = top;
+ // toastAttributes.TextAttributes.Padding.Bottom = bottom;
+ // RelayoutRequest();
+ // }, value.Start, value.End, value.Top, value.Bottom);
+ //}
+ //else
+ //{
+ // textPadding.CopyFrom(value);
+ //}
+
+ //RelayoutRequest();
}
}
}
/// Gets or sets text line height in toast.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public uint TextLineHeight
- {
- get
- {
- return toastAttributes.TextLineHeight ?? textLineHeight;
- }
- set
- {
- toastAttributes.TextLineHeight = value;
- RelayoutRequest();
- }
- }
+ public uint TextLineHeight { get; set; }
/// <summary>
/// Gets or sets text line space in toast.
/// </summary>
/// <since_tizen> 6 </since_tizen>
- public uint TextLineSpace
- {
- get
- {
- return toastAttributes.TextLineSpace ?? textLineSpace;
- }
- set
- {
- toastAttributes.TextLineSpace = value;
- RelayoutRequest();
- }
- }
+ public uint TextLineSpace { get; set; }
/// <summary>
/// Gets or sets duration of toast.
{
get
{
- return toastAttributes.Duration ?? duration;
+ return (uint)GetValue(DurationProperty);
}
set
{
- toastAttributes.Duration = value;
- timer.Interval = value;
+ SetValue(DurationProperty, value);
}
}
timer.Dispose();
timer = null;
}
- if (null != textLabels)
+
+ if (null != textLabel)
{
- for (int i=0; i<textLabels.Length; i++)
- {
- Utility.Dispose(textLabels[i]);
- }
+ Utility.Dispose(textLabel);
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override void OnUpdate()
+ private void UpdateText()
{
- if (null == toastAttributes)
+ if (window == null)
{
- return;
+ //return;
}
- if (null != toastAttributes.TextAttributes)
- {
- for (int i = 0; i < textLabels.Length; i++)
- {
- ApplyAttributes(textLabels[i], toastAttributes.TextAttributes);
- }
- }
- LayoutChild();
- }
- /// <summary>
- /// LayoutChild include textLabel.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected virtual void LayoutChild()
- {
- int _textPaddingLeft = toastAttributes.TextAttributes?.PaddingLeft ?? textPaddingLeft;
- int _textPaddingRight = toastAttributes.TextAttributes?.PaddingRight ?? _textPaddingLeft;
- int _textPaddingTop = toastAttributes.TextAttributes?.PaddingTop ?? textPaddingTop;
- int _textPaddingBottom = toastAttributes.TextAttributes?.PaddingBottom ?? _textPaddingTop;
-
- int _textAreaWidth = this.Size2D.Width - _textPaddingLeft - _textPaddingRight;
- int _textAreaHeight = this.Size2D.Height - _textPaddingTop - _textPaddingBottom;
- int _textLineSpace = (int)(toastAttributes.TextLineSpace ?? textLineSpace);
- int _textLineHeight = (int)(toastAttributes.TextLineHeight ?? textLineHeight);
- int _positionY = 0;
-
- _textAreaWidth = _textAreaWidth > maxTextAreaWidth ? maxTextAreaWidth : _textAreaWidth;
- if (textLabels != null)
+ int _textPaddingLeft = Style.Text?.Padding.Start ?? textPaddingLeft;
+ int _textPaddingRight = Style.Text?.Padding.End ?? _textPaddingLeft;
+ int _textPaddingTop = Style.Text?.Padding.Top ?? textPaddingTop;
+ int _textPaddingBottom = Style.Text?.Padding.Bottom ?? _textPaddingTop;
+
+ int _textAreaWidth = (int)Size.Width - _textPaddingLeft - _textPaddingRight;
+ int _textAreaHeight = (int)Size.Height - _textPaddingTop - _textPaddingBottom;
+ _textAreaWidth = _textAreaWidth > maxTextAreaWidth ? maxTextAreaWidth : _textAreaWidth;
+ if (textLabel != null)
{
- if (LayoutDirection == ViewLayoutDirectionType.LTR)
+ textLabel.Position = new Position(_textPaddingLeft, _textPaddingTop);
+ textLabel.Size = new Size(_textAreaWidth, _textAreaHeight);
+ if (LayoutDirection == ViewLayoutDirectionType.RTL)
{
- for (int i = 0; i < textLabels?.Length; i++)
- {
- textLabels[i].Position2D = new Position2D(_textPaddingLeft, _textPaddingTop + _positionY);
- textLabels[i].Size2D = new Size2D(_textAreaWidth, _textLineHeight);
- _positionY += _textLineHeight + _textLineSpace;
- }
- }
- else
- {
- for (int i = 0; i < textLabels?.Length; i++)
- {
- textLabels[i].ParentOrigin = Tizen.NUI.ParentOrigin.TopRight;
- textLabels[i].PivotPoint = Tizen.NUI.PivotPoint.TopRight;
- textLabels[i].PositionUsesPivotPoint = true;
- textLabels[i].Position2D = new Position2D(-_textPaddingLeft, _textPaddingTop + _positionY);
- textLabels[i].Size2D = new Size2D(_textAreaWidth, _textLineHeight);
- _positionY += _textLineHeight + _textLineSpace;
- }
+ textLabel.ParentOrigin = Tizen.NUI.ParentOrigin.TopRight;
+ textLabel.PivotPoint = Tizen.NUI.PivotPoint.TopRight;
+ textLabel.PositionUsesPivotPoint = true;
}
}
}
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected override Attributes GetAttributes()
+ protected override ViewStyle GetViewStyle()
{
- return new ToastAttributes();
+ return new ToastStyle();
}
private void Initialize()
{
- toastAttributes = attributes as ToastAttributes;
- if (null == toastAttributes)
+ toastBackground = new NPatchVisual();
+ if (toastBackground == null)
{
- throw new Exception("Toast attribute parse error.");
+ throw new Exception("Toast background is null.");
}
- ApplyAttributes(this, toastAttributes);
-
- toastBackground = new NPatchVisual();
SetToastBackground();
+ textLabel = new TextLabel();
+ if (null == textLabel)
+ {
+ throw new Exception("Toast textLabel is null.");
+ }
+ textLabel.TextColor = Color.White;
+ this.Add(textLabel);
+
this.VisibilityChanged += OnVisibilityChanged;
- timer = new Timer(toastAttributes.Duration ?? duration);
+ timer = new Timer(Style.Duration ?? duration);
timer.Tick += OnTick;
timer.Start();
}
}
}
- private void SetToastText()
- {
- if (textLabels != null)
- {
- for (int i = 0; i < textLabels?.Length; i++)
- {
- if (null != textLabels[i])
- {
- this.Remove(textLabels[i]);
- textLabels[i].Dispose();
- textLabels[i] = null;
- }
- }
- }
-
- textLabels = new TextLabel[textArray.Length];
- if (textLabels != null)
- {
- for (int i = 0; i < textArray.Length; i++)
- {
- textLabels[i] = new TextLabel();
- textLabels[i].Text = textArray[i];
- textLabels[i].BackgroundColor = Color.Blue;
- this.Add(textLabels[i]);
- }
- }
- }
-
private void SetToastBackground()
{
- if (null != toastAttributes?.BackgroundImageAttributes?.ResourceURL)
+ if (null != Style?.Background?.ResourceUrl)
{
- toastBackground.URL = toastAttributes.BackgroundImageAttributes.ResourceURL.All;
+ toastBackground.URL = Style.Background.ResourceUrl.All;
}
- if (null != toastAttributes?.BackgroundImageAttributes?.Border)
+ if (null != Style?.Background?.Border)
{
- toastBackground.Border = toastAttributes.BackgroundImageAttributes.Border.All;
+ toastBackground.Border = Style.Background.Border.All;
}
this.Background = toastBackground.OutputVisualMap;
}
-
- private void CreateBackgroundAttributes()
- {
- if (null == toastAttributes.BackgroundImageAttributes)
- {
- toastAttributes.BackgroundImageAttributes = new ImageAttributes();
- }
- }
-
- private void CreateTextAttributes()
- {
- if (null == toastAttributes.TextAttributes)
- {
- toastAttributes.TextAttributes = new TextAttributes();
- }
- }
}
}
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Components
{
/// <summary>
- /// Selector class, which is related by Control State, it is base class for other Selector.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class Selector<T>
- {
-
- /// <summary>
- /// All State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T All
- {
- get;
- set;
- }
- /// <summary>
- /// Normal State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T Normal
- {
- get;
- set;
- }
- /// <summary>
- /// Pressed State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T Pressed
- {
- get;
- set;
- }
- /// <summary>
- /// Focused State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T Focused
- {
- get;
- set;
- }
- /// <summary>
- /// Selected State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T Selected
- {
- get;
- set;
- }
- /// <summary>
- /// Disabled State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T Disabled
- {
- get;
- set;
- }
- /// <summary>
- /// DisabledFocused State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T DisabledFocused
- {
- get;
- set;
- }
- /// <summary>
- /// SelectedFocused State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- public T SelectedFocused
- {
- get;
- set;
- }
- /// <summary>
- /// DisabledSelected State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T DisabledSelected
- {
- get;
- set;
- }
- /// <summary>
- /// Other State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T Other
- {
- get;
- set;
- }
- /// <summary>
- /// Get value by State.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public T GetValue(ControlStates state)
- {
- if(All != null)
- {
- return All;
- }
- switch(state)
- {
- case ControlStates.Normal:
- return Normal != null? Normal : Other;
- case ControlStates.Focused:
- return Focused != null? Focused : Other;
- case ControlStates.Pressed:
- return Pressed != null? Pressed : Other;
- case ControlStates.Disabled:
- return Disabled != null? Disabled : Other;
- case ControlStates.Selected:
- return Selected != null? Selected : Other;
- case ControlStates.DisabledFocused:
- return DisabledFocused != null? DisabledFocused : Other;
- case ControlStates.DisabledSelected:
- return DisabledSelected != null? DisabledSelected : Other;
- case ControlStates.SelectedFocused:
- return SelectedFocused != null ? SelectedFocused : Other;
- default:
- return Other;
- }
- }
- /// <summary>
- /// Clone function.
- /// </summary>
- /// <since_tizen> 6 </since_tizen>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public void Clone(Selector<T> selector)
- {
- All = selector.All;
- Normal = selector.Normal;
- Focused = selector.Focused;
- Pressed = selector.Pressed;
- Disabled = selector.Disabled;
- Selected = selector.Selected;
- DisabledSelected = selector.DisabledSelected;
- DisabledFocused = selector.DisabledFocused;
- SelectedFocused = selector.SelectedFocused;
- Other = selector.Other;
- }
-
- }
-
- /// <summary>
/// Int selector.
/// </summary>
/// <since_tizen> 6 </since_tizen>
*
*/
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Components
{
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- protected internal virtual Attributes GetAttributes()
+ protected internal virtual ViewStyle GetAttributes()
{
- return Content as Attributes;
+ return Content as ViewStyle;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Components
{
public sealed class StyleManager
{
private string theme = "default";
- private Dictionary<string, Dictionary<string, Type>> themeStyleSet = new Dictionary<string, Dictionary<string, Type>>();
- private Dictionary<string, Type> defaultStyleSet = new Dictionary<string, Type>();
+ private Dictionary<string, Dictionary<string, StyleBase>> themeStyleSet = new Dictionary<string, Dictionary<string, StyleBase>>();
+ private Dictionary<string, StyleBase> defaultStyleSet = new Dictionary<string, StyleBase>();
private EventHandler<ThemeChangeEventArgs> themeChangeHander;
/// <summary>
set
{
- if(theme != value)
+ if (theme != value)
{
theme = value;
themeChangeHander?.Invoke(null, new ThemeChangeEventArgs { CurrentTheme = theme });
[EditorBrowsable(EditorBrowsableState.Never)]
public void RegisterStyle(string style, string theme, Type styleType, bool bDefault = false)
{
- if(style == null)
+ if (style == null)
{
throw new InvalidOperationException($"style can't be null");
}
- if(theme == null || bDefault == true)
+ if (theme == null || bDefault == true)
{
- if(defaultStyleSet.ContainsKey(style))
+ if (defaultStyleSet.ContainsKey(style))
{
throw new InvalidOperationException($"{style}] already be used");
}
else
{
- defaultStyleSet.Add(style, styleType);
+ defaultStyleSet.Add(style, Activator.CreateInstance(styleType) as StyleBase);
}
return;
}
- if(themeStyleSet.ContainsKey(style) && themeStyleSet[style].ContainsKey(theme))
+ if (themeStyleSet.ContainsKey(style) && themeStyleSet[style].ContainsKey(theme))
{
throw new InvalidOperationException($"{style}] already be used");
}
- if(!themeStyleSet.ContainsKey(style))
+
+ if (!themeStyleSet.ContainsKey(style))
{
- themeStyleSet.Add(style, new Dictionary<string, Type>());
+ themeStyleSet.Add(style, new Dictionary<string, StyleBase>());
}
- themeStyleSet[style].Add(theme, styleType);
+
+ themeStyleSet[style].Add(theme, Activator.CreateInstance(styleType) as StyleBase);
}
/// <summary>
/// <since_tizen> 6 </since_tizen>
/// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Attributes GetAttributes(string style)
+ public ViewStyle GetAttributes(string style)
{
- if(style == null)
+ if (style == null)
{
return null;
}
- object obj = null;
- if(themeStyleSet.ContainsKey(style) && themeStyleSet[style].ContainsKey(Theme))
+ if (themeStyleSet.ContainsKey(style) && themeStyleSet[style].ContainsKey(Theme))
{
- obj = Activator.CreateInstance(themeStyleSet[style][Theme]);
+ return (themeStyleSet[style][Theme])?.GetAttributes();
}
- else if(defaultStyleSet.ContainsKey(style))
+ else if (defaultStyleSet.ContainsKey(style))
{
- obj = Activator.CreateInstance(defaultStyleSet[style]);
+ return (defaultStyleSet[style])?.GetAttributes();
}
- return (obj as StyleBase)?.GetAttributes();
+ return null;
}
/// <summary>
View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
if (view)
{
- OnChildAdd(view);
+ if (null != OnChildAdd)
+ {
+ OnChildAdd(view);
+ }
}
}
private bool DirectorRelayoutDependentOnChildren__SWIG_0(int dimension)
{
- return RelayoutDependentOnChildrenDimension((DimensionType)dimension);
+ if (null == RelayoutDependentOnChildrenDimension)
+ {
+ return false;
+ }
+ else
+ {
+ return RelayoutDependentOnChildrenDimension((DimensionType)dimension);
+ }
}
private bool DirectorRelayoutDependentOnChildren__SWIG_1()
View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
if (view)
{
- OnControlChildAdd(view);
+ if (null != OnControlChildAdd)
+ {
+ OnControlChildAdd(view);
+ }
}
}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <param name="typeName">typename</param>
/// <param name="behaviour">CustomView Behaviour</param>
/// <since_tizen> 3 </since_tizen>
- public CustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, new ViewWrapperImpl(behaviour))
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public CustomView(string typeName, CustomViewBehaviour behaviour, ViewStyle viewStyle) : base(typeName, new ViewWrapperImpl(behaviour), viewStyle)
{
- // Registering CustomView virtual functions to viewWrapperImpl delegates.
- viewWrapperImpl.OnStageConnection = new ViewWrapperImpl.OnStageConnectionDelegate(OnStageConnection);
- viewWrapperImpl.OnStageDisconnection = new ViewWrapperImpl.OnStageDisconnectionDelegate(OnStageDisconnection);
- viewWrapperImpl.OnChildAdd = new ViewWrapperImpl.OnChildAddDelegate(OnChildAdd);
- viewWrapperImpl.OnChildRemove = new ViewWrapperImpl.OnChildRemoveDelegate(OnChildRemove);
- viewWrapperImpl.OnPropertySet = new ViewWrapperImpl.OnPropertySetDelegate(OnPropertySet);
- viewWrapperImpl.OnSizeSet = new ViewWrapperImpl.OnSizeSetDelegate(OnSizeSet);
- viewWrapperImpl.OnSizeAnimation = new ViewWrapperImpl.OnSizeAnimationDelegate(OnSizeAnimation);
- viewWrapperImpl.OnTouch = new ViewWrapperImpl.OnTouchDelegate(OnTouch);
- viewWrapperImpl.OnHover = new ViewWrapperImpl.OnHoverDelegate(OnHover);
- viewWrapperImpl.OnKey = new ViewWrapperImpl.OnKeyDelegate(OnKey);
- viewWrapperImpl.OnWheel = new ViewWrapperImpl.OnWheelDelegate(OnWheel);
- viewWrapperImpl.OnRelayout = new ViewWrapperImpl.OnRelayoutDelegate(OnRelayout);
- viewWrapperImpl.OnSetResizePolicy = new ViewWrapperImpl.OnSetResizePolicyDelegate(OnSetResizePolicy);
- viewWrapperImpl.GetNaturalSize = new ViewWrapperImpl.GetNaturalSizeDelegate(GetNaturalSize);
- viewWrapperImpl.CalculateChildSize = new ViewWrapperImpl.CalculateChildSizeDelegate(CalculateChildSize);
- viewWrapperImpl.GetHeightForWidth = new ViewWrapperImpl.GetHeightForWidthDelegate(GetHeightForWidth);
- viewWrapperImpl.GetWidthForHeight = new ViewWrapperImpl.GetWidthForHeightDelegate(GetWidthForHeight);
- viewWrapperImpl.RelayoutDependentOnChildrenDimension = new ViewWrapperImpl.RelayoutDependentOnChildrenDimensionDelegate(RelayoutDependentOnChildren);
- viewWrapperImpl.RelayoutDependentOnChildren = new ViewWrapperImpl.RelayoutDependentOnChildrenDelegate(RelayoutDependentOnChildren);
- viewWrapperImpl.OnCalculateRelayoutSize = new ViewWrapperImpl.OnCalculateRelayoutSizeDelegate(OnCalculateRelayoutSize);
- viewWrapperImpl.OnLayoutNegotiated = new ViewWrapperImpl.OnLayoutNegotiatedDelegate(OnLayoutNegotiated);
- viewWrapperImpl.OnControlChildAdd = new ViewWrapperImpl.OnControlChildAddDelegate(OnControlChildAdd);
- viewWrapperImpl.OnControlChildRemove = new ViewWrapperImpl.OnControlChildRemoveDelegate(OnControlChildRemove);
- viewWrapperImpl.OnStyleChange = new ViewWrapperImpl.OnStyleChangeDelegate(OnStyleChange);
- viewWrapperImpl.OnAccessibilityActivated = new ViewWrapperImpl.OnAccessibilityActivatedDelegate(OnAccessibilityActivated);
- viewWrapperImpl.OnAccessibilityPan = new ViewWrapperImpl.OnAccessibilityPanDelegate(OnAccessibilityPan);
- viewWrapperImpl.OnAccessibilityTouch = new ViewWrapperImpl.OnAccessibilityTouchDelegate(OnAccessibilityTouch);
- viewWrapperImpl.OnAccessibilityValueChange = new ViewWrapperImpl.OnAccessibilityValueChangeDelegate(OnAccessibilityValueChange);
- viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom);
- viewWrapperImpl.OnFocusGained = new ViewWrapperImpl.OnFocusGainedDelegate(OnFocusGained);
- viewWrapperImpl.OnFocusLost = new ViewWrapperImpl.OnFocusLostDelegate(OnFocusLost);
- viewWrapperImpl.GetNextFocusableView = new ViewWrapperImpl.GetNextFocusableViewDelegate(GetNextFocusableView);
- viewWrapperImpl.OnFocusChangeCommitted = new ViewWrapperImpl.OnFocusChangeCommittedDelegate(OnFocusChangeCommitted);
- viewWrapperImpl.OnKeyboardEnter = new ViewWrapperImpl.OnKeyboardEnterDelegate(OnKeyboardEnter);
- viewWrapperImpl.OnPinch = new ViewWrapperImpl.OnPinchDelegate(OnPinch);
- viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
- viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
- viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
-
- // Make sure CustomView is initialized.
- OnInitialize();
+ Initialize();
+ }
- // Set the StyleName the name of the View
- // We have to do this because the StyleManager on Native side can't workout it out
- // This will also ensure that the style of views/visuals initialized above are applied by the style manager.
- SetStyleName(this.GetType().Name);
+ /// <summary>
+ /// Create an instance of customView.
+ /// </summary>
+ /// <param name="typeName">typename</param>
+ /// <param name="behaviour">CustomView Behaviour</param>
+ /// <since_tizen> 3 </since_tizen>
+ public CustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, new ViewWrapperImpl(behaviour))
+ {
+ Initialize();
}
/// <summary>
private void OnControlChildRemove(View child)
{
}
+
+ private void Initialize()
+ {
+ // Registering CustomView virtual functions to viewWrapperImpl delegates.
+ viewWrapperImpl.OnStageConnection = new ViewWrapperImpl.OnStageConnectionDelegate(OnStageConnection);
+ viewWrapperImpl.OnStageDisconnection = new ViewWrapperImpl.OnStageDisconnectionDelegate(OnStageDisconnection);
+ viewWrapperImpl.OnChildAdd = new ViewWrapperImpl.OnChildAddDelegate(OnChildAdd);
+ viewWrapperImpl.OnChildRemove = new ViewWrapperImpl.OnChildRemoveDelegate(OnChildRemove);
+ viewWrapperImpl.OnPropertySet = new ViewWrapperImpl.OnPropertySetDelegate(OnPropertySet);
+ viewWrapperImpl.OnSizeSet = new ViewWrapperImpl.OnSizeSetDelegate(OnSizeSet);
+ viewWrapperImpl.OnSizeAnimation = new ViewWrapperImpl.OnSizeAnimationDelegate(OnSizeAnimation);
+ viewWrapperImpl.OnTouch = new ViewWrapperImpl.OnTouchDelegate(OnTouch);
+ viewWrapperImpl.OnHover = new ViewWrapperImpl.OnHoverDelegate(OnHover);
+ viewWrapperImpl.OnKey = new ViewWrapperImpl.OnKeyDelegate(OnKey);
+ viewWrapperImpl.OnWheel = new ViewWrapperImpl.OnWheelDelegate(OnWheel);
+ viewWrapperImpl.OnRelayout = new ViewWrapperImpl.OnRelayoutDelegate(OnRelayout);
+ viewWrapperImpl.OnSetResizePolicy = new ViewWrapperImpl.OnSetResizePolicyDelegate(OnSetResizePolicy);
+ viewWrapperImpl.GetNaturalSize = new ViewWrapperImpl.GetNaturalSizeDelegate(GetNaturalSize);
+ viewWrapperImpl.CalculateChildSize = new ViewWrapperImpl.CalculateChildSizeDelegate(CalculateChildSize);
+ viewWrapperImpl.GetHeightForWidth = new ViewWrapperImpl.GetHeightForWidthDelegate(GetHeightForWidth);
+ viewWrapperImpl.GetWidthForHeight = new ViewWrapperImpl.GetWidthForHeightDelegate(GetWidthForHeight);
+ viewWrapperImpl.RelayoutDependentOnChildrenDimension = new ViewWrapperImpl.RelayoutDependentOnChildrenDimensionDelegate(RelayoutDependentOnChildren);
+ viewWrapperImpl.RelayoutDependentOnChildren = new ViewWrapperImpl.RelayoutDependentOnChildrenDelegate(RelayoutDependentOnChildren);
+ viewWrapperImpl.OnCalculateRelayoutSize = new ViewWrapperImpl.OnCalculateRelayoutSizeDelegate(OnCalculateRelayoutSize);
+ viewWrapperImpl.OnLayoutNegotiated = new ViewWrapperImpl.OnLayoutNegotiatedDelegate(OnLayoutNegotiated);
+ viewWrapperImpl.OnControlChildAdd = new ViewWrapperImpl.OnControlChildAddDelegate(OnControlChildAdd);
+ viewWrapperImpl.OnControlChildRemove = new ViewWrapperImpl.OnControlChildRemoveDelegate(OnControlChildRemove);
+ viewWrapperImpl.OnStyleChange = new ViewWrapperImpl.OnStyleChangeDelegate(OnStyleChange);
+ viewWrapperImpl.OnAccessibilityActivated = new ViewWrapperImpl.OnAccessibilityActivatedDelegate(OnAccessibilityActivated);
+ viewWrapperImpl.OnAccessibilityPan = new ViewWrapperImpl.OnAccessibilityPanDelegate(OnAccessibilityPan);
+ viewWrapperImpl.OnAccessibilityTouch = new ViewWrapperImpl.OnAccessibilityTouchDelegate(OnAccessibilityTouch);
+ viewWrapperImpl.OnAccessibilityValueChange = new ViewWrapperImpl.OnAccessibilityValueChangeDelegate(OnAccessibilityValueChange);
+ viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom);
+ viewWrapperImpl.OnFocusGained = new ViewWrapperImpl.OnFocusGainedDelegate(OnFocusGained);
+ viewWrapperImpl.OnFocusLost = new ViewWrapperImpl.OnFocusLostDelegate(OnFocusLost);
+ viewWrapperImpl.GetNextFocusableView = new ViewWrapperImpl.GetNextFocusableViewDelegate(GetNextFocusableView);
+ viewWrapperImpl.OnFocusChangeCommitted = new ViewWrapperImpl.OnFocusChangeCommittedDelegate(OnFocusChangeCommitted);
+ viewWrapperImpl.OnKeyboardEnter = new ViewWrapperImpl.OnKeyboardEnterDelegate(OnKeyboardEnter);
+ viewWrapperImpl.OnPinch = new ViewWrapperImpl.OnPinchDelegate(OnPinch);
+ viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
+ viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
+ viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
+
+ // Make sure CustomView is initialized.
+ OnInitialize();
+
+ // Set the StyleName the name of the View
+ // We have to do this because the StyleManager on Native side can't workout it out
+ // This will also ensure that the style of views/visuals initialized above are applied by the style manager.
+ SetStyleName(this.GetType().Name);
+ }
}
}
\ No newline at end of file
private string _resourceUrl = "";
private bool _synchronosLoading = false;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageViewStyle Style => ViewStyle as ImageViewStyle;
+
/// <summary>
/// Creates an initialized ImageView.
/// </summary>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ImageView(ViewStyle viewStyle) : this(Interop.ImageView.ImageView_New__SWIG_0(), true, viewStyle)
+ {
+ }
+
/// <summary>
/// Creates an initialized ImageView with setting the status of shown or hidden.
/// </summary>
}
}
+ internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.ImageView.ImageView_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
+ {
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+
+ if (!shown)
+ {
+ SetVisible(false);
+ }
+ }
+
internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.ImageView.ImageView_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
get
{
Rectangle temp = (Rectangle)GetValue(BorderProperty);
- return new Rectangle(OnBorderChanged, temp.X, temp.Y, temp.Width, temp.Height);
+ if (null == temp)
+ {
+ return null;
+ }
+ else
+ {
+ return new Rectangle(OnBorderChanged, temp.X, temp.Y, temp.Width, temp.Height);
+ }
}
set
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
+ /// <summary>
+ /// Get attribues, it is abstract function and must be override.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override ViewStyle GetViewStyle()
+ {
+ return new ImageViewStyle();
+ }
+
internal void SetImage(string url, Uint16Pair size)
{
if(url.Contains(".json"))
return (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE);
}
+ internal static readonly BindableProperty ResourceUrlSelectorProperty = BindableProperty.Create("ResourceUrlSelector", typeof(Selector<string>), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ imageView.resourceUrlSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ return imageView.resourceUrlSelector;
+ });
+ private TriggerableSelector<string> _resourceUrlSelector;
+ private TriggerableSelector<string> resourceUrlSelector
+ {
+ get
+ {
+ if (null == _resourceUrlSelector)
+ {
+ _resourceUrlSelector = new TriggerableSelector<string>(this, ResourceUrlProperty);
+ }
+ return _resourceUrlSelector;
+ }
+ }
+
+ internal static readonly BindableProperty BorderSelectorProperty = BindableProperty.Create("BorderSelector", typeof(Selector<Rectangle>), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ imageView.borderSelector.Clone((Selector<Rectangle>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ return imageView.borderSelector;
+ });
+ private TriggerableSelector<Rectangle> _borderSelector;
+ private TriggerableSelector<Rectangle> borderSelector
+ {
+ get
+ {
+ if (null == _borderSelector)
+ {
+ _borderSelector = new TriggerableSelector<Rectangle>(this, BorderProperty);
+ }
+ return _borderSelector;
+ }
+ }
+
/// <summary>
/// you can override it to clean-up your own resources.
/// </summary>
{
PixelArea = new RelativeVector4(x, y, z, w);
}
-
}
}
--- /dev/null
+/*
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System.Collections.Generic;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.BaseComponents
+{
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ internal class BundledPipe : global::System.IDisposable
+ {
+ private class Pipe
+ {
+ private BindableObject srcObj;
+ private BindableObject destObj;
+
+ private BindableProperty srcProperty;
+ private BindableProperty destProperty;
+
+ public Pipe(BindableObject srcObj, BindableProperty srcProperty, BindableObject destObj, BindableProperty destProperty, BindingDirection bindingDirection)
+ {
+ if (null == srcObj || null == destObj)
+ {
+ throw (new global::System.Exception("Src obj and dest obj can't be null"));
+ }
+
+ if (null == srcProperty || null == destProperty)
+ {
+ throw (new global::System.Exception("Src property and dest property can't be null"));
+ }
+
+ this.srcObj = srcObj;
+ this.destObj = destObj;
+
+ this.srcProperty = srcProperty;
+ this.destProperty = destProperty;
+
+ srcObj.ListenPropertyChange(srcProperty, SrcObjPropertyChanged);
+
+ if (BindingDirection.TwoWay == bindingDirection)
+ {
+ destObj.ListenPropertyChange(destProperty, DestObjPropertyChanged);
+ }
+ }
+
+ public void Clear()
+ {
+ srcObj.RemovePropertyChangeListener(srcProperty, SrcObjPropertyChanged);
+ destObj.RemovePropertyChangeListener(destProperty, DestObjPropertyChanged);
+ }
+
+ private void DestObjPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (CurrentSetDirection.NoSet == currentSetDirection)
+ {
+ currentSetDirection = CurrentSetDirection.DestToSrc;
+
+ object value = destObj.GetValue(destProperty);
+ srcProperty.PropertyChanged?.Invoke(srcObj, null, value);
+
+ currentSetDirection = CurrentSetDirection.NoSet;
+ }
+ }
+
+ private void SrcObjPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (CurrentSetDirection.NoSet == currentSetDirection)
+ {
+ currentSetDirection = CurrentSetDirection.SrcToDest;
+
+ object value = srcObj.GetValue(srcProperty);
+ destProperty.PropertyChanged?.Invoke(destObj, null, value);
+
+ currentSetDirection = CurrentSetDirection.NoSet;
+ }
+ }
+
+ private CurrentSetDirection currentSetDirection = CurrentSetDirection.NoSet;
+ }
+
+ internal void Bind(BindableObject srcObj, BindableProperty srcProperty, BindableObject destObj, BindableProperty destProperty, BindingDirection bindingDirection)
+ {
+ if (null == srcObj || null == destObj)
+ {
+ throw (new global::System.Exception("Src obj and dest obj can't be null"));
+ }
+
+ if (null == srcProperty || null == destProperty)
+ {
+ throw (new global::System.Exception("Src property and dest property can't be null"));
+ }
+
+ if (!srcProperty.PropertyName.Equals(destProperty.PropertyName))
+ {
+ throw (new global::System.Exception("Src property is not same to dest property"));
+ }
+
+ Pipe pipe = new Pipe(srcObj, srcProperty, destObj, destProperty, bindingDirection);
+ pipes.Add(pipe);
+ }
+
+ public void Dispose()
+ {
+ Clear();
+ }
+
+ public void Clear()
+ {
+ foreach (Pipe pipe in pipes)
+ {
+ pipe.Clear();
+ }
+
+ pipes.Clear();
+ }
+
+ private List<Pipe> pipes = new List<Pipe>();
+
+ private enum CurrentSetDirection
+ {
+ NoSet = 0,
+ SrcToDest,
+ DestToSrc
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.BaseComponents
+{
+ /// <summary>
+ /// The base class for Children attributes in Components.
+ /// </summary>
+ /// 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 ImageViewStyle : ViewStyle
+ {
+ private bool? preMultipliedAlpha;
+ private RelativeVector4 pixelArea;
+ private bool? borderOnly;
+ private bool? synchronosLoading;
+ private bool? orientationCorrection;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ResourceUrlSelectorProperty = BindableProperty.Create("ResourceUrlSelector", typeof(Selector<string>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ imageViewStyle.resourceUrlSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ return imageViewStyle.resourceUrlSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create("PreMultipliedAlpha", typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ imageViewStyle.preMultipliedAlpha = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ return imageViewStyle.preMultipliedAlpha;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create("PixelArea", typeof(RelativeVector4), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ imageViewStyle.pixelArea = (RelativeVector4)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ return imageViewStyle.pixelArea;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderSelectorProperty = BindableProperty.Create("BorderSelector", typeof(Selector<Rectangle>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ imageViewStyle.borderSelector.Clone((Selector<Rectangle>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ return imageViewStyle.borderSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create("BorderOnly", typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ imageViewStyle.borderOnly = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ return imageViewStyle.borderOnly;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create("SynchronosLoading", typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ imageViewStyle.synchronosLoading = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ return imageViewStyle.synchronosLoading;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create("OrientationCorrection", typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ imageViewStyle.orientationCorrection = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageViewStyle = (ImageViewStyle)bindable;
+ return imageViewStyle.orientationCorrection;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? PreMultipliedAlpha
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(PreMultipliedAlphaProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PreMultipliedAlphaProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public RelativeVector4 PixelArea
+ {
+ get
+ {
+ RelativeVector4 temp = (RelativeVector4)GetValue(PixelAreaProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PixelAreaProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? BorderOnly
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(BorderOnlyProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(BorderOnlyProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? SynchronosLoading
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(SynchronosLoadingProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SynchronosLoadingProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? OrientationCorrection
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(OrientationCorrectionProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(OrientationCorrectionProperty, value);
+ }
+ }
+
+ private Selector<string> resourceUrlSelector = new Selector<string>();
+ /// <summary>
+ /// Image URL.
+ /// </summary>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<string> ResourceUrl
+ {
+ get
+ {
+ return (Selector<string>)GetValue(ResourceUrlSelectorProperty);
+ }
+ set
+ {
+ SetValue(ResourceUrlSelectorProperty, value);
+ }
+ }
+
+ private Selector<Rectangle> borderSelector = new Selector<Rectangle>();
+ /// <summary>
+ /// Image border.
+ /// </summary>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<Rectangle> Border
+ {
+ get
+ {
+ return (Selector<Rectangle>)GetValue(BorderSelectorProperty);
+ }
+ set
+ {
+ SetValue(BorderSelectorProperty, value);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Components;
+
+namespace Tizen.NUI.BaseComponents
+{
+ /// <summary>
+ /// Selector class, which is related by Control State, it is base class for other Selector.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class Selector<T> : BindableObject
+ {
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ public static implicit operator Selector<T>(T value)
+ {
+ Selector<T> selector = new Selector<T>();
+ selector.All = value;
+ return selector;
+ }
+
+ /// <summary>
+ /// All State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T All
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// Normal State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T Normal
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// Pressed State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T Pressed
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// Focused State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T Focused
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// Selected State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T Selected
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// Disabled State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T Disabled
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// DisabledFocused State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T DisabledFocused
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// SelectedFocused State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ public T SelectedFocused
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// DisabledSelected State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T DisabledSelected
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// Other State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T Other
+ {
+ get;
+ set;
+ }
+ /// <summary>
+ /// Get value by State.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public T GetValue(ControlStates state)
+ {
+ if(All != null)
+ {
+ return All;
+ }
+ switch(state)
+ {
+ case ControlStates.Normal:
+ return Normal != null? Normal : Other;
+ case ControlStates.Focused:
+ return Focused != null? Focused : Other;
+ case ControlStates.Pressed:
+ return Pressed != null? Pressed : Other;
+ case ControlStates.Disabled:
+ return Disabled != null? Disabled : Other;
+ case ControlStates.Selected:
+ return Selected != null? Selected : Other;
+ case ControlStates.DisabledFocused:
+ return DisabledFocused != null? DisabledFocused : Other;
+ case ControlStates.DisabledSelected:
+ return DisabledSelected != null? DisabledSelected : Other;
+ case ControlStates.SelectedFocused:
+ return SelectedFocused != null ? SelectedFocused : Other;
+ default:
+ return Other;
+ }
+ }
+ /// <summary>
+ /// Clone function.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void Clone(Selector<T> selector)
+ {
+ All = selector.All;
+ Normal = selector.Normal;
+ Focused = selector.Focused;
+ Pressed = selector.Pressed;
+ Disabled = selector.Disabled;
+ Selected = selector.Selected;
+ DisabledSelected = selector.DisabledSelected;
+ DisabledFocused = selector.DisabledFocused;
+ SelectedFocused = selector.SelectedFocused;
+ Other = selector.Other;
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class TriggerableSelector<T> : Selector<T>
+ {
+ public TriggerableSelector(View view, BindableProperty bindableProperty)
+ {
+ targetView = view;
+ targetBindableProperty = bindableProperty;
+ view.ControlStateChangeEvent += OnViewControlState;
+ }
+
+ /// <summary>
+ /// Clone function.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public new void Clone(Selector<T> selector)
+ {
+ base.Clone(selector);
+
+ if (null != targetView && null != GetValue(targetView.ControlState))
+ {
+ targetView.SetValue(targetBindableProperty, GetValue(targetView.ControlState));
+ }
+ }
+
+ private void OnViewControlState(View obj, ControlStates state)
+ {
+ if (null != obj && null != GetValue(state))
+ {
+ obj.SetValue(targetBindableProperty, GetValue(state));
+ }
+ }
+
+ private View targetView;
+ private BindableProperty targetBindableProperty;
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.BaseComponents
+{
+ /// <summary>
+ /// The base class for Children attributes in Components.
+ /// </summary>
+ /// 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 TextFieldStyle : ViewStyle
+ {
+ private string placeholderText;
+ private string placeholderTextFocused;
+ private int? maxLength;
+ private int? exceedPolicy;
+ private HorizontalAlignment? horizontalAlignment;
+ private VerticalAlignment? verticalAlignment;
+ private Vector4 secondaryCursorColor;
+ private bool? enableCursorBlink;
+ private float? cursorBlinkInterval;
+ private float? cursorBlinkDuration;
+ private int? cursorWidth;
+ private string grabHandleImage;
+ private string grabHandlePressedImage;
+ private float? scrollThreshold;
+ private float? scrollSpeed;
+ private Vector4 selectionHighlightColor;
+ private Rectangle decorationBoundingBox;
+ private Vector4 inputColor;
+ private bool? enableMarkup;
+ private string inputFontFamily;
+ private float? inputPointSize;
+ private string inputUnderline;
+ private string inputShadow;
+ private string emboss;
+ private string inputEmboss;
+ private string inputOutline;
+ private float? pixelSize;
+ private bool? enableSelection;
+ private bool? ellipsis;
+ private bool? matchSystemLanguageDirection;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ if (null == textFieldStyle.translatableTextSelector)
+ {
+ textFieldStyle.translatableTextSelector = new Selector<string>();
+ }
+ textFieldStyle.translatableTextSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.translatableTextSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TranslatablePlaceholderTextSelectorProperty = BindableProperty.Create("TranslatablePlaceholderTextSelector", typeof(Selector<string>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ if (null == textFieldStyle.translatablePlaceholderTextSelector)
+ {
+ textFieldStyle.translatablePlaceholderTextSelector = new Selector<string>();
+ }
+ textFieldStyle.translatablePlaceholderTextSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.translatablePlaceholderTextSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("Text", typeof(Selector<string>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ if (null == textFieldStyle.textSelector)
+ {
+ textFieldStyle.textSelector = new Selector<string>();
+ }
+ textFieldStyle.textSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.textSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamily", typeof(Selector<string>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ if (null == textFieldStyle.fontFamilySelector)
+ {
+ textFieldStyle.fontFamilySelector = new Selector<string>();
+ }
+ textFieldStyle.fontFamilySelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.fontFamilySelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ if (null == textFieldStyle.pointSizeSelector)
+ {
+ textFieldStyle.pointSizeSelector = new Selector<float?>();
+ }
+ textFieldStyle.pointSizeSelector.Clone((Selector<float?>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.pointSizeSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ if (null == textFieldStyle.textColorSelector)
+ {
+ textFieldStyle.textColorSelector = new Selector<Color>();
+ }
+ textFieldStyle.textColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.textColorSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PlaceholderTextColorSelectorProperty = BindableProperty.Create("PlaceholderTextColorSelector", typeof(Selector<Color>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ if (null == textFieldStyle.placeholderTextColorSelector)
+ {
+ textFieldStyle.placeholderTextColorSelector = new Selector<Color>();
+ }
+ textFieldStyle.placeholderTextColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.placeholderTextColorSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PrimaryCursorColorSelectorProperty = BindableProperty.Create("PrimaryCursorColorSelector", typeof(Selector<Color>), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ if (null == textFieldStyle.primaryCursorColorSelector)
+ {
+ textFieldStyle.primaryCursorColorSelector = new Selector<Color>();
+ }
+ textFieldStyle.primaryCursorColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.primaryCursorColorSelector;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PlaceholderTextProperty = BindableProperty.Create("PlaceholderText", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.placeholderText = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.placeholderText;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PlaceholderTextFocusedProperty = BindableProperty.Create("PlaceholderTextFocused", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.placeholderTextFocused = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.placeholderTextFocused;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MaxLengthProperty = BindableProperty.Create("MaxLength", typeof(int?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.maxLength = (int?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.maxLength;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ExceedPolicyProperty = BindableProperty.Create("ExceedPolicy", typeof(int?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.exceedPolicy = (int?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.exceedPolicy;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create("HorizontalAlignment", typeof(HorizontalAlignment?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.horizontalAlignment = (HorizontalAlignment?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.horizontalAlignment;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create("VerticalAlignment", typeof(VerticalAlignment?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.verticalAlignment = (VerticalAlignment?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.verticalAlignment;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SecondaryCursorColorProperty = BindableProperty.Create("SecondaryCursorColor", typeof(Vector4), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.secondaryCursorColor = (Vector4)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.secondaryCursorColor;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EnableCursorBlinkProperty = BindableProperty.Create("EnableCursorBlink", typeof(bool?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.enableCursorBlink = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.enableCursorBlink;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CursorBlinkIntervalProperty = BindableProperty.Create("CursorBlinkInterval", typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.cursorBlinkInterval = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.cursorBlinkInterval;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CursorBlinkDurationProperty = BindableProperty.Create("CursorBlinkDuration", typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.cursorBlinkDuration = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.cursorBlinkDuration;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CursorWidthProperty = BindableProperty.Create("CursorWidth", typeof(int?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.cursorWidth = (int?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.cursorWidth;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty GrabHandleImageProperty = BindableProperty.Create("GrabHandleImage", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.grabHandleImage = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.grabHandleImage;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty GrabHandlePressedImageProperty = BindableProperty.Create("GrabHandlePressedImage", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.grabHandlePressedImage = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.grabHandlePressedImage;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScrollThresholdProperty = BindableProperty.Create("ScrollThreshold", typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.scrollThreshold = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.scrollThreshold;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScrollSpeedProperty = BindableProperty.Create("ScrollSpeed", typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.scrollSpeed = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.scrollSpeed;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SelectionHighlightColorProperty = BindableProperty.Create("SelectionHighlightColor", typeof(Vector4), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.selectionHighlightColor = (Vector4)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.selectionHighlightColor;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty DecorationBoundingBoxProperty = BindableProperty.Create("DecorationBoundingBox", typeof(Rectangle), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.decorationBoundingBox = (Rectangle)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.decorationBoundingBox;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InputColorProperty = BindableProperty.Create("InputColor", typeof(Vector4), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.inputColor = (Vector4)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.inputColor;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create("EnableMarkup", typeof(bool?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.enableMarkup = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.enableMarkup;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InputFontFamilyProperty = BindableProperty.Create("InputFontFamily", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.inputFontFamily = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.inputFontFamily;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InputPointSizeProperty = BindableProperty.Create("InputPointSize", typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.inputPointSize = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.inputPointSize;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InputUnderlineProperty = BindableProperty.Create("InputUnderline", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.inputUnderline = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.inputUnderline;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InputShadowProperty = BindableProperty.Create("InputShadow", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.inputShadow = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.inputShadow;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EmbossProperty = BindableProperty.Create("Emboss", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.emboss = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.emboss;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InputEmbossProperty = BindableProperty.Create("InputEmboss", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.inputEmboss = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.inputEmboss;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InputOutlineProperty = BindableProperty.Create("InputOutline", typeof(string), typeof(TextFieldStyle), String.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.inputOutline = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.inputOutline;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create("PixelSize", typeof(float?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.pixelSize = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.pixelSize;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EnableSelectionProperty = BindableProperty.Create("EnableSelection", typeof(bool?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.enableSelection = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.enableSelection;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EllipsisProperty = BindableProperty.Create("Ellipsis", typeof(bool?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.ellipsis = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.ellipsis;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create("MatchSystemLanguageDirection", typeof(bool?), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ textFieldStyle.matchSystemLanguageDirection = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextFieldStyle)bindable;
+ return textFieldStyle.matchSystemLanguageDirection;
+ });
+
+ private Selector<string> translatableTextSelector;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<string> TranslatableText
+ {
+ get
+ {
+ return (Selector<string>)GetValue(TranslatableTextSelectorProperty);
+ }
+ set
+ {
+ SetValue(TranslatableTextSelectorProperty, value);
+ }
+ }
+
+ private Selector<string> translatablePlaceholderTextSelector;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<string> TranslatablePlaceholderText
+ {
+ get
+ {
+ return (Selector<string>)GetValue(TranslatablePlaceholderTextSelectorProperty);
+ }
+ set
+ {
+ SetValue(TranslatablePlaceholderTextSelectorProperty, value);
+ }
+ }
+
+ private Selector<string> textSelector;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<string> Text
+ {
+ get
+ {
+ return (Selector<string>)GetValue(TextSelectorProperty);
+ }
+ set
+ {
+ SetValue(TextSelectorProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string PlaceholderText
+ {
+ get
+ {
+ string temp = (string)GetValue(PlaceholderTextProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PlaceholderTextProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string PlaceholderTextFocused
+ {
+ get
+ {
+ string temp = (string)GetValue(PlaceholderTextFocusedProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PlaceholderTextFocusedProperty, value);
+ }
+ }
+
+ private Selector<string> fontFamilySelector;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<string> FontFamily
+ {
+ get
+ {
+ return (Selector<string>)GetValue(FontFamilySelectorProperty);
+ }
+ set
+ {
+ SetValue(FontFamilySelectorProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? MaxLength
+ {
+ get
+ {
+ int? temp = (int?)GetValue(MaxLengthProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(MaxLengthProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? ExceedPolicy
+ {
+ get
+ {
+ int? temp = (int?)GetValue(ExceedPolicyProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ExceedPolicyProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public HorizontalAlignment? HorizontalAlignment
+ {
+ get
+ {
+ HorizontalAlignment? temp = (HorizontalAlignment?)GetValue(HorizontalAlignmentProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(HorizontalAlignmentProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public VerticalAlignment? VerticalAlignment
+ {
+ get
+ {
+ VerticalAlignment? temp = (VerticalAlignment?)GetValue(VerticalAlignmentProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(VerticalAlignmentProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector4 SecondaryCursorColor
+ {
+ get
+ {
+ Vector4 temp = (Vector4)GetValue(SecondaryCursorColorProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SecondaryCursorColorProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? EnableCursorBlink
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(EnableCursorBlinkProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EnableCursorBlinkProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? CursorBlinkInterval
+ {
+ get
+ {
+ float? temp = (float?)GetValue(CursorBlinkIntervalProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(CursorBlinkIntervalProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? CursorBlinkDuration
+ {
+ get
+ {
+ float? temp = (float?)GetValue(CursorBlinkDurationProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(CursorBlinkDurationProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? CursorWidth
+ {
+ get
+ {
+ int? temp = (int?)GetValue(CursorWidthProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(CursorWidthProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string GrabHandleImage
+ {
+ get
+ {
+ string temp = (string)GetValue(GrabHandleImageProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(GrabHandleImageProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string GrabHandlePressedImage
+ {
+ get
+ {
+ string temp = (string)GetValue(GrabHandlePressedImageProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(GrabHandlePressedImageProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? ScrollThreshold
+ {
+ get
+ {
+ float? temp = (float?)GetValue(ScrollThresholdProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ScrollThresholdProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? ScrollSpeed
+ {
+ get
+ {
+ float? temp = (float?)GetValue(ScrollSpeedProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ScrollSpeedProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector4 SelectionHighlightColor
+ {
+ get
+ {
+ Vector4 temp = (Vector4)GetValue(SelectionHighlightColorProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SelectionHighlightColorProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Rectangle DecorationBoundingBox
+ {
+ get
+ {
+ Rectangle temp = (Rectangle)GetValue(DecorationBoundingBoxProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(DecorationBoundingBoxProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector4 InputColor
+ {
+ get
+ {
+ Vector4 temp = (Vector4)GetValue(InputColorProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InputColorProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? EnableMarkup
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(EnableMarkupProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EnableMarkupProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string InputFontFamily
+ {
+ get
+ {
+ string temp = (string)GetValue(InputFontFamilyProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InputFontFamilyProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? InputPointSize
+ {
+ get
+ {
+ float? temp = (float?)GetValue(InputPointSizeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InputPointSizeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string InputUnderline
+ {
+ get
+ {
+ string temp = (string)GetValue(InputUnderlineProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InputUnderlineProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string InputShadow
+ {
+ get
+ {
+ string temp = (string)GetValue(InputShadowProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InputShadowProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string Emboss
+ {
+ get
+ {
+ string temp = (string)GetValue(EmbossProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EmbossProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string InputEmboss
+ {
+ get
+ {
+ string temp = (string)GetValue(InputEmbossProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InputEmbossProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string InputOutline
+ {
+ get
+ {
+ string temp = (string)GetValue(InputOutlineProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InputOutlineProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? PixelSize
+ {
+ get
+ {
+ float? temp = (float?)GetValue(PixelSizeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PixelSizeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? EnableSelection
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(EnableSelectionProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EnableSelectionProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? Ellipsis
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(EllipsisProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EllipsisProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? MatchSystemLanguageDirection
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(MatchSystemLanguageDirectionProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(MatchSystemLanguageDirectionProperty, value);
+ }
+ }
+
+ private Selector<Color> textColorSelector;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<Color> TextColor
+ {
+ get
+ {
+ return (Selector<Color>)GetValue(TextColorSelectorProperty);
+ }
+ set
+ {
+ SetValue(TextColorSelectorProperty, value);
+ }
+ }
+
+ private Selector<float?> pointSizeSelector;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<float?> PointSize
+ {
+ get
+ {
+ return (Selector<float?>)GetValue(PointSizeSelectorProperty);
+ }
+ set
+ {
+ SetValue(PointSizeSelectorProperty, value);
+ }
+ }
+
+ private Selector<Color> placeholderTextColorSelector;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<Color> PlaceholderTextColor
+ {
+ get
+ {
+ return (Selector<Color>)GetValue(PlaceholderTextColorSelectorProperty);
+ }
+ set
+ {
+ SetValue(PlaceholderTextColorSelectorProperty, value);
+ }
+ }
+
+ private Selector<Color> primaryCursorColorSelector;
+ /// <summary>
+ /// Gets or sets primary cursor color.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<Color> PrimaryCursorColor
+ {
+ get
+ {
+ return (Selector<Color>)GetValue(PrimaryCursorColorSelectorProperty);
+ }
+ set
+ {
+ SetValue(PrimaryCursorColorSelectorProperty, value);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.BaseComponents
+{
+ /// <summary>
+ /// The base class for Children attributes in Components.
+ /// </summary>
+ /// 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 TextLabelStyle : ViewStyle
+ {
+ private bool? multiLine;
+ private HorizontalAlignment? horizontalAlignment;
+ private VerticalAlignment? verticalAlignment;
+ private bool? enableMarkup;
+ private bool? enableAutoScroll;
+ private int? autoScrollSpeed;
+ private int? autoScrollLoopCount;
+ private float? autoScrollGap;
+ private float? lineSpacing;
+ private string emboss;
+ private float? pixelSize;
+ private bool? ellipsis;
+ private float? autoScrollLoopDelay;
+ private AutoScrollStopMode? autoScrollStopMode;
+ private LineWrapMode? lineWrapMode;
+ private VerticalLineAlignment? verticalLineAlignment;
+ private bool? matchSystemLanguageDirection;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ textFieldStyle.TranslatableTextSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ return textFieldStyle.TranslatableTextSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ textFieldStyle.TextSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ return textFieldStyle.TextSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ textFieldStyle.FontFamilySelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ return textFieldStyle.FontFamilySelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ textFieldStyle.PointSizeSelector.Clone((Selector<float?>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ return textFieldStyle.PointSizeSelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ textFieldStyle.TextColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textFieldStyle = (TextLabelStyle)bindable;
+ return textFieldStyle.TextColorSelector;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MultiLineProperty = BindableProperty.Create("MultiLine", typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.multiLine = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.multiLine;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create("HorizontalAlignment", typeof(HorizontalAlignment?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.horizontalAlignment = (HorizontalAlignment?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.horizontalAlignment;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create("VerticalAlignment", typeof(VerticalAlignment?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.verticalAlignment = (VerticalAlignment?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.verticalAlignment;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create("EnableMarkup", typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.enableMarkup = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.enableMarkup;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EnableAutoScrollProperty = BindableProperty.Create("EnableAutoScroll", typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.enableAutoScroll = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.enableAutoScroll;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty AutoScrollSpeedProperty = BindableProperty.Create("AutoScrollSpeed", typeof(int?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.autoScrollSpeed = (int?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.autoScrollSpeed;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty AutoScrollLoopCountProperty = BindableProperty.Create("AutoScrollLoopCount", typeof(int?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.autoScrollLoopCount = (int?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.autoScrollLoopCount;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty AutoScrollGapProperty = BindableProperty.Create("AutoScrollGap", typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.autoScrollGap = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.autoScrollGap;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create("LineSpacing", typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.lineSpacing = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.lineSpacing;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EmbossProperty = BindableProperty.Create("Emboss", typeof(string), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.emboss = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.emboss;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create("PixelSize", typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.pixelSize = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.pixelSize;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty EllipsisProperty = BindableProperty.Create("Ellipsis", typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.ellipsis = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.ellipsis;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create("AutoScrollLoopDelay", typeof(float?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.autoScrollLoopDelay = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.autoScrollLoopDelay;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty AutoScrollStopModeProperty = BindableProperty.Create("AutoScrollStopMode", typeof(AutoScrollStopMode?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.autoScrollStopMode = (AutoScrollStopMode?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.autoScrollStopMode;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create("LineWrapMode", typeof(LineWrapMode?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.lineWrapMode = (LineWrapMode?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.lineWrapMode;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty VerticalLineAlignmentProperty = BindableProperty.Create("VerticalLineAlignment", typeof(VerticalLineAlignment?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.verticalLineAlignment = (VerticalLineAlignment?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.verticalLineAlignment;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create("MatchSystemLanguageDirection", typeof(bool?), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ textLabelStyle.matchSystemLanguageDirection = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabelStyle = (TextLabelStyle)bindable;
+ return textLabelStyle.matchSystemLanguageDirection;
+ });
+
+ private Selector<string> translatableTextSelector;
+ private Selector<string> TranslatableTextSelector
+ {
+ get
+ {
+ if (null == translatableTextSelector)
+ {
+ translatableTextSelector = new Selector<string>();
+ }
+ return translatableTextSelector;
+ }
+ }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<string> TranslatableText
+ {
+ get
+ {
+ return (Selector<string>)GetValue(TranslatableTextSelectorProperty);
+ }
+ set
+ {
+ SetValue(TranslatableTextSelectorProperty, value);
+ }
+ }
+
+ private Selector<string> fontFamilySelector;
+ private Selector<string> FontFamilySelector
+ {
+ get
+ {
+ if (null == fontFamilySelector)
+ {
+ fontFamilySelector = new Selector<string>();
+ }
+ return fontFamilySelector;
+ }
+ }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<string> FontFamily
+ {
+ get
+ {
+ return (Selector<string>)GetValue(FontFamilySelectorProperty);
+ }
+ set
+ {
+ SetValue(FontFamilySelectorProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? MultiLine
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(MultiLineProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(MultiLineProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public HorizontalAlignment? HorizontalAlignment
+ {
+ get
+ {
+ HorizontalAlignment? temp = (HorizontalAlignment?)GetValue(HorizontalAlignmentProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(HorizontalAlignmentProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public VerticalAlignment? VerticalAlignment
+ {
+ get
+ {
+ VerticalAlignment? temp = (VerticalAlignment?)GetValue(VerticalAlignmentProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(VerticalAlignmentProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? EnableMarkup
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(EnableMarkupProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EnableMarkupProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? EnableAutoScroll
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(EnableAutoScrollProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EnableAutoScrollProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? AutoScrollSpeed
+ {
+ get
+ {
+ int? temp = (int?)GetValue(AutoScrollSpeedProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(AutoScrollSpeedProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? AutoScrollLoopCount
+ {
+ get
+ {
+ int? temp = (int?)GetValue(AutoScrollLoopCountProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(AutoScrollLoopCountProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? AutoScrollGap
+ {
+ get
+ {
+ float? temp = (float?)GetValue(AutoScrollGapProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(AutoScrollGapProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? LineSpacing
+ {
+ get
+ {
+ float? temp = (float?)GetValue(LineSpacingProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(LineSpacingProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string Emboss
+ {
+ get
+ {
+ string temp = (string)GetValue(EmbossProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EmbossProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? PixelSize
+ {
+ get
+ {
+ float? temp = (float?)GetValue(PixelSizeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PixelSizeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? Ellipsis
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(EllipsisProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(EllipsisProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? AutoScrollLoopDelay
+ {
+ get
+ {
+ float? temp = (float?)GetValue(AutoScrollLoopDelayProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(AutoScrollLoopDelayProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public AutoScrollStopMode? AutoScrollStopMode
+ {
+ get
+ {
+ AutoScrollStopMode? temp = (AutoScrollStopMode?)GetValue(AutoScrollStopModeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(AutoScrollStopModeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public LineWrapMode? LineWrapMode
+ {
+ get
+ {
+ LineWrapMode? temp = (LineWrapMode?)GetValue(LineWrapModeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(LineWrapModeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public VerticalLineAlignment? VerticalLineAlignment
+ {
+ get
+ {
+ VerticalLineAlignment? temp = (VerticalLineAlignment?)GetValue(VerticalLineAlignmentProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(VerticalLineAlignmentProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? MatchSystemLanguageDirection
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(MatchSystemLanguageDirectionProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(MatchSystemLanguageDirectionProperty, value);
+ }
+ }
+
+ private Selector<string> textSelector;
+ private Selector<string> TextSelector
+ {
+ get
+ {
+ if (null == textSelector)
+ {
+ textSelector = new Selector<string>();
+ }
+ return textSelector;
+ }
+ }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<string> Text
+ {
+ get
+ {
+ return (Selector<string>)GetValue(TextSelectorProperty);
+ }
+ set
+ {
+ SetValue(TextSelectorProperty, value);
+ }
+ }
+
+ private Selector<Color> textColorSelector;
+ private Selector<Color> TextColorSelector
+ {
+ get
+ {
+ if (null == textColorSelector)
+ {
+ textColorSelector = new Selector<Color>();
+ }
+ return textColorSelector;
+ }
+ }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<Color> TextColor
+ {
+ get
+ {
+ return (Selector<Color>)GetValue(TextColorSelectorProperty);
+ }
+ set
+ {
+ SetValue(TextColorSelectorProperty, value);
+ }
+ }
+
+ private Selector<float?> pointSizeSelector;
+ private Selector<float?> PointSizeSelector
+ {
+ get
+ {
+ if (null == pointSizeSelector)
+ {
+ pointSizeSelector = new Selector<float?>();
+ }
+ return pointSizeSelector;
+ }
+ }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<float?> PointSize
+ {
+ get
+ {
+ return (Selector<float?>)GetValue(PointSizeSelectorProperty);
+ }
+ set
+ {
+ SetValue(PointSizeSelectorProperty, value);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.BaseComponents
+{
+ /// <summary>
+ /// The base class for Children attributes in Components.
+ /// </summary>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ViewStyle : BindableObject
+ {
+ private string styleName;
+ private string backgroundImage;
+ private View.States? state;
+ private View.States? subState;
+ private float? flex;
+ private int? alignSelf;
+ private Vector4 flexMargin;
+ private Vector2 cellIndex;
+ private float? rowSpan;
+ private float? columnSpan;
+ private HorizontalAlignmentType? cellHorizontalAlignment;
+ private VerticalAlignmentType? cellVerticalAlignment;
+ private View leftFocusableView;
+ private View rightFocusableView;
+ private View upFocusableView;
+ private View downFocusableView;
+ private bool? focusable;
+ private Size2D size2D;
+ private Position2D position2D;
+ private bool? positionUsesPivotPoint;
+ private int? siblingOrder;
+ private Position parentOrigin;
+ private Position pivotPoint;
+ private float? sizeWidth;
+ private float? sizeHeight;
+ private Position position;
+ private float? positionX;
+ private float? positionY;
+ private float? positionZ;
+ private Rotation orientation;
+ private Vector3 scale;
+ private float? scaleX;
+ private float? scaleY;
+ private float? scaleZ;
+ private string name;
+ private bool? sensitive;
+ private bool? leaveRequired;
+ private bool? inheritOrientation;
+ private bool? inheritScale;
+ private DrawModeType? drawMode;
+ private Vector3 sizeModeFactor;
+ private ResizePolicyType? widthResizePolicy;
+ private ResizePolicyType? heightResizePolicy;
+ private SizeScalePolicyType? sizeScalePolicy;
+ private bool? widthForHeight;
+ private bool? heightForWidth;
+ private Extents padding;
+ private Size2D minimumSize;
+ private Size2D maximumSize;
+ private bool? inheritPosition;
+ private ClippingModeType? clippingMode;
+ private Size size;
+ private bool? inheritLayoutDirection;
+ private ViewLayoutDirectionType? layoutDirection;
+ private Extents margin;
+ private float? weight;
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty StyleNameProperty = BindableProperty.Create("StyleName", typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.styleName = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.styleName;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("BackgroundImage", typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.backgroundImage = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.backgroundImage;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty StateProperty = BindableProperty.Create("State", typeof(View.States?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.state = (View.States?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.state;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SubStateProperty = BindableProperty.Create("SubState", typeof(View.States?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.subState = (View.States?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.subState;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FlexProperty = BindableProperty.Create("Flex", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.flex = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.flex;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty AlignSelfProperty = BindableProperty.Create("AlignSelf", typeof(int?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.alignSelf = (int?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.alignSelf;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FlexMarginProperty = BindableProperty.Create("FlexMargin", typeof(Vector4), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.flexMargin = (Vector4)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.flexMargin;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CellIndexProperty = BindableProperty.Create("CellIndex", typeof(Vector2), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.cellIndex = (Vector2)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.cellIndex;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty RowSpanProperty = BindableProperty.Create("RowSpan", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.rowSpan = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.rowSpan;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ColumnSpanProperty = BindableProperty.Create("ColumnSpan", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.columnSpan = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.columnSpan;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CellHorizontalAlignmentProperty = BindableProperty.Create("CellHorizontalAlignment", typeof(HorizontalAlignmentType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.cellHorizontalAlignment = (HorizontalAlignmentType?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.cellHorizontalAlignment;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty CellVerticalAlignmentProperty = BindableProperty.Create("CellVerticalAlignment", typeof(VerticalAlignmentType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.cellVerticalAlignment = (VerticalAlignmentType?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.cellVerticalAlignment;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create("LeftFocusableView", typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.leftFocusableView = (View)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.leftFocusableView;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create("RightFocusableView", typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.rightFocusableView = (View)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.rightFocusableView;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create("UpFocusableView", typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.upFocusableView = (View)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.upFocusableView;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create("DownFocusableView", typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.downFocusableView = (View)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.downFocusableView;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FocusableProperty = BindableProperty.Create("Focusable", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.focusable = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.focusable;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty Size2DProperty = BindableProperty.Create("Size2D", typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.size2D = (Size2D)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.size2D;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(ViewStyle), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.OpacitySelector.Clone((Selector<float?>)newValue);
+ }),
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.OpacitySelector;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty Position2DProperty = BindableProperty.Create("Position2D", typeof(Position2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.position2D = (Position2D)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.position2D;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create("PositionUsesPivotPoint", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.positionUsesPivotPoint = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.positionUsesPivotPoint;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SiblingOrderProperty = BindableProperty.Create("SiblingOrder", typeof(int?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.siblingOrder = (int?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.siblingOrder;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ParentOriginProperty = BindableProperty.Create("ParentOrigin", typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.parentOrigin = (Position)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.parentOrigin;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PivotPointProperty = BindableProperty.Create("PivotPoint", typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.pivotPoint = (Position)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.pivotPoint;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeWidthProperty = BindableProperty.Create("SizeWidth", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.sizeWidth = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.sizeWidth;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeHeightProperty = BindableProperty.Create("SizeHeight", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.sizeHeight = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.sizeHeight;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionProperty = BindableProperty.Create("Position", typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.position = (Position)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.position;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionXProperty = BindableProperty.Create("PositionX", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.positionX = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.positionX;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionYProperty = BindableProperty.Create("PositionY", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.positionY = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.positionY;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PositionZProperty = BindableProperty.Create("PositionZ", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.positionZ = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.positionZ;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty OrientationProperty = BindableProperty.Create("Orientation", typeof(Rotation), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.orientation = (Rotation)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.orientation;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScaleProperty = BindableProperty.Create("Scale", typeof(Vector3), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.scale = (Vector3)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.scale;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScaleXProperty = BindableProperty.Create("ScaleX", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.scaleX = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.scaleX;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScaleYProperty = BindableProperty.Create("ScaleY", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.scaleY = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.scaleY;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ScaleZProperty = BindableProperty.Create("ScaleZ", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.scaleZ = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.scaleZ;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty NameProperty = BindableProperty.Create("Name", typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.name = (string)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.name;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SensitiveProperty = BindableProperty.Create("Sensitive", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.sensitive = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.sensitive;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create("LeaveRequired", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.leaveRequired = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.leaveRequired;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create("InheritOrientation", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.inheritOrientation = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.inheritOrientation;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InheritScaleProperty = BindableProperty.Create("InheritScale", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.inheritScale = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.inheritScale;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty DrawModeProperty = BindableProperty.Create("DrawMode", typeof(DrawModeType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.drawMode = (DrawModeType?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.drawMode;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create("SizeModeFactor", typeof(Vector3), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.sizeModeFactor = (Vector3)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.sizeModeFactor;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create("WidthResizePolicy", typeof(ResizePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.widthResizePolicy = (ResizePolicyType?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.widthResizePolicy;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create("HeightResizePolicy", typeof(ResizePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.heightResizePolicy = (ResizePolicyType?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.heightResizePolicy;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create("SizeScalePolicy", typeof(SizeScalePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.sizeScalePolicy = (SizeScalePolicyType?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.sizeScalePolicy;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create("WidthForHeight", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.widthForHeight = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.widthForHeight;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create("HeightForWidth", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.heightForWidth = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.heightForWidth;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PaddingProperty = BindableProperty.Create("Padding", typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ if (null == viewStyle.padding)
+ {
+ viewStyle.padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ Extents extents = new Extents(start, end, top, bottom);
+ viewStyle.padding.CopyFrom(extents);
+ viewStyle.SetValue(PaddingProperty, extents);
+ }, 0, 0, 0, 0);
+ }
+ viewStyle.padding.CopyFrom((Extents)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+
+ if (null == viewStyle.padding)
+ {
+ viewStyle.padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ Extents extents = new Extents(start, end, top, bottom);
+ viewStyle.padding.CopyFrom(extents);
+ viewStyle.SetValue(PaddingProperty, extents);
+ }, 0, 0, 0, 0);
+ }
+
+ return viewStyle.padding;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create("MinimumSize", typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.minimumSize = (Size2D)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.minimumSize;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create("MaximumSize", typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.maximumSize = (Size2D)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.maximumSize;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create("InheritPosition", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.inheritPosition = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.inheritPosition;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create("ClippingMode", typeof(ClippingModeType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.clippingMode = (ClippingModeType?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.clippingMode;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SizeProperty = BindableProperty.Create("Size", typeof(Size), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.size = (Size)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.size;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create("InheritLayoutDirection", typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.inheritLayoutDirection = (bool?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.inheritLayoutDirection;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create("LayoutDirection", typeof(ViewLayoutDirectionType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.layoutDirection = (ViewLayoutDirectionType?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.layoutDirection;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty MarginProperty = BindableProperty.Create("Margin", typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.margin = (Extents)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+
+ if (null == viewStyle.padding)
+ {
+ viewStyle.margin = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
+ {
+ Extents extents = new Extents(start, end, top, bottom);
+ viewStyle.margin.CopyFrom(extents);
+ viewStyle.SetValue(MarginProperty, extents);
+ }, 0, 0, 0, 0);
+ }
+
+ return viewStyle.margin;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty WeightProperty = BindableProperty.Create("Weight", typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.weight = (float?)newValue;
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.weight;
+ });
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ viewStyle.BackgroundColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var viewStyle = (ViewStyle)bindable;
+ return viewStyle.BackgroundColorSelector;
+ });
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ViewStyle()
+ {
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ViewStyle(ViewStyle viewAttributes)
+ {
+ if (null != viewAttributes)
+ {
+ this.CopyFrom(viewAttributes);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string StyleName
+ {
+ get
+ {
+ string temp = (string)GetValue(StyleNameProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(StyleNameProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string BackgroundImage
+ {
+ get
+ {
+ string temp = (string)GetValue(BackgroundImageProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(BackgroundImageProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View.States? State
+ {
+ get
+ {
+ View.States? temp = (View.States?)GetValue(StateProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(StateProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View.States? SubState
+ {
+ get
+ {
+ View.States? temp = (View.States?)GetValue(SubStateProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SubStateProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? Flex
+ {
+ get
+ {
+ float? temp = (float?)GetValue(FlexProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(FlexProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? AlignSelf
+ {
+ get
+ {
+ int? temp = (int?)GetValue(AlignSelfProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(AlignSelfProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector4 FlexMargin
+ {
+ get
+ {
+ Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(FlexMarginProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector2 CellIndex
+ {
+ get
+ {
+ Vector2 temp = (Vector2)GetValue(CellIndexProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(CellIndexProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? RowSpan
+ {
+ get
+ {
+ float? temp = (float?)GetValue(RowSpanProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(RowSpanProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? ColumnSpan
+ {
+ get
+ {
+ float? temp = (float?)GetValue(ColumnSpanProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ColumnSpanProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public HorizontalAlignmentType? CellHorizontalAlignment
+ {
+ get
+ {
+ HorizontalAlignmentType? temp = (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(CellHorizontalAlignmentProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public VerticalAlignmentType? CellVerticalAlignment
+ {
+ get
+ {
+ VerticalAlignmentType? temp = (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(CellVerticalAlignmentProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View LeftFocusableView
+ {
+ get
+ {
+ View temp = (View)GetValue(LeftFocusableViewProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(LeftFocusableViewProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View RightFocusableView
+ {
+ get
+ {
+ View temp = (View)GetValue(RightFocusableViewProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(RightFocusableViewProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View UpFocusableView
+ {
+ get
+ {
+ View temp = (View)GetValue(UpFocusableViewProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(UpFocusableViewProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View DownFocusableView
+ {
+ get
+ {
+ View temp = (View)GetValue(DownFocusableViewProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(DownFocusableViewProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? Focusable
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(FocusableProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(FocusableProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Size2D Size2D
+ {
+ get
+ {
+ Size2D temp = (Size2D)GetValue(Size2DProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(Size2DProperty, value);
+ }
+ }
+
+ private Selector<float?> opacitySelector;
+ private Selector<float?> OpacitySelector
+ {
+ get
+ {
+ if (null == opacitySelector)
+ {
+ opacitySelector = new Selector<float?>();
+ }
+ return opacitySelector;
+ }
+ }
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<float?> Opacity
+ {
+ get
+ {
+ return (Selector<float?>)GetValue(OpacitySelectorProperty);
+ }
+ set
+ {
+ SetValue(OpacitySelectorProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Position2D Position2D
+ {
+ get
+ {
+ Position2D temp = (Position2D)GetValue(Position2DProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(Position2DProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? PositionUsesPivotPoint
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(PositionUsesPivotPointProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PositionUsesPivotPointProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? SiblingOrder
+ {
+ get
+ {
+ int? temp = (int?)GetValue(SiblingOrderProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SiblingOrderProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Position ParentOrigin
+ {
+ get
+ {
+ Position temp = (Position)GetValue(ParentOriginProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ParentOriginProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Position PivotPoint
+ {
+ get
+ {
+ Position temp = (Position)GetValue(PivotPointProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PivotPointProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? SizeWidth
+ {
+ get
+ {
+ float? temp = (float?)GetValue(SizeWidthProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SizeWidthProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? SizeHeight
+ {
+ get
+ {
+ float? temp = (float?)GetValue(SizeHeightProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SizeHeightProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Position Position
+ {
+ get
+ {
+ Position temp = (Position)GetValue(PositionProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PositionProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? PositionX
+ {
+ get
+ {
+ float? temp = (float?)GetValue(PositionXProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PositionXProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? PositionY
+ {
+ get
+ {
+ float? temp = (float?)GetValue(PositionYProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PositionYProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? PositionZ
+ {
+ get
+ {
+ float? temp = (float?)GetValue(PositionZProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PositionZProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Rotation Orientation
+ {
+ get
+ {
+ Rotation temp = (Rotation)GetValue(OrientationProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(OrientationProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector3 Scale
+ {
+ get
+ {
+ Vector3 temp = (Vector3)GetValue(ScaleProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ScaleProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? ScaleX
+ {
+ get
+ {
+ float? temp = (float?)GetValue(ScaleXProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ScaleXProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? ScaleY
+ {
+ get
+ {
+ float? temp = (float?)GetValue(ScaleYProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ScaleYProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? ScaleZ
+ {
+ get
+ {
+ float? temp = (float?)GetValue(ScaleZProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ScaleZProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string Name
+ {
+ get
+ {
+ string temp = (string)GetValue(NameProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(NameProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? Sensitive
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(SensitiveProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SensitiveProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? LeaveRequired
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(LeaveRequiredProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(LeaveRequiredProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? InheritOrientation
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(InheritOrientationProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InheritOrientationProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? InheritScale
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(InheritScaleProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InheritScaleProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public DrawModeType? DrawMode
+ {
+ get
+ {
+ DrawModeType? temp = (DrawModeType?)GetValue(DrawModeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(DrawModeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector3 SizeModeFactor
+ {
+ get
+ {
+ Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SizeModeFactorProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ResizePolicyType? WidthResizePolicy
+ {
+ get
+ {
+ ResizePolicyType? temp = (ResizePolicyType?)GetValue(WidthResizePolicyProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(WidthResizePolicyProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ResizePolicyType? HeightResizePolicy
+ {
+ get
+ {
+ ResizePolicyType? temp = (ResizePolicyType?)GetValue(HeightResizePolicyProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(HeightResizePolicyProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public SizeScalePolicyType? SizeScalePolicy
+ {
+ get
+ {
+ SizeScalePolicyType? temp = (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SizeScalePolicyProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? WidthForHeight
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(WidthForHeightProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(WidthForHeightProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? HeightForWidth
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(HeightForWidthProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(HeightForWidthProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Extents Padding
+ {
+ get
+ {
+ Extents temp = (Extents)GetValue(PaddingProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(PaddingProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Size2D MinimumSize
+ {
+ get
+ {
+ Size2D temp = (Size2D)GetValue(MinimumSizeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(MinimumSizeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Size2D MaximumSize
+ {
+ get
+ {
+ Size2D temp = (Size2D)GetValue(MaximumSizeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(MaximumSizeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? InheritPosition
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(InheritPositionProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InheritPositionProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ClippingModeType? ClippingMode
+ {
+ get
+ {
+ ClippingModeType? temp = (ClippingModeType?)GetValue(ClippingModeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(ClippingModeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Size Size
+ {
+ get
+ {
+ Size temp = (Size)GetValue(SizeProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(SizeProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool? InheritLayoutDirection
+ {
+ get
+ {
+ bool? temp = (bool?)GetValue(InheritLayoutDirectionProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(InheritLayoutDirectionProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ViewLayoutDirectionType? LayoutDirection
+ {
+ get
+ {
+ ViewLayoutDirectionType? temp = (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(LayoutDirectionProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Extents Margin
+ {
+ get
+ {
+ Extents temp = (Extents)GetValue(MarginProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(MarginProperty, value);
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float? Weight
+ {
+ get
+ {
+ float? temp = (float?)GetValue(WeightProperty);
+ return temp;
+ }
+ set
+ {
+ SetValue(WeightProperty, value);
+ }
+ }
+
+ private Selector<Color> backgroundColorSelector;
+ private Selector<Color> BackgroundColorSelector
+ {
+ get
+ {
+ if (null == backgroundColorSelector)
+ {
+ backgroundColorSelector = new Selector<Color>();
+ }
+ return backgroundColorSelector;
+ }
+ }
+ /// <summary>
+ /// View BackgroundColor
+ /// </summary>
+ /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Selector<Color> BackgroundColor
+ {
+ get
+ {
+ return (Selector<Color>)GetValue(BackgroundColorSelectorProperty);
+ }
+ set
+ {
+ SetValue(BackgroundColorSelectorProperty, value);
+ }
+ }
+ }
+}
using System;
using System.Globalization;
using System.ComponentModel;
+using Tizen.NUI.Binding;
namespace Tizen.NUI.BaseComponents
{
private bool systemlangTextFlag = false;
private InputMethodContext inputMethodCotext = null;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TextFieldStyle Style => ViewStyle as TextFieldStyle;
+
/// <summary>
/// Creates the TextField control.
/// </summary>
SetVisible(shown);
}
+ /// <summary>
+ /// Get attribues, it is abstract function and must be override.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override ViewStyle GetViewStyle()
+ {
+ return new TextFieldStyle();
+ }
+
+ internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
+ {
+ if (!shown)
+ {
+ SetVisible(false);
+ }
+ }
+
internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextField.TextField_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
{
get
{
+ return (string)GetValue(TranslatableTextProperty);
+ }
+ set
+ {
+ SetValue(TranslatableTextProperty, value);
+ }
+ }
+ private string translatableText
+ {
+ get
+ {
return textFieldTextSid;
}
set
{
get
{
+ return (string)GetValue(TranslatablePlaceholderTextProperty);
+ }
+ set
+ {
+ SetValue(TranslatablePlaceholderTextProperty, value);
+ }
+ }
+ private string translatablePlaceholderText
+ {
+ get
+ {
return textFieldPlaceHolderTextSid;
}
set
}
}
+ internal static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.translatableTextSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.translatableTextSelector;
+ });
+ internal static readonly BindableProperty TranslatablePlaceholderTextSelectorProperty = BindableProperty.Create("TranslatablePlaceholderTextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.translatablePlaceholderTextSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.translatablePlaceholderTextSelector;
+ });
+ internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.textSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.textSelector;
+ });
+ internal static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.fontFamilySelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.fontFamilySelector;
+ });
+ internal static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.pointSizeSelector.Clone((Selector<float?>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.pointSizeSelector;
+ });
+ internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.textColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.textColorSelector;
+ });
+ internal static readonly BindableProperty PlaceholderTextColorSelectorProperty = BindableProperty.Create("PlaceholderTextColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.placeholderTextColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.placeholderTextColorSelector;
+ });
+ internal static readonly BindableProperty PrimaryCursorColorSelectorProperty = BindableProperty.Create("PrimaryCursorColorSelector", typeof(Selector<Color>), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ textField.primaryCursorColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.primaryCursorColorSelector;
+ });
+
+ private TriggerableSelector<string> _translatableTextSelector;
+ private TriggerableSelector<string> translatableTextSelector
+ {
+ get
+ {
+ if (null == _translatableTextSelector)
+ {
+ _translatableTextSelector = new TriggerableSelector<string>(this, TranslatableTextProperty);
+ }
+ return _translatableTextSelector;
+ }
+ }
+
+ private TriggerableSelector<string> _translatablePlaceholderTextSelector;
+ private TriggerableSelector<string> translatablePlaceholderTextSelector
+ {
+ get
+ {
+ if (null == _translatablePlaceholderTextSelector)
+ {
+ _translatablePlaceholderTextSelector = new TriggerableSelector<string>(this, TranslatablePlaceholderTextProperty);
+ }
+ return _translatablePlaceholderTextSelector;
+ }
+ }
+
+ private TriggerableSelector<string> _textSelector;
+ private TriggerableSelector<string> textSelector
+ {
+ get
+ {
+ if (null == _textSelector)
+ {
+ _textSelector = new TriggerableSelector<string>(this, TextProperty);
+ }
+ return _textSelector;
+ }
+ }
+
+ private TriggerableSelector<string> _fontFamilySelector;
+ private TriggerableSelector<string> fontFamilySelector
+ {
+ get
+ {
+ if (null == _fontFamilySelector)
+ {
+ _fontFamilySelector = new TriggerableSelector<string>(this, FontFamilyProperty);
+ }
+ return _fontFamilySelector;
+ }
+ }
+
+ private TriggerableSelector<Color> _textColorSelector;
+ private TriggerableSelector<Color> textColorSelector
+ {
+ get
+ {
+ if (null == _textColorSelector)
+ {
+ _textColorSelector = new TriggerableSelector<Color>(this, TextColorProperty);
+ }
+ return _textColorSelector;
+ }
+ }
+
+ private TriggerableSelector<float?> _pointSizeSelector;
+ private TriggerableSelector<float?> pointSizeSelector
+ {
+ get
+ {
+ if (null == _pointSizeSelector)
+ {
+ _pointSizeSelector = new TriggerableSelector<float?>(this, PointSizeProperty);
+ }
+ return _pointSizeSelector;
+ }
+ }
+
+ private TriggerableSelector<Color> _placeholderTextColorSelector;
+ private TriggerableSelector<Color> placeholderTextColorSelector
+ {
+ get
+ {
+ if (null == _placeholderTextColorSelector)
+ {
+ _placeholderTextColorSelector = new TriggerableSelector<Color>(this, PlaceholderTextColorProperty);
+ }
+ return _placeholderTextColorSelector;
+ }
+ }
+
+ private TriggerableSelector<Color> _primaryCursorColorSelector;
+ private TriggerableSelector<Color> primaryCursorColorSelector
+ {
+ get
+ {
+ if (null == _primaryCursorColorSelector)
+ {
+ _primaryCursorColorSelector = new TriggerableSelector<Color>(this, PrimaryCursorColorProperty);
+ }
+ return _primaryCursorColorSelector;
+ }
+ }
+
private void OnDecorationBoundingBoxChanged(int x, int y, int width, int height)
{
DecorationBoundingBox = new Rectangle(x, y, width, height);
/// <since_tizen> 3 </since_tizen>
public partial class TextField
{
+ /// <summary>
+ /// StyleNameProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TranslatableTextProperty = BindableProperty.Create(nameof(TranslatableText), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ if (newValue != null)
+ {
+ textField.translatableText = (string)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.translatableText;
+ });
+ /// <summary>
+ /// StyleNameProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TranslatablePlaceholderTextProperty = BindableProperty.Create(nameof(TranslatablePlaceholderText), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textField = (TextField)bindable;
+ if (newValue != null)
+ {
+ textField.translatablePlaceholderText = (string)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textField = (TextField)bindable;
+ return textField.translatablePlaceholderText;
+ });
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
});
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty SelectionHandleImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
+ public static readonly BindableProperty SelectionHandleImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandleImageRight), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var textField = (TextField)bindable;
if (newValue != null)
/// <since_tizen> 3 </since_tizen>
public class TextLabel : View
{
+ /// <summary>
+ /// StyleNameProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty TranslatableTextProperty = BindableProperty.Create(nameof(TranslatableText), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ if (newValue != null)
+ {
+ textLabel.translatableText = (string)newValue;
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ return textLabel.translatableText;
+ });
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
private string textLabelSid = null;
private bool systemlangTextFlag = false;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TextLabelStyle Style => ViewStyle as TextLabelStyle;
+
/// <summary>
/// Creates the TextLabel control.
/// </summary>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TextLabel(TextLabelStyle viewStyle) : this(Interop.TextLabel.TextLabel_New__SWIG_0(), true, viewStyle)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
/// <summary>
/// Creates the TextLabel with setting the status of shown or hidden.
/// </summary>
}
}
+ internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn, viewStyle)
+ {
+ if (!shown)
+ {
+ SetVisible(false);
+ }
+ }
+
internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.TextLabel.TextLabel_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
{
get
{
+ return (string)GetValue(TranslatableTextProperty);
+ }
+ set
+ {
+ SetValue(TranslatableTextProperty, value);
+ }
+ }
+ private string translatableText
+ {
+ get
+ {
+ string temp = (string)GetValue(TranslatableTextProperty);
return textLabelSid;
}
set
}
/// <summary>
+ /// Get attribues, it is abstract function and must be override.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override ViewStyle GetViewStyle()
+ {
+ return new TextLabelStyle();
+ }
+
+ internal static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ textLabel.TranslatableTextSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ return textLabel.TranslatableTextSelector;
+ });
+ internal static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ textLabel.textSelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ return textLabel.textSelector;
+ });
+ internal static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector<string>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ textLabel.fontFamilySelector.Clone((Selector<string>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ return textLabel.fontFamilySelector;
+ });
+ internal static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector<float?>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ textLabel.pointSizeSelector.Clone((Selector<float?>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ return textLabel.pointSizeSelector;
+ });
+ internal static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector<Color>), typeof(TextLabel), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ textLabel.textColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var textLabel = (TextLabel)bindable;
+ return textLabel.textColorSelector;
+ });
+
+ private TriggerableSelector<string> translatableTextSelector;
+ private TriggerableSelector<string> TranslatableTextSelector
+ {
+ get
+ {
+ if (null == translatableTextSelector)
+ {
+ translatableTextSelector = new TriggerableSelector<string>(this, TranslatableTextProperty);
+ }
+ return translatableTextSelector;
+ }
+ }
+
+ private TriggerableSelector<string> _textSelector;
+ private TriggerableSelector<string> textSelector
+ {
+ get
+ {
+ if (null == _textSelector)
+ {
+ _textSelector = new TriggerableSelector<string>(this, TextProperty);
+ }
+ return _textSelector;
+ }
+ }
+
+ private TriggerableSelector<string> _fontFamilySelector;
+ private TriggerableSelector<string> fontFamilySelector
+ {
+ get
+ {
+ if (null == _fontFamilySelector)
+ {
+ _fontFamilySelector = new TriggerableSelector<string>(this, FontFamilyProperty);
+ }
+ return _fontFamilySelector;
+ }
+ }
+
+ private TriggerableSelector<Color> _textColorSelector;
+ private TriggerableSelector<Color> textColorSelector
+ {
+ get
+ {
+ if (null == _textColorSelector)
+ {
+ _textColorSelector = new TriggerableSelector<Color>(this, TextColorProperty);
+ }
+ return _textColorSelector;
+ }
+ }
+
+ private TriggerableSelector<float?> _pointSizeSelector;
+ private TriggerableSelector<float?> pointSizeSelector
+ {
+ get
+ {
+ if (null == _pointSizeSelector)
+ {
+ _pointSizeSelector = new TriggerableSelector<float?>(this, PointSizeProperty);
+ }
+ return _pointSizeSelector;
+ }
+ }
+
+ /// <summary>
/// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event.
/// </summary>
protected override void OnBindingContextChanged()
using System.ComponentModel;
using System.Runtime.InteropServices;
using Tizen.NUI.Binding;
+using Tizen.NUI.Components;
namespace Tizen.NUI.BaseComponents
{
private Dictionary<string, Transition> transDictionary = new Dictionary<string, Transition>();
private string[] transitionNames;
+ private ViewStyle viewStyle;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ViewStyle ViewStyle
+ {
+ get
+ {
+ if (null == viewStyle)
+ {
+ ApplyStyle(GetViewStyle());
+ }
+
+ return viewStyle;
+ }
+ }
+
/// <summary>
/// Creates a new instance of a view.
/// </summary>
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View(ViewStyle viewStyle) : this(Interop.View.View_New(), true)
+ {
+ this.ViewStyle.CopyFrom(viewStyle);
+ }
+
/// <summary>
/// Create a new instance of a View with setting the status of shown or hidden.
/// </summary>
}
}
+ internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
+ {
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ this.ViewStyle.CopyFrom(viewStyle);
+ }
+
internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
}
+ internal delegate void ControlStateChangesDelegate(View obj, ControlStates state);
+ internal event ControlStateChangesDelegate ControlStateChangeEvent;
+
+ private ControlStates controlStates;
+ /// <summary>
+ /// Get/Set the control state.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ControlStates ControlState
+ {
+ get
+ {
+ return controlStates;
+ }
+ set
+ {
+ if (controlStates != value)
+ {
+ controlStates = value;
+
+ ControlStateChangeEvent?.Invoke(this, value);
+
+ foreach (View child in Children)
+ {
+ child.ControlState = value;
+ }
+ }
+ }
+ }
+
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public bool IsResourcesCreated
LoadTransitions();
}
}
+
+ /// <summary>
+ /// Get attribues, it is abstract function and must be override.
+ /// </summary>
+ /// <since_tizen> 6 </since_tizen>
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual ViewStyle GetViewStyle()
+ {
+ viewStyle = new ViewStyle();
+ return viewStyle;
+ }
+
+ internal static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ view.backgroundColorSelector.Clone((Selector<Color>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.backgroundColorSelector;
+ });
+ private TriggerableSelector<Color> _backgroundColorSelector;
+ private TriggerableSelector<Color> backgroundColorSelector
+ {
+ get
+ {
+ if (null == _backgroundColorSelector)
+ {
+ _backgroundColorSelector = new TriggerableSelector<Color>(this, BackgroundColorProperty);
+ }
+ return _backgroundColorSelector;
+ }
+ }
+
+ internal static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ view.opacitySelector.Clone((Selector<float?>)newValue);
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.opacitySelector;
+ });
+ private TriggerableSelector<float?> _opacitySelector;
+ private TriggerableSelector<float?> opacitySelector
+ {
+ get
+ {
+ if (null == _opacitySelector)
+ {
+ _opacitySelector = new TriggerableSelector<float?>(this, OpacityProperty);
+ }
+ return _opacitySelector;
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void ApplyStyle(ViewStyle viewStyle)
+ {
+ if (null == viewStyle)
+ {
+ return;
+ }
+
+ if (this.viewStyle == viewStyle)
+ {
+ return;
+ }
+
+ if (null != this.viewStyle)
+ {
+ simpleBinding.Clear();
+ }
+
+ this.viewStyle = viewStyle;
+
+ Dictionary<string, BindableProperty> bindablePropertyOfView;
+ Type viewType = GetType();
+
+ Dictionary<string, BindableProperty> bindablePropertyOfStyle;
+ Type styleType = viewStyle.GetType();
+
+ BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
+ BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
+
+ if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
+ {
+ foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
+ {
+ BindableProperty viewProperty;
+ bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
+
+ if (null != viewProperty)
+ {
+ object value = viewStyle.GetValue(keyValuePair.Value);
+
+ if (null != value)
+ {
+ SetValue(viewProperty, value);
+ }
+
+ simpleBinding.Bind(viewStyle, keyValuePair.Value, this, viewProperty, BindingDirection.TwoWay);
+ }
+ }
+ }
+ }
+
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ private BundledPipe simpleBinding = new BundledPipe();
}
}
*/
using System;
+using System.ComponentModel;
+using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using Tizen.NUI.Binding;
view.InternalParent = null;
}
+ simpleBinding?.Dispose();
+ simpleBinding = null;
+
+ viewStyle = null;
+
base.Dispose(type);
}
}
}
-
private void OnScaleChanged(float x, float y, float z)
{
Scale = new Vector3(x, y, z);
{
SizeModeFactor = new Vector3(x, y, z);
}
-
-
}
}
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
+using System.ComponentModel;
namespace Tizen.NUI.BaseComponents
{
{
}
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public VisualView(ViewStyle viewStyle) : base(typeof(VisualView).FullName, CustomViewBehaviour.ViewBehaviourDefault | CustomViewBehaviour.RequiresTouchEventsSupport, viewStyle)
+ {
+ }
+
// static constructor registers the control type (for user can add kinds of visuals to it)
static VisualView()
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- internal Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="cb"></param>
+ /// <param name="start"></param>
+ /// <param name="end"></param>
+ /// <param name="top"></param>
+ /// <param name="bottom"></param>
+ /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public Extents(ExtentsChangedCallback cb, ushort start, ushort end, ushort top, ushort bottom) : this(Interop.Extents.new_Extents__SWIG_2(start, end, top, bottom), true)
{
callback = cb;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort botton);
+ /// <summary>
+ /// Copy other extents
+ /// </summary>
+ /// <param name="that"></param>
+ /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public void CopyFrom(Extents that)
+ {
+ Interop.Extents.Extents_start_set(swigCPtr, that.Start);
+ Interop.Extents.Extents_end_set(swigCPtr, that.End);
+ Interop.Extents.Extents_top_set(swigCPtr, that.Top);
+ Interop.Extents.Extents_bottom_set(swigCPtr, that.End);
+ }
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
+ /// <param name="start"></param>
+ /// <param name="end"></param>
+ /// <param name="top"></param>
+ /// <param name="bottom"></param>
+ /// <since_tizen> Only used by Tizen.NUI.Components, will not be opened </since_tizen>
+ [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ public delegate void ExtentsChangedCallback(ushort start, ushort end, ushort top, ushort bottom);
private ExtentsChangedCallback callback = null;
/// <summary>
* limitations under the License.
*
*/
-
+using System.ComponentModel;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ internal ViewWrapper(string typeName, ViewWrapperImpl implementation, ViewStyle viewStyle) : base(Interop.ViewWrapper.ViewWrapper_SWIGUpcast(Interop.ViewWrapper.ViewWrapper_New(typeName, ViewWrapperImpl.getCPtr(implementation))), true, viewStyle)
+ {
+ viewWrapperImpl = implementation;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ViewWrapper obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
[EditorBrowsable(EditorBrowsableState.Never)]
public event PropertyChangedEventHandler PropertyChanged;
+ /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void CopyFrom(BindableObject that)
+ {
+ if (null != that)
+ {
+ Dictionary<string, BindableProperty> nameToBindableProperty1;
+ Type type1 = this.GetType();
+ BindableProperty.GetBindablePropertysOfType(type1, out nameToBindableProperty1);
+
+ Dictionary<string, BindableProperty> nameToBindableProperty2;
+ Type type2 = that.GetType();
+ BindableProperty.GetBindablePropertysOfType(type2, out nameToBindableProperty2);
+
+ if (null != nameToBindableProperty1)
+ {
+ foreach (KeyValuePair<string, BindableProperty> keyValuePair in nameToBindableProperty1)
+ {
+ BindableProperty bindableProperty;
+ nameToBindableProperty2.TryGetValue(keyValuePair.Key, out bindableProperty);
+
+ if (null != bindableProperty)
+ {
+ object value = that.GetValue(bindableProperty);
+
+ if (null != value)
+ {
+ SetValue(keyValuePair.Value, value);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ internal void ListenPropertyChange(BindableProperty bindableProperty, PropertyChangedEventHandler eventHandler)
+ {
+ PropertyChangedListener propertyChangedListener;
+ BindablePropertyChangedEventDict.TryGetValue(bindableProperty.PropertyName, out propertyChangedListener);
+
+ if (null == propertyChangedListener)
+ {
+ propertyChangedListener = new PropertyChangedListener();
+ BindablePropertyChangedEventDict.Add(bindableProperty.PropertyName, propertyChangedListener);
+ }
+
+ propertyChangedListener.RegisterListnerHandler(eventHandler);
+ }
+
+ internal void RemovePropertyChangeListener(BindableProperty bindableProperty, PropertyChangedEventHandler propertyChangedEventHandler)
+ {
+ PropertyChangedListener propertyChangedListener;
+ BindablePropertyChangedEventDict.TryGetValue(bindableProperty.PropertyName, out propertyChangedListener);
+
+ if (null != propertyChangedListener)
+ {
+ propertyChangedListener.UnRegisterListnerHandler(propertyChangedEventHandler);
+
+ if (0 == propertyChangedListener.ListenerCount)
+ {
+ BindablePropertyChangedEventDict.Remove(bindableProperty.PropertyName);
+ }
+ }
+ }
+
+ private class PropertyChangedListener
+ {
+ internal void PropertyHasChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName));
+ }
+
+ internal void RegisterListnerHandler(PropertyChangedEventHandler propertyChangedEventHandler)
+ {
+ PropertyChanged += propertyChangedEventHandler;
+ listenerCount++;
+ }
+
+ internal void UnRegisterListnerHandler(PropertyChangedEventHandler propertyChangedEventHandler)
+ {
+ PropertyChanged -= propertyChangedEventHandler;
+ listenerCount--;
+ }
+
+ private int listenerCount = 0;
+ internal int ListenerCount
+ {
+ get
+ {
+ return listenerCount;
+ }
+ }
+
+ private event PropertyChangedEventHandler PropertyChanged;
+ }
+
+ private Dictionary<string, PropertyChangedListener> BindablePropertyChangedEventDict = new Dictionary<string, PropertyChangedListener>();
+
/// <summary>
/// Raised whenever the BindingContext property changes.
/// </summary>
else
{
property.PropertyChanged?.Invoke(this, null, value);
+
+ OnPropertyChanged(property.PropertyName);
+
+ if (BindablePropertyChangedEventDict.ContainsKey(property.PropertyName))
+ {
+ BindablePropertyChangedEventDict[property.PropertyName].PropertyHasChanged(property.PropertyName);
+ }
}
}
BindingChanging = bindingChanging;
IsReadOnly = isReadOnly;
DefaultValueCreator = defaultValueCreator;
+
+ Dictionary<string, BindableProperty> nameToBindableProperty;
+ bindablePropertyOfType.TryGetValue(declaringType, out nameToBindableProperty);
+ if (null == nameToBindableProperty)
+ {
+ nameToBindableProperty = new Dictionary<string, BindableProperty>();
+ bindablePropertyOfType.Add(declaringType, nameToBindableProperty);
+ }
+
+ if (!nameToBindableProperty.ContainsKey(propertyName))
+ {
+ nameToBindableProperty.Add(propertyName, this);
+ }
+ else
+ {
+ nameToBindableProperty[propertyName] = this;
+ }
+
+ if (!baseTypePropertyHasBeenAdded.Contains(declaringType))
+ {
+ AddParentTypeProperty(declaringType.BaseType, nameToBindableProperty);
+ baseTypePropertyHasBeenAdded.Add(declaringType);
+ }
+ }
+
+ private void AddParentTypeProperty(Type type, Dictionary<string, BindableProperty> propertyDict)
+ {
+ if (null != type)
+ {
+ Dictionary<string, BindableProperty> nameToBindableProperty;
+ bindablePropertyOfType.TryGetValue(type, out nameToBindableProperty);
+
+ if (null != nameToBindableProperty)
+ {
+ foreach (KeyValuePair<string, BindableProperty> keyValuePair in nameToBindableProperty)
+ {
+ if (!propertyDict.ContainsKey(keyValuePair.Key))
+ {
+ propertyDict.Add(keyValuePair.Key, keyValuePair.Value);
+ }
+ }
+ }
+
+ AddParentTypeProperty(type.BaseType, propertyDict);
+ }
+ }
+
+ static internal Dictionary<Type, Dictionary<string, BindableProperty>> bindablePropertyOfType = new Dictionary<Type, Dictionary<string, BindableProperty>>();
+ static private HashSet<Type> baseTypePropertyHasBeenAdded = new HashSet<Type>();
+
+ static internal void GetBindablePropertysOfType(Type type, out Dictionary<string, BindableProperty> dictionary)
+ {
+ dictionary = null;
+
+ while (null != type && null == dictionary)
+ {
+ bindablePropertyOfType.TryGetValue(type, out dictionary);
+ type = type.BaseType;
+ }
}
/// <summary>