From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs |  166 ++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 115 insertions(+), 51 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs
index 7e10cf7..6f9c403 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection2Form.cs
@@ -31,66 +31,130 @@
             //娓呯┖bodyFrame
             this.ClearBodyFrame();
 
-            //鍥剧墖
-            var framePic = new FrameLayout();
-            framePic.Width = Application.GetMinRealAverage(852);
-            framePic.Height = Application.GetMinRealAverage(478);
-            framePic.Gravity = Gravity.CenterHorizontal;
-            framePic.Y = Application.GetRealHeight(285);
-            framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png";
-            bodyFrameLayout.AddChidren(framePic);
-
-            //璺宠浆鍒扮Щ鍔ㄨ澶嘩LAN璁剧疆
-            //閫夋嫨hdlZigbeeGW-xxxx缃戠粶
-            string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
-            int yy = framePic.Bottom + Application.GetRealHeight(213);
-            foreach (var msg in ArryMsg)
-            {
-                var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
-                btnMsg.Text = msg;
-                btnMsg.Y = yy;
-                btnMsg.TextAlignment = TextAlignment.Center;
-                btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
-                bodyFrameLayout.AddChidren(btnMsg);
-                yy = btnMsg.Bottom;
-            }
-
-            //鍘昏缃�
-            var btnSettion = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
-            btnSettion.Y = yy + Application.GetRealHeight(12);
-            btnSettion.TextSize = 12;
-            btnSettion.TextAlignment = TextAlignment.Center;
-            btnSettion.TextColor = 0xff0075ff;
-            btnSettion.Text = Language.StringByID(R.MyInternationalizationString.uGotoSettion);
-            btnSettion.ButtonClickEvent += (sender, e) =>
-            {
-            };
-            bodyFrameLayout.AddChidren(btnSettion);
-            //搴曠嚎
-            int lineWidth = btnSettion.GetRealWidthByText(12);
-            var btnLine1 = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
-            btnLine1.BackgroundColor = 0xff0075ff;
-            btnLine1.Gravity = Gravity.CenterHorizontal;
-            btnLine1.Y = btnSettion.Bottom - Application.GetRealHeight(8);
-            bodyFrameLayout.AddChidren(btnLine1);
-
-            //鏌ョ湅甯姪
-            var btnHelp = this.AddHelpControl();
-            btnHelp.ButtonClickEvent += (sender, e) =>
-            {
-                var form = new DeviceDirection.DeviceDirectionHelpForm();
-                form.AddForm("WirelessUdp");
-            };
-
             //涓嬩竴姝�
             var btnNext = new BottomClickButton();
             btnNext.TextID = R.MyInternationalizationString.uNextway;
             bodyFrameLayout.AddChidren(btnNext);
             btnNext.ButtonClickEvent += (sender, e) =>
             {
+                //濡傛灉涓嶆槸鐑偣妯″紡
+                //if (HdlWifiLogic.Current.IsGatewayHotspot == false)
+                //{
+                //    //閫夋嫨hdlZigbeeGW-xxxx缃戠粶
+                //    this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uPleaseSelectGatewayXXNet));
+                //    return;
+                //}
+                var errorMsg = HdlWifiLogic.Current.StartApTcpConnection();
+                if (errorMsg != null)
+                {
+                    //鎷ユ湁閿欒
+                    this.ShowMassage(ShowMsgType.Error, errorMsg);
+                    return;
+                }
                 var form = new WirelessApSelectNetworkForm();
                 this.AddFromAndRemoveNowForm(form);
             };
+            //濡傛灉涓嶆槸缃戝叧鐑偣
+            //if (HdlWifiLogic.Current.IsGatewayHotspot == false)
+            //{
+            //    btnNext.Visible = false;
+            //}
+
+            //鍥剧墖
+            var framePic = new FrameLayout();
+            framePic.Width = this.GetPictrueRealSize(848);
+            framePic.Height = this.GetPictrueRealSize(475);
+            framePic.Gravity = Gravity.CenterHorizontal;
+            framePic.Y = Application.GetRealHeight(199);
+            framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png";
+            bodyFrameLayout.AddChidren(framePic);
+
+            //鎵嬫満杩炴帴缃戝叧鐑偣
+            var btnTitle = new NormalViewControl(400, 60, true);
+            btnTitle.TextID = R.MyInternationalizationString.uMobileConnectionGatewayHotspot;
+            btnTitle.X = Application.GetRealWidth(75);
+            btnTitle.Y = framePic.Bottom + Application.GetRealHeight(107);
+            btnTitle.IsBold = true;
+            btnTitle.TextSize = 14;
+            bodyFrameLayout.AddChidren(btnTitle);
+
+            //1.缃戝叧鐑偣鐨勮处鍙蜂负hdlZigbeeGW-XXX,瀵嗙爜涓篽dl123456
+            //2.鍏蜂綋璐﹀彿鍜屽瘑鐮佸彲鏌ョ湅缃戝叧鏍囩
+            //3.鐐瑰嚮"{1}"瀹屾垚鎵嬫満杩炴帴缃戝叧鐑偣
+            //4.鐐瑰嚮涓嬩竴姝�
+            string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+            int yy = btnTitle.Bottom + Application.GetRealHeight(23);
+            for (int i = 0; i < ArryMsg.Length; i++)
+            {
+                if (i != 2)
+                {
+                    var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+                    btnMsg.Text = ArryMsg[i];
+                    btnMsg.Y = yy;
+                    btnMsg.X = btnTitle.X;
+                    btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1;
+                    btnMsg.TextSize = 12;
+                    bodyFrameLayout.AddChidren(btnMsg);
+                    yy = btnMsg.Bottom;
+                }
+                else
+                {
+                    //3.鐐瑰嚮"{1}"瀹屾垚鎵嬫満杩炴帴缃戝叧鐑偣
+                    var myArry = ArryMsg[i].Split(new string[] { "{1}" }, StringSplitOptions.RemoveEmptyEntries);
+                    //3.鐐瑰嚮
+                    var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+                    btnMsg1.Text = myArry[0];
+                    btnMsg1.Y = yy;
+                    btnMsg1.X = btnTitle.X;
+                    btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor1;
+                    btnMsg1.TextSize = 12;
+                    btnMsg1.Width = btnMsg1.GetRealWidthByText();
+                    bodyFrameLayout.AddChidren(btnMsg1);
+
+                    //鍘昏缃�
+                    var btnSettion = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+                    btnSettion.X = btnMsg1.Right;
+                    btnSettion.Y = btnMsg1.Y;
+                    btnSettion.TextSize = 12;
+                    btnSettion.TextAlignment = TextAlignment.Center;
+                    btnSettion.TextColor = 0xff0075ff;
+                    btnSettion.Text = Language.StringByID(R.MyInternationalizationString.uGotoSettion);
+                    btnSettion.Width = btnSettion.GetRealWidthByText();
+                    bodyFrameLayout.AddChidren(btnSettion);
+                    btnSettion.ButtonClickEvent += (sender, e) =>
+                    {
+                        HdlWifiLogic.Current.OpenAppWifiSettion();
+                        btnNext.Visible = true;
+                    };
+                    //搴曠嚎
+                    var btnLine1 = new NormalViewControl(btnSettion.Width, ControlCommonResourse.BottomLineHeight, false);
+                    btnLine1.BackgroundColor = 0xff0075ff;
+                    btnLine1.X = btnSettion.X;
+                    btnLine1.Y = btnSettion.Bottom - Application.GetRealHeight(8);
+                    bodyFrameLayout.AddChidren(btnLine1);
+
+                    //瀹屾垚鎵嬫満杩炴帴缃戝叧鐑偣
+                    var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
+                    btnMsg2.Text = myArry[1];
+                    btnMsg2.Y = btnMsg1.Y;
+                    btnMsg2.X = btnSettion.Right;
+                    btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
+                    btnMsg2.TextSize = 12;
+                    btnMsg2.Width = btnMsg2.GetRealWidthByText();
+                    bodyFrameLayout.AddChidren(btnMsg2);
+
+                    yy = btnMsg1.Bottom;
+                }
+
+            }
+
+            //鏌ョ湅甯姪
+            var btnHelp = this.AddHelpControl();
+            btnHelp.ButtonClickEvent += (sender, e) =>
+            {
+                var form = new AddGatewayHelpForm();
+                form.AddForm("Ap");
+            };
         }
 
         #endregion

--
Gitblit v1.8.0