From: zhouleonlei Date: Fri, 12 Jun 2020 03:21:41 +0000 (+0800) Subject: [NUI][Non-ACR] Replace Style with Control's properties X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0dc87ef1791f6b13e99481c3da44ca6ec6af36e;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI][Non-ACR] Replace Style with Control's properties Plan to set Style's setter to internal, So replace the Style with Control's properties Change-Id: I92ea73a0b081a7184ef7530b9b36595bca23b936 --- diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs index 4e97a83..897248c 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs @@ -66,26 +66,22 @@ namespace Tizen.NUI.Components.Tests btn.Name = position.ToString(); btn.PointSize = ManualTest.GetPointSize(); btn.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.046f); - btn.Style.Text.TextColor = new Color(0, 0, 0, 1); - btn.Style.ImageShadow = new ImageShadow - { - Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png", - Border = new Rectangle(5, 5, 5, 5) - }; - btn.Style.BackgroundImage = new Selector + btn.TextColor = new Color(0, 0, 0, 1); + btn.ImageShadow = new ImageShadow { - Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png", - Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png" + Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png", + Border = new Rectangle(5, 5, 5, 5) }; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); btn.FocusGained += (obj, e) => { - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; }; btn.FocusLost += (obj, e) => { - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; - }; - btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + }; btn.ParentOrigin = Position.ParentOriginTopLeft; btn.PivotPoint = PivotPoint.TopLeft; btn.TextAlignment = HorizontalAlignment.Begin; @@ -246,27 +242,23 @@ namespace Tizen.NUI.Components.Tests btn.PointSize = _pointSize; float buttonWidth = ManualTest.IsMobile() ? Window.Instance.Size.Width * 0.18f : Window.Instance.Size.Width * 0.06f; btn.Size = new Size(buttonWidth, Window.Instance.Size.Height * 0.046f); - btn.Style.Text.TextColor = new Color(0, 0, 0, 1); - btn.Style.ImageShadow = new ImageShadow + btn.TextColor = new Color(0, 0, 0, 1); + btn.ImageShadow = new ImageShadow { Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png", Border = new Rectangle(5, 5, 5, 5) }; - btn.Style.BackgroundImage = new Selector - { - Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png", - Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png" - }; - btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); btn.ParentOrigin = Position.ParentOriginTopLeft; btn.PivotPoint = PivotPoint.TopLeft; btn.FocusGained += (obj, e) => { - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; }; btn.FocusLost += (obj, e) => { - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; }; } diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs index 7918dc2..0bdbb56 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs @@ -65,9 +65,9 @@ namespace Tizen.NUI.Components.Tests btn.Text = text; btn.PointSize = 4.0f; btn.TextAlignment = HorizontalAlignment.Begin; - btn.Style.Text.TextColor = Color.White; - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png"; - btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); + btn.TextColor = Color.White; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png"; + btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); } } @@ -266,15 +266,9 @@ namespace Tizen.NUI.Components.Tests if (!btn) return; btn.Text = text; btn.PointSize = 4.0f; - btn.Style.Text.TextColor = new Selector - { - Normal = new Color(0, 0, 0, 1), - Pressed = new Color(0, 0, 0, 0.7f), - Selected = new Color(0.058f, 0.631f, 0.92f, 1), - Disabled = new Color(0, 0, 0, 0.4f) - }; - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png"; - btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); + btn.TextColor = new Color(0, 0, 0, 1); + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png"; + btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); btn.TextColor = Color.White; } diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs index d6a9158..1149d3f 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs @@ -60,19 +60,18 @@ namespace Tizen.NUI.Components.Tests private void CreatePopup() { - _popup = new Popup(); + _popup = new Popup(new PopupStyle()); Assert.IsNotNull(_popup, "Should be not null"); Assert.IsInstanceOf(_popup, "Should be equal!"); _popup.Size = new Size(Window.Instance.Size.Width * 0.2f, Window.Instance.Size.Height * 0.24f); _popup.Position = new Position(Window.Instance.Size.Width * 0.39f, Window.Instance.Size.Height * 0.2f); // Title - _popup.Style.Title.PointSize = _pointSize; - _popup.Style.Title.SizeHeight = Window.Instance.Size.Height * 0.025f; - _popup.Style.Title.HorizontalAlignment = HorizontalAlignment.Begin; - _popup.Style.Title.Position = new Position(Window.Instance.Size.Width * 0.033f, Window.Instance.Size.Height * 0.01f); - _popup.Style.Title.Text = "Popup Title"; - _popup.Style.Title.Padding = new Extents(0, 0, 0, 0); + _popup.TitlePointSize = _pointSize; + _popup.TitleHeight = (int)(Window.Instance.Size.Height * 0.025f); + _popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin; + _popup.TitleTextPosition = new Position(Window.Instance.Size.Width * 0.033f, Window.Instance.Size.Height * 0.01f); + _popup.TitleText = "Popup Title"; // Background _popup.BackgroundImage = _resourcePath + "/images/popup_background.png"; diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs index 24bf78f..3b4762f 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs @@ -55,24 +55,32 @@ namespace Tizen.NUI.Components.Tests } private void CreateSwitch() - { - _switch = new Switch(new SwitchStyle()); + { + SwitchStyle st = new SwitchStyle + { + Track = new ImageViewStyle + { + ResourceUrl = new Selector + { + Normal = _resourcePath + "/images/controller_switch_bg_off.png", + Selected = _resourcePath + "/images/controller_switch_bg_on.png", + } + }, + Thumb = new ImageViewStyle + { + Size = new Size(Window.Instance.Size.Width * 0.0312f, Window.Instance.Size.Height * 0.0555f), + ResourceUrl = new Selector + { + Normal = _resourcePath + "/images/controller_switch_handler.png", + Selected = _resourcePath + "/images/controller_switch_handler.png", + }, + }, + }; + _switch = new Switch(st); Assert.IsNotNull(_switch, "Should be not null"); Assert.IsInstanceOf(_switch, "Should be equal!"); _switch.Size = new Size(Window.Instance.Size.Width * 0.05f, Window.Instance.Size.Height * 0.0555f); - _switch.Position = new Position(Window.Instance.Size.Width * 0.5f, Window.Instance.Size.Height * 0.5f); - _switch.Style.Thumb.Size = new Size(Window.Instance.Size.Width * 0.0312f, Window.Instance.Size.Height * 0.0555f); - _switch.Style.Track.ResourceUrl = new Selector - { - Normal = _resourcePath + "/images/controller_switch_bg_off.png", - Selected = _resourcePath + "/images/controller_switch_bg_on.png", - }; - _switch.Style.Thumb.ResourceUrl = new Selector - { - Normal = _resourcePath + "/images/controller_switch_handler.png", - Selected = _resourcePath + "/images/controller_switch_handler.png", - }; - + _switch.Position = new Position(Window.Instance.Size.Width * 0.5f, Window.Instance.Size.Height * 0.5f); if (ManualTest.IsWearable()) { _wearTestPage.ExecuteTC(_switch); diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs index 231bdd4..4e03955 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs @@ -66,26 +66,22 @@ namespace Tizen.NUI.Tests btn.Name = position.ToString(); btn.PointSize = ManualTest.GetPointSize(); btn.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.046f); - btn.Style.Text.TextColor = new Color(0, 0, 0, 1); - btn.Style.ImageShadow = new ImageShadow + btn.TextColor = new Color(0, 0, 0, 1); + btn.ImageShadow = new ImageShadow { Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png", Border = new Rectangle(5, 5, 5, 5) }; - btn.Style.BackgroundImage = new Selector - { - Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png", - Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png" - }; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); btn.FocusGained += (obj, e) => { - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; }; btn.FocusLost += (obj, e) => { - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; }; - btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); btn.ParentOrigin = Position.ParentOriginTopLeft; btn.PivotPoint = PivotPoint.TopLeft; btn.TextAlignment = HorizontalAlignment.Begin; @@ -246,27 +242,23 @@ namespace Tizen.NUI.Tests btn.PointSize = _pointSize; float buttonWidth = ManualTest.IsMobile() ? Window.Instance.Size.Width * 0.18f : Window.Instance.Size.Width * 0.06f; btn.Size = new Size(buttonWidth, Window.Instance.Size.Height * 0.046f); - btn.Style.Text.TextColor = new Color(0, 0, 0, 1); - btn.Style.ImageShadow = new ImageShadow + btn.TextColor = new Color(0, 0, 0, 1); + btn.ImageShadow = new ImageShadow { Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png", Border = new Rectangle(5, 5, 5, 5) }; - btn.Style.BackgroundImage = new Selector - { - Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png", - Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png" - }; - btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); btn.ParentOrigin = Position.ParentOriginTopLeft; btn.PivotPoint = PivotPoint.TopLeft; btn.FocusGained += (obj, e) => { - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png"; }; btn.FocusLost += (obj, e) => { - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"; }; } diff --git a/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs b/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs index f945921..f9a3f20 100755 --- a/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs +++ b/tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs @@ -65,9 +65,9 @@ namespace Tizen.NUI.Tests btn.Text = text; btn.PointSize = 4.0f; btn.TextAlignment = HorizontalAlignment.Begin; - btn.Style.Text.TextColor = Color.White; - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png"; - btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); + btn.TextColor = Color.White; + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png"; + btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); } } @@ -266,15 +266,9 @@ namespace Tizen.NUI.Tests if (!btn) return; btn.Text = text; btn.PointSize = 4.0f; - btn.Style.Text.TextColor = new Selector - { - Normal = new Color(0, 0, 0, 1), - Pressed = new Color(0, 0, 0, 0.7f), - Selected = new Color(0.058f, 0.631f, 0.92f, 1), - Disabled = new Color(0, 0, 0, 0.4f) - }; - btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png"; - btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); + btn.TextColor = new Color(0, 0, 0, 1); + btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png"; + btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); btn.TextColor = Color.White; }