From ebd28feaf5320a97ac6c533e60d15d3410aaf610 Mon Sep 17 00:00:00 2001 From: "EverLEEst(SangHyeon Jade Lee)" Date: Mon, 29 Mar 2021 21:02:18 +0900 Subject: [PATCH] [NUI] Update recyclerView item and styles.add missing patches files. --- .../Controls/RecyclerView/Item/DefaultGridItem.cs | 10 +++--- .../RecyclerView/Item/DefaultLinearItem.cs | 39 ++++++++++---------- .../Controls/RecyclerView/Item/DefaultTitleItem.cs | 23 ++++++------ .../RecyclerView/Item/RecyclerViewItem.Internal.cs | 5 +-- .../Controls/RecyclerView/Item/RecyclerViewItem.cs | 3 -- .../Theme/DefaultThemeCommon.cs | 41 +++++++++++++--------- 6 files changed, 63 insertions(+), 58 deletions(-) diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs index 044e3da..3155bf7 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs @@ -43,7 +43,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultGridItem() : base() { - Initialize(); } /// @@ -53,7 +52,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultGridItem(string style) : base(style) { - Initialize(); } /// @@ -63,7 +61,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultGridItem(DefaultGridItemStyle itemStyle) : base(itemStyle) { - Initialize(); } /// @@ -437,10 +434,13 @@ namespace Tizen.NUI.Components } - /// + /// + /// Initializes AT-SPI object. + /// [EditorBrowsable(EditorBrowsableState.Never)] - private void Initialize() + public override void OnInitialize() { + base.OnInitialize(); Layout = new RelativeLayout(); layoutChanged = true; LayoutDirectionChanged += OnLayoutDirectionChanged; diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs index ce3668b..d3627f6 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs @@ -44,7 +44,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultLinearItem() : base() { - Initialize(); } /// @@ -54,7 +53,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultLinearItem(string style) : base(style) { - Initialize(); } /// @@ -64,7 +62,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultLinearItem(DefaultLinearItemStyle itemStyle) : base(itemStyle) { - Initialize(); } /// @@ -272,7 +269,14 @@ namespace Tizen.NUI.Components if (itemExtra != null) itemExtra.ApplyStyle(defaultStyle.Extra); if (itemSeperator != null) + { itemSeperator.ApplyStyle(defaultStyle.Seperator); + //FIXME : currently margin is not applied by ApplyStyle automatically. + itemSeperator.Margin = defaultStyle.Seperator.Margin; + } + //FIXME : currently padding is not applied by ApplyStyle automatically. + Extents padding = defaultStyle.Padding; + Padding = padding; } } @@ -323,18 +327,7 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected override void MeasureChild() { - var pad = Padding; - if (itemLabel) - { - var margin = itemLabel.Margin; - itemLabel.SizeWidth = SizeWidth - pad.Start - pad.End - margin.Start - margin.End; - } - - if (itemSubLabel) - { - var margin = itemSubLabel.Margin; - itemSubLabel.SizeWidth = SizeWidth - pad.Start - pad.End - margin.Start - margin.End; - } + //Do Measure in here if necessary. } /// @@ -376,7 +369,7 @@ namespace Tizen.NUI.Components if (itemSubLabel != null) { - if (itemIcon) + if (itemIcon != null) { RelativeLayout.SetLeftTarget(itemSubLabel, itemIcon); RelativeLayout.SetLeftRelativeOffset(itemSubLabel, 1.0F); @@ -386,7 +379,7 @@ namespace Tizen.NUI.Components RelativeLayout.SetLeftTarget(itemSubLabel, this); RelativeLayout.SetLeftRelativeOffset(itemSubLabel, 0.0F); } - if (itemExtra) + if (itemExtra != null) { RelativeLayout.SetRightTarget(itemSubLabel, itemExtra); RelativeLayout.SetRightRelativeOffset(itemSubLabel, 0.0F); @@ -407,7 +400,7 @@ namespace Tizen.NUI.Components RelativeLayout.SetFillHorizontal(itemSubLabel, true); } - if (itemIcon) + if (itemIcon != null) { RelativeLayout.SetLeftTarget(itemLabel, itemIcon); RelativeLayout.SetLeftRelativeOffset(itemLabel, 1.0F); @@ -417,7 +410,7 @@ namespace Tizen.NUI.Components RelativeLayout.SetLeftTarget(itemLabel, this); RelativeLayout.SetLeftRelativeOffset(itemLabel, 0.0F); } - if (itemExtra) + if (itemExtra != null) { RelativeLayout.SetRightTarget(itemLabel, itemExtra); RelativeLayout.SetRightRelativeOffset(itemLabel, 0.0F); @@ -431,7 +424,7 @@ namespace Tizen.NUI.Components RelativeLayout.SetTopTarget(itemLabel, this); RelativeLayout.SetTopRelativeOffset(itemLabel, 0.0F); - if (itemSubLabel) + if (itemSubLabel != null) { RelativeLayout.SetBottomTarget(itemLabel, itemSubLabel); RelativeLayout.SetBottomRelativeOffset(itemLabel, 0.0F); @@ -509,7 +502,11 @@ namespace Tizen.NUI.Components return new DefaultLinearItemStyle(); } - private void Initialize() + /// + /// Initializes AT-SPI object. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void OnInitialize() { base.OnInitialize(); Layout = new RelativeLayout(); diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs index 0ab28da..fe77c68 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs @@ -42,7 +42,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultTitleItem() : base() { - Initialize(); } /// @@ -52,7 +51,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultTitleItem(string style) : base(style) { - Initialize(); } /// @@ -62,7 +60,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public DefaultTitleItem(DefaultTitleItemStyle itemStyle) : base(itemStyle) { - Initialize(); } /// @@ -196,7 +193,14 @@ namespace Tizen.NUI.Components if (itemIcon != null) itemIcon.ApplyStyle(defaultStyle.Icon); if (itemSeperator != null) + { itemSeperator.ApplyStyle(defaultStyle.Seperator); + //FIXME : currently margin is not applied by ApplyStyle automatically. + itemSeperator.Margin = defaultStyle.Seperator.Margin; + } + //FIXME : currently padding is not applied by ApplyStyle automatically. + Extents padding = defaultStyle.Padding; + Padding = padding; } } @@ -247,12 +251,7 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected override void MeasureChild() { - if (itemLabel) - { - var pad = Padding; - var margin = itemLabel.Margin; - itemLabel.SizeWidth = SizeWidth - pad.Start - pad.End - margin.Start - margin.End; - } + // Do measure in here if necessary. } /// @@ -355,7 +354,11 @@ namespace Tizen.NUI.Components return new DefaultTitleItemStyle(); } - private void Initialize() + /// + /// Initializes AT-SPI object. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override void OnInitialize() { base.OnInitialize(); Layout = new RelativeLayout(); diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs index d35ad2e..e900020 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs @@ -247,11 +247,12 @@ namespace Tizen.NUI.Components } /// - /// It is hijack by using protected, style copy problem when class inherited from Button. + /// Initializes AT-SPI object. /// [EditorBrowsable(EditorBrowsableState.Never)] - private void Initialize() + public override void OnInitialize() { + base.OnInitialize(); //FIXME! IsCreateByXaml = true; Layout = new AbsoluteLayout(); diff --git a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.cs b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.cs index 5e355a2..53c6265 100755 --- a/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.cs +++ b/src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.cs @@ -104,7 +104,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public RecyclerViewItem() : base() { - Initialize(); } /// @@ -114,7 +113,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public RecyclerViewItem(string style) : base(style) { - Initialize(); } /// @@ -124,7 +122,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public RecyclerViewItem(RecyclerViewItemStyle itemStyle) : base(itemStyle) { - Initialize(); } /// diff --git a/src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs b/src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs index 1285dd7..721c0c8 100755 --- a/src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs +++ b/src/Tizen.NUI.Components/Theme/DefaultThemeCommon.cs @@ -260,37 +260,42 @@ namespace Tizen.NUI.Components theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultLinearItem", new DefaultLinearItemStyle() { - SizeHeight = 130, - Padding = new Extents(20, 20, 5, 5), + SizeHeight = 108, + Padding = new Extents(64, 64, 18, 17), BackgroundColor = new Selector() { Normal = new Color(1, 1, 1, 1), Pressed = new Color(0.85f, 0.85f, 0.85f, 1), Disabled = new Color(0.70f, 0.70f, 0.70f, 1), - Selected = new Color(0.701f, 0.898f, 0.937f, 1), + Selected = new Color(0.85f, 0.85f, 0.85f, 1), }, Label = new TextLabelStyle() { - PointSize = 10, + PixelSize = 32, Ellipsis = true, + FontFamily = "BreezeSans", //FXIME Font Weight is Light + TextColor = new Color("#001447FF"), }, SubLabel = new TextLabelStyle() { - PointSize = 6, + PixelSize = 28, Ellipsis = true, + FontFamily = "BreezeSans", + TextColor = new Color("#001447FF"), }, Icon = new ViewStyle() { - Margin = new Extents(0, 20, 0, 0) + Margin = new Extents(0, 32, 0, 0) }, Extra = new ViewStyle() { - Margin = new Extents(20, 0, 0, 0) + Margin = new Extents(32, 0, 0, 0) }, Seperator = new ViewStyle() { - Margin = new Extents(5, 5, 0, 0), - BackgroundColor = new Color(0.78f, 0.78f, 0.78f, 1), + SizeHeight = 1, + Margin = new Extents(64, 64, 0, 0), + BackgroundColor = new Color("#C3CAD2FF"), }, }); theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultGridItem", new DefaultGridItemStyle() @@ -298,8 +303,9 @@ namespace Tizen.NUI.Components Padding = new Extents(5, 5, 5, 5), Caption = new TextLabelStyle() { - PointSize = 9, - Ellipsis = true, + SizeHeight = 60, + PixelSize = 24, + LineWrapMode = LineWrapMode.Character, }, Badge = new ViewStyle() { @@ -309,25 +315,26 @@ namespace Tizen.NUI.Components theme.AddStyleWithoutClone("Tizen.NUI.Components.DefaultTitleItem", new DefaultTitleItemStyle() { - SizeHeight = 90, - Padding = new Extents(10, 10, 5, 5), + SizeHeight = 60, + Padding = new Extents(64, 64, 12, 12), BackgroundColor = new Selector() { - Normal = new Color(0.78f, 0.78f, 0.78f, 1), + Normal = new Color("#EEEEF1FF"), }, Label = new TextLabelStyle() { - PointSize = 10, + PixelSize = 28, Ellipsis = true, + TextColor = new Color("#001447FF"), }, Icon = new ViewStyle() { - Margin = new Extents(10, 0, 0, 0) + Margin = new Extents(40, 0, 0, 0) }, Seperator = new ViewStyle() { Margin = new Extents(0, 0, 0, 0), - BackgroundColor = new Color(0.85f, 0.85f, 0.85f, 1), + BackgroundColor = new Color(0, 0, 0, 0), }, }); -- 2.7.4