Add basic InfoInputPage 37/282937/1
authorcheoleun moon <chleun.moon@samsung.com>
Thu, 13 Oct 2022 10:13:52 +0000 (19:13 +0900)
committercheoleun moon <chleun.moon@samsung.com>
Thu, 13 Oct 2022 10:13:56 +0000 (19:13 +0900)
Change-Id: I82fc66f25aae4f3f09276ef918492c6578e1e84e

.gitignore
SettingWiFi/SettingWiFi/view/ApInfoSource.cs
SettingWiFi/SettingWiFi/view/InfoInputPage.cs [new file with mode: 0644]
SettingWiFi/SettingWiFi/view/InfoPage.cs
SettingWiFi/SettingWiFi/view/MainPage.cs

index 7df1af8d712f3ff791639126229754b7af44e86a..2d8168b77a5b95c37b6809249e11b8dc8920fecf 100644 (file)
@@ -1,5 +1,8 @@
+.vs/
 .vscode/*
 SettingWiFi/SettingView/bin/
 SettingWiFi/SettingView/obj/
 SettingWiFi/SettingWiFi/bin/
 SettingWiFi/SettingWiFi/obj/
+tags
+msbuild.log
index 94dc7a5d6c2bb4dae359a31c38ffb4228042039a..ed88f789dee0f3da870590eac3c8e79e0a1d6bf5 100644 (file)
@@ -44,7 +44,6 @@ namespace SettingWiFi
 
         private void OnPropertyChanged(string propertyName)
         {
-            Debug("OnPropertyChanged " + propertyName);
             PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
         }
 
diff --git a/SettingWiFi/SettingWiFi/view/InfoInputPage.cs b/SettingWiFi/SettingWiFi/view/InfoInputPage.cs
new file mode 100644 (file)
index 0000000..2856136
--- /dev/null
@@ -0,0 +1,68 @@
+using System;
+using SettingWiFi.res.locale;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using static SettingWiFi.Logger;
+
+
+namespace SettingWiFi
+{
+    internal class InfoInputPage : DialogPage
+    {
+        internal InfoInputPage()
+        {
+            Debug("InfoInputPage");
+        }
+
+        internal void CreateComponents(string title, string value)
+        {
+            var infoView = new RecyclerViewItem()
+            {
+                Layout = new LinearLayout()
+                {
+                    LinearOrientation = LinearLayout.Orientation.Vertical,
+                },
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = LayoutParamPolicies.WrapContent,
+            };
+
+            var valueField = new TextField()
+            {
+                WidthSpecification = 600,
+                PlaceholderText = value,
+            };
+            infoView.Add(valueField);
+
+            var cancelButton = new Button()
+            {
+                Text = Resources.IDS_WIFI_SK_CANCEL,
+            };
+            cancelButton.Clicked += OnCancelClicked;
+            var okButton = new Button()
+            {
+                Text = "OK",
+            };
+            okButton.Clicked += OnOkClicked;
+
+            Content = new AlertDialog()
+            {
+                Title = title,
+                Content = infoView,
+                Actions = new View[] { cancelButton, okButton},
+            };
+        }
+
+        private void OnOkClicked(object sender, ClickedEventArgs e)
+        {
+            Debug("OnOkClicked");
+            Navigator.Pop();
+        }
+
+        private void OnCancelClicked(object sender, ClickedEventArgs e)
+        {
+            Debug("OnCancelClicked");
+            Navigator.Pop();
+        }
+    }
+}
\ No newline at end of file
index 7f3905ad70f9af1fcc83592043c10b68f4f53ed6..49d6e49a7ac1a3ad7738045ab5aef494a709b0ff 100644 (file)
@@ -14,7 +14,6 @@ namespace SettingWiFi
     internal class InfoPage : ContentPage
     {
         private AP mAp;
-        private APSource mApSource;
         private WiFi mWifi;
 
         ApInfoSource mApInfoSource;
@@ -62,8 +61,9 @@ namespace SettingWiFi
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = LayoutParamPolicies.MatchParent,
-                SelectionMode = ItemSelectionMode.None,
+                SelectionMode = ItemSelectionMode.Single,
             };
+            apInfoListView.SelectionChanged += OnInfoListViewSelected;
 
             var header = GetHeader();
 
@@ -84,6 +84,25 @@ namespace SettingWiFi
             Content = infoView;
         }
 
+        private void OnInfoListViewSelected(object sender, SelectionChangedEventArgs e)
+        {
+            foreach (object item in e.CurrentSelection)
+            {
+                if (item is ApInfoText info)
+                {
+                    Navigator.Push(CreateInfoInputPage(info.InfoTitle, info.InfoValue));
+                    break;
+                }
+            }
+        }
+
+        private Page CreateInfoInputPage(string title, string value)
+        {
+            var page = new InfoInputPage();
+            page.CreateComponents(title, value);
+            return page;
+        }
+
         private DataTemplate CreateItemTemplate()
         {
             return new DataTemplate(() =>
index e4891c46cf8380bf6e773361ff8e0a32c2df8e97..b9c3968e24860d8e396e8d42b1da81d62f6b1e27 100644 (file)
@@ -314,19 +314,6 @@ namespace SettingWiFi
 
         public async void OnScanListSelected(object sender, SelectionChangedEventArgs ev)
         {
-            //SingleSelection Only have 1 or nil object in the list.
-            /*
-            foreach (object item in ev.PreviousSelection)
-            {
-                if (item == null) break;
-                if (item is AP ap)
-                {
-                    Debug("Disconnect " + ap.Essid);
-                    await mWifi.Disconnect(ap.Essid);
-                    //mApSource.UpdateState(ap);
-                }
-            }
-            */
             foreach (object item in ev.CurrentSelection)
             {
                 if (item == null) break;