Add button adjustment,resizing issue 08/282908/2
authoreswari <r.palacharla@samsung.com>
Thu, 13 Oct 2022 07:32:58 +0000 (13:02 +0530)
committereswari <r.palacharla@samsung.com>
Thu, 13 Oct 2022 10:55:33 +0000 (16:25 +0530)
Change-Id: I3bf83cc51834ba6e8dd66814f186c351e25489a0

Settings/MainAccount/MainAccount.cs
Settings/MainAccount/SettingWidgetAccount.cs
Settings/MainAccount/ViewManager.cs
Settings/SettingView/SettingBorderView.cs
Settings/SettingView/SettingView.cs
packaging/org.tizen.SettingView-1.0.0.tpk [new file with mode: 0644]
packaging/org.tizen.cssetting-account-1.0.0.tpk

index 68b41147a26dff76e336a7aee87fd7380c716cc5..6005726efbcaf9df89c991a3a3bb15f7c2725289 100644 (file)
@@ -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;
index 904c55770f58b8ba640356b9eda4fabcddfd3f52..e3d278b27526e110ac21276626cd61cfa0e14e3d 100644 (file)
@@ -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();  
         }
 
index ddab48719b146d390a84f3935d7bbfb56829b8a5..80d46c8bdf3196ae906db2226060d896e361290a 100644 (file)
@@ -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
index b3a064091a2f20f66ecc2f052cb8ba661fdb03fc..38919c4d14ff6af3387ede318e4093c4ce149405 100644 (file)
@@ -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;
         }
index 81081d355fe50ab172bedf5e4d60839729e95ec7..af20bc29b4d861142eb1b9ea6e66d3248d1cef78 100644 (file)
@@ -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 (file)
index 0000000..ecc165e
Binary files /dev/null and b/packaging/org.tizen.SettingView-1.0.0.tpk differ
index 60c9f19c20e32c71020cc9068fe94420ff3f1665..f042c573c706f107720de7d92ca9bb0d898b3032 100644 (file)
Binary files a/packaging/org.tizen.cssetting-account-1.0.0.tpk and b/packaging/org.tizen.cssetting-account-1.0.0.tpk differ