Modify layout of Connect pages 86/282886/1
authorchaehee-hong <chaehee.hong@samsung.com>
Thu, 13 Oct 2022 04:15:10 +0000 (13:15 +0900)
committerchaehee-hong <chaehee.hong@samsung.com>
Thu, 13 Oct 2022 04:15:13 +0000 (13:15 +0900)
Change-Id: I23a9c507e2f48a5f2451541710e89eb08fd82ac3

SettingWiFi/SettingWiFi/view/ConnectPage.cs
SettingWiFi/SettingWiFi/view/WPSConnectPage.cs
packaging/org.tizen.cssetting-wifi-1.0.0.tpk

index e23e86f02642f93ab3ab1168f3a526bc091df5a4..86564c9f0f5c403e794a12a9d01e57e5c73cdc41 100644 (file)
@@ -18,28 +18,31 @@ namespace SettingWiFi
             Debug("ConnectPage");
             mWifi = wifi;
         }
-
         internal void CreateComponents(AP ap)
         {
             mAp = ap;
 
-            var connectView = new View()
+            var connectView = new RecyclerViewItem()
             {
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                 },
-                WidthSpecification = 200,
-                HeightSpecification = 100,
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = LayoutParamPolicies.WrapContent,
             };
 
-            var passwordItem = new DefaultLinearItem();
-            var wpsButtonItem = new DefaultLinearItem();
+            var passwordItem = new DefaultLinearItem()
+            {
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                IsSelectable = false,
+            };
+            passwordItem.Label.HorizontalAlignment = HorizontalAlignment.Begin;
 
             var passwordField = new TextField()
             {
-                WidthSpecification = 400,
-                BackgroundColor = Color.Grey,
+                WidthSpecification = 600,
+                BackgroundColor = Color.Silver,
                 PlaceholderText = Resources.IDS_WIFI_HEADER_PASSWORD,
             };
 
@@ -50,6 +53,8 @@ namespace SettingWiFi
             hiddenInput.ShowLastCharacterDuration = 1000;
             passwordField.SetHiddenInput(hiddenInput);
 
+            passwordItem.Add(passwordField);
+
             var wpsButton = new Button()
             {
                 Text = Resources.IDS_WIFI_OPT_WPS,
@@ -58,11 +63,8 @@ namespace SettingWiFi
             };
             wpsButton.Clicked += OnWpsClicked;
 
-            passwordItem.Add(passwordField);
-            //wpsButtonItem.Add(wpsButton);
-
-            connectView.Add(passwordItem);
-            //connectView.Add(wpsButtonItem);
+            connectView.Add(passwordField);
+            connectView.Add(wpsButton);
 
             var cancelButton = new Button()
             {
index 23d482e7032d5a58689137e71cd666ed1d40080c..cd913cc9ba010a7ae8e5deba42c06794dbb8dd8b 100644 (file)
@@ -19,28 +19,28 @@ namespace SettingWiFi
             mWifi = wifi;
         }
 
-        internal void CreateComponents(AP ap)
+        public void CreateComponents(AP ap)
         {
             mAp = ap;
 
-            var view = new View()
+            var view = new RecyclerViewItem()
             {
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                 },
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = LayoutParamPolicies.WrapContent,
             };
 
-            var messageItem = new DefaultLinearItem();
-            var progressItem = new DefaultLinearItem();
-
             string timeout = "2";
-            TextLabel text = new TextLabel(String.Format(Resources.IDS_WIFI_POP_PRESS_WPS_ON_YOUR_WI_FI_ACCESS_POINT_WITHIN_PD_MINUTES, timeout))
+            var messageItem = new DefaultLinearItem()
             {
-                Size = new Size(1000, 700),
-                HorizontalAlignment = HorizontalAlignment.Begin,
-                PointSize = 12.0f,
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                Text = String.Format(Resources.IDS_WIFI_POP_PRESS_WPS_ON_YOUR_WI_FI_ACCESS_POINT_WITHIN_PD_MINUTES, timeout),
+                IsSelectable = false,
             };
+            messageItem.Label.HorizontalAlignment = HorizontalAlignment.Begin;
 
             var progress = new Progress()
             {
@@ -49,15 +49,10 @@ namespace SettingWiFi
                 CurrentValue = 0,
                 TrackColor = Color.White,
                 ProgressColor = Color.Navy,
-                Size = new Size(400, 50),
-                WidthSpecification = 400,
             };
 
-            messageItem.Add(text);
-            progressItem.Add(progress);
-
             view.Add(messageItem);
-            view.Add(progressItem);
+            view.Add(progress);
 
             int timeCnt = 60 * 2;
             var timer = new Timer(1000);
@@ -122,28 +117,28 @@ namespace SettingWiFi
             mWifi = wifi;
         }
 
-        internal void CreateComponents(AP ap, string pin)
+        public void CreateComponents(AP ap, string pin)
         {
             mAp = ap;
 
-            var view = new View()
+            var view = new RecyclerViewItem()
             {
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                 },
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = LayoutParamPolicies.WrapContent,
             };
 
-            var messageItem = new DefaultLinearItem();
-            var progressItem = new DefaultLinearItem();
-
             string timeout = "2";
-            TextLabel text = new TextLabel(String.Format(Resources.IDS_ST_BODY_ENTER_THE_P1SS_PIN_ON_YOUR_WI_FI_ROUTER_THE_SETUP_CAN_TAKE_UP_TO_P2SD_MINUTES_TO_COMPLETE, pin, timeout))
+            var messageItem = new DefaultLinearItem()
             {
-                Size = new Size(1000, 700),
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                Text = String.Format(Resources.IDS_ST_BODY_ENTER_THE_P1SS_PIN_ON_YOUR_WI_FI_ROUTER_THE_SETUP_CAN_TAKE_UP_TO_P2SD_MINUTES_TO_COMPLETE, pin, timeout),
+                IsSelectable = false,
             };
-            text.HorizontalAlignment = HorizontalAlignment.Begin;
-            text.PointSize = 12.0f;
+            messageItem.Label.HorizontalAlignment = HorizontalAlignment.Begin;
 
             var progress = new Progress()
             {
@@ -152,15 +147,10 @@ namespace SettingWiFi
                 CurrentValue = 0,
                 TrackColor = Color.White,
                 ProgressColor = Color.Navy,
-                Size = new Size(400, 50),
-                WidthSpecification = 400,
             };
 
-            messageItem.Add(text);
-            progressItem.Add(progress);
-
             view.Add(messageItem);
-            view.Add(progressItem);
+            view.Add(progress);
 
             int timeCnt = 60 * 2;
             var timer = new Timer(1000);
@@ -177,7 +167,6 @@ namespace SettingWiFi
                 checkConnection();
                 if (isConnected)
                 {
-                    Debug(Resources.IDS_WIFI_SBODY_CONNECTED_M_STATUS);
                     Navigator.Pop();
                     return false;
                 }
@@ -229,36 +218,69 @@ namespace SettingWiFi
         {
             mAp = ap;
 
-            var view = new View()
+            var view = new RecyclerViewItem()
             {
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                 },
-                WidthSpecification = 200,
-                HeightSpecification = 100,
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = LayoutParamPolicies.WrapContent,
+            };
+
+            var pbsButtonItem = new DefaultLinearItem()
+            {
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+            };
+            pbsButtonItem.Label.HorizontalAlignment = HorizontalAlignment.Begin;
+
+            var pinButtonItem = new DefaultLinearItem()
+            {
+                WidthSpecification = LayoutParamPolicies.MatchParent,
             };
+            pinButtonItem.Label.HorizontalAlignment = HorizontalAlignment.Begin;
 
             var pbsButton = new Button()
             {
                 Text = Resources.IDS_WIFI_BUTTON_WPS_BUTTON,
+                BackgroundColor = Color.Silver,
+                WidthSpecification = 600,
             };
             pbsButton.Clicked += OnButtonMethodClicked;
 
             var pinButton = new Button()
             {
                 Text = Resources.IDS_WIFI_SK_WPS_PIN,
+                BackgroundColor = Color.Silver,
+                WidthSpecification = 600,
             };
             pinButton.Clicked += OnPinMethodClicked;
 
+            var cancelButton = new Button()
+            {
+                Text = Resources.IDS_WIFI_SK_CANCEL,
+            };
+            cancelButton.Clicked += OnCancelClicked;
+
+            pbsButtonItem.Add(pbsButton);
+            pinButtonItem.Add(pinButton);
+
+            view.Add(pbsButtonItem);
+            view.Add(pinButtonItem);
+
             Content = new AlertDialog()
             {
                 Title = Resources.IDS_WIFI_HEADER_SELECT_WPS_METHOD_ABB,
                 Content = view,
-                Actions = new View[] { pbsButton, pinButton },
+                Actions = new View[] { cancelButton },
             };
         }
 
+        private void OnCancelClicked(object source, ClickedEventArgs args)
+        {
+            Navigator.Pop();
+        }
+
         private void OnButtonMethodClicked(object source, ClickedEventArgs args)
         {
             var page = new WpsButtonWaitPage(mWifi);
index e45857e37d42af0bac8c3931f092b29c768120ca..f06bb561a9f51ac6cd3fc1abb121e5556ab28897 100644 (file)
Binary files a/packaging/org.tizen.cssetting-wifi-1.0.0.tpk and b/packaging/org.tizen.cssetting-wifi-1.0.0.tpk differ