From: eswari Date: Thu, 13 Oct 2022 07:32:58 +0000 (+0530) Subject: Add button adjustment,resizing issue X-Git-Tag: accepted/tizen/unified/20221015.165749~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cc2ff4c3bb24d1755ba4fff1df7ae13857c6a28;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-account.git Add button adjustment,resizing issue Change-Id: I3bf83cc51834ba6e8dd66814f186c351e25489a0 --- diff --git a/Settings/MainAccount/MainAccount.cs b/Settings/MainAccount/MainAccount.cs index 68b4114..6005726 100644 --- a/Settings/MainAccount/MainAccount.cs +++ b/Settings/MainAccount/MainAccount.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel; using System.Diagnostics; -using System.Collections.Generic; // for Dictionary +using System.Collections.Generic; using Tizen.NUI; using Tizen.NUI.BaseComponents; using Tizen.NUI.Components; diff --git a/Settings/MainAccount/SettingWidgetAccount.cs b/Settings/MainAccount/SettingWidgetAccount.cs index 904c557..e3d278b 100644 --- a/Settings/MainAccount/SettingWidgetAccount.cs +++ b/Settings/MainAccount/SettingWidgetAccount.cs @@ -14,6 +14,8 @@ namespace MainAccount Bundle bundle = Bundle.Decode(contentInfo); navigator = window.GetDefaultNavigator(); this.window = window; + window.SetTransparency(true); + window.BackgroundColor = Color.Transparent; viewManager = new ViewManager(); viewManager.ApplicationClosed += (object sender, System.EventArgs e) => { @@ -24,12 +26,13 @@ namespace MainAccount }; //Add Widget for next pages navigator.Push(viewManager.GetContentPage()); - navigator.BackgroundColor = Color.Transparent; + //navigator.BackgroundColor = Color.Transparent; window.Resized += OnWindowResized; } private void OnWindowResized(object sender, Window.ResizedEventArgs e) { + Tizen.Log.Info("Testing", "Resizing"); viewManager.UpdateView(); } diff --git a/Settings/MainAccount/ViewManager.cs b/Settings/MainAccount/ViewManager.cs index ddab487..80d46c8 100644 --- a/Settings/MainAccount/ViewManager.cs +++ b/Settings/MainAccount/ViewManager.cs @@ -51,6 +51,10 @@ namespace MainAccount CloseAccount(); }; appBar.NavigationContent = navigationContent; + RelativeLayout.SetLeftTarget(appBar.NavigationContent, appBar); + RelativeLayout.SetLeftRelativeOffset(appBar.NavigationContent, 0.0f); + RelativeLayout.SetVerticalAlignment(appBar.NavigationContent, RelativeLayout.Alignment.Center); + appBarStyle.Dispose(); Button actionContent = new Button() { @@ -59,13 +63,17 @@ namespace MainAccount Size2D = new Size2D(100, 48).SpToPx(), Text = "Add", PointSize = 15.0f, - CellHorizontalAlignment = HorizontalAlignmentType.Right, }; actionContent.Clicked += (object sender, ClickedEventArgs e) => { CloseAccount(); }; appBar.ActionContent = actionContent; + RelativeLayout.SetRightTarget(appBar.ActionContent, appBar); + RelativeLayout.SetRightRelativeOffset(appBar.ActionContent, 1.0f); + RelativeLayout.SetLeftTarget(appBar.ActionContent, appBar.TitleContent); + RelativeLayout.SetLeftRelativeOffset(appBar.ActionContent, 1.0f); + RelativeLayout.SetVerticalAlignment(appBar.ActionContent, RelativeLayout.Alignment.Center); TextLabel titleContent = new TextLabel("Accounts") { @@ -76,6 +84,9 @@ namespace MainAccount //FontStyle = Resources.FontStyleAllNormal, }; appBar.TitleContent = titleContent; + RelativeLayout.SetLeftTarget(appBar.TitleContent, appBar.NavigationContent); + RelativeLayout.SetLeftRelativeOffset(appBar.TitleContent, 1.0f); + RelativeLayout.SetVerticalAlignment(appBar.TitleContent, RelativeLayout.Alignment.Center); } private void CloseAccount() @@ -119,6 +130,7 @@ namespace MainAccount Tizen.Log.Info("TESTAPP", "UpdateVIew"); contentPage.Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height); + appBar.TitleContent.WidthSpecification = Window.Instance.Size.Width - 175.SpToPx(); } } } \ No newline at end of file diff --git a/Settings/SettingView/SettingBorderView.cs b/Settings/SettingView/SettingBorderView.cs index b3a0640..38919c4 100644 --- a/Settings/SettingView/SettingBorderView.cs +++ b/Settings/SettingView/SettingBorderView.cs @@ -19,7 +19,7 @@ namespace SettingView private static readonly string CloseIcon = ResourcePath + "/images/close.png"; private static readonly string LeftCornerIcon = ResourcePath + "/images/leftCorner.png"; - private int width = 540;//500 + private int width = 540; private bool hide = false; private View borderView; //private TextLabel title; @@ -173,7 +173,7 @@ namespace SettingView public override void CreateBorderView(View borderView) { this.borderView = borderView; - borderView.CornerRadius = new Vector4(0.3f, 0.3f, 0.3f, 0.3f); // Vector4(0.03f, 0.03f, 0.03f, 0.03f) + borderView.CornerRadius = new Vector4(0.3f, 0.3f, 0.3f, 0.3f); borderView.CornerRadiusPolicy = VisualTransformPolicyType.Relative; borderView.BackgroundColor = new Color(0, 0, 0, 0.16f); //Color(0, 0, 0, 0.35f) } @@ -207,7 +207,7 @@ namespace SettingView BorderWindow.Maximize(false); } preWinPositonSize = BorderWindow.WindowPositionSize; - BorderWindow.WindowPositionSize = new Rectangle(preWinPositonSize.X, preWinPositonSize.Y, 540, 0); //500,0 + BorderWindow.WindowPositionSize = new Rectangle(preWinPositonSize.X, preWinPositonSize.Y, 540, 0); } return true; } diff --git a/Settings/SettingView/SettingView.cs b/Settings/SettingView/SettingView.cs index 81081d3..af20bc2 100644 --- a/Settings/SettingView/SettingView.cs +++ b/Settings/SettingView/SettingView.cs @@ -2,15 +2,17 @@ using Tizen.NUI; using Tizen.NUI.Components; using Tizen.System; +using Tizen.NUI.BaseComponents; namespace SettingView { public class Program : NUIApplication { private WidgetView widgetView; + public Program(string styleSheet, Size2D windowSize, Position2D windowPosition, IBorderInterface borderInterface) : base(styleSheet, windowSize, windowPosition, borderInterface) - { + { } protected override void OnCreate() @@ -24,8 +26,9 @@ namespace SettingView bundle.AddItem("COUNT", "1"); string encodedBundle = bundle.Encode(); - //widgetView = WidgetViewManager.Instance.AddWidget("Account@org.tizen.cssetting-Account", encodedBundle, window.Size.Width, window.Size.Height, 0.0f); - widgetView = WidgetViewManager.Instance.AddWidget("account@org.tizen.cssetting-account", encodedBundle, window.Size.Width, window.Size.Height, 0.0f); + widgetView = WidgetViewManager.Instance.AddWidget("account@org.tizen.cssetting-account", encodedBundle, window.Size.Width, window.Size.Height, 0.0f); //(540,960) + widgetView.WidthSpecification = LayoutParamPolicies.MatchParent; + widgetView.HeightSpecification = LayoutParamPolicies.MatchParent; widgetView.Position = new Position(0, 0); // Position of the application window(Account) widgetView.WidgetContentUpdated += OnWidgetContentUpdated; window.GetDefaultLayer().Add(widgetView); @@ -63,7 +66,6 @@ namespace SettingView Position2D pos = isPortrait ? new Position2D(60, 640) : new Position2D(480, 170); Tizen.Log.Info("TESTAPP", "pos: " + pos.X + " " + pos.Y); var app = new Program("", new Size2D(960, 540), pos, appCustomBorder); - app.Run(args); } } diff --git a/packaging/org.tizen.SettingView-1.0.0.tpk b/packaging/org.tizen.SettingView-1.0.0.tpk new file mode 100644 index 0000000..ecc165e Binary files /dev/null and b/packaging/org.tizen.SettingView-1.0.0.tpk differ diff --git a/packaging/org.tizen.cssetting-account-1.0.0.tpk b/packaging/org.tizen.cssetting-account-1.0.0.tpk index 60c9f19..f042c57 100644 Binary files a/packaging/org.tizen.cssetting-account-1.0.0.tpk and b/packaging/org.tizen.cssetting-account-1.0.0.tpk differ