Add support for 'POP' command. 96/284096/7
authorAkash <akash1.kumar@samsung.com>
Wed, 9 Nov 2022 14:23:40 +0000 (19:53 +0530)
committerAkash <akash1.kumar@samsung.com>
Thu, 17 Nov 2022 10:56:27 +0000 (16:26 +0530)
This patch will send "POP" command that asks
for SettingView to close WidgetView.

Change-Id: I1891e18372be94d663768c7a4be880c529a44d6a
Signed-off-by: Akash <akash1.kumar@samsung.com>
SettingWiFi/SettingWiFi/view/MainPage.cs
SettingWiFi/SettingWiFi/view/WidgetSettingWiFi.cs

index 423e500564039a6108f28bd2b856b228fe59fb52..cedcb62f67a9df3d7f9bc4ba13a5c270b69df662 100644 (file)
@@ -82,22 +82,6 @@ namespace SettingWiFi
                 menu.Post();
             };
 
-            var appBar = new AppBar()
-            {
-                Title = Resources.IDS_WIFI_BODY_WI_FI,
-                Actions = new View[] { moreButton, },
-            };
-
-            AppBarStyle appBarStyle = (AppBarStyle)ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");
-            Button backButton = new Button(((AppBarStyle)appBarStyle).BackButton);
-
-            backButton.Clicked += (object source, ClickedEventArgs args) =>
-            {
-                Navigator.Pop();
-            };
-
-            appBar.NavigationContent = backButton;
-
             View mainView = new View()
             {
                 Layout = new LinearLayout()
@@ -148,7 +132,6 @@ namespace SettingWiFi
             mainView.Add(mScanList);
             mainView.Add(scanButton);
 
-            AppBar = appBar;
             Content = mainView;
         }
 
index acc4a5fb10d65f75ca2383093ac66a15cd646a96..787e458ff2e819b348ca8d95461b52ffd14a94d9 100755 (executable)
@@ -7,7 +7,8 @@ using Tizen.NUI.Accessibility;
 using Tizen.NUI.BaseComponents;\r
 using Tizen.NUI.Binding;\r
 using Tizen.NUI.Components;\r
-\r
+using static SettingWiFi.Logger;\r
+using SettingWiFi.res.locale;\r
 \r
 namespace SettingWiFi\r
 {\r
@@ -30,9 +31,40 @@ namespace SettingWiFi
         {\r
             navigator = window.GetDefaultNavigator();\r
             mWifi = new WiFi();\r
-\r
+            Bundle mBundle = Bundle.Decode(contentInfo);\r
+            window.BackgroundColor = Color.Transparent;\r
             mMainPage = CreateMainPage();\r
+            AppBar appBar = CreateAppBar(Resources.IDS_WIFI_BODY_WI_FI);\r
+            mMainPage.AppBar = appBar;\r
+\r
             navigator.Push(mMainPage);\r
         }\r
+\r
+        protected virtual AppBar CreateAppBar(string title)\r
+        {\r
+            var appBar = new AppBar()\r
+            {\r
+                Title = title,\r
+                AutoNavigationContent = false,\r
+            };\r
+            var appBarStyle = ThemeManager.GetStyle("Tizen.NUI.Components.AppBar");\r
+            var navigationContent = new Button(((AppBarStyle)appBarStyle).BackButton);\r
+            navigationContent.Clicked += (o, e) =>\r
+            {\r
+                RequestWidgetPop();\r
+            };\r
+\r
+            appBar.NavigationContent = navigationContent;\r
+            return appBar;\r
+        }\r
+\r
+        protected void RequestWidgetPop()\r
+        {\r
+            // Pop Widget Content by sending message\r
+            Bundle nextBundle = new Bundle();\r
+            nextBundle.AddItem("WIDGET_ACTION", "POP");\r
+            String encodedBundle = nextBundle.Encode();\r
+            SetContentInfo(encodedBundle);\r
+        }\r
     }\r
 }\r