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/WirelessApDirection1Form.cs |   68 ++++++++++++++++++++++++++--------
 1 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs
index 0a2205d..5a685c9 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs
@@ -33,34 +33,50 @@
 
             //鍥剧墖
             var framePic = new FrameLayout();
-            framePic.Width = Application.GetMinRealAverage(392);
-            framePic.Height = Application.GetMinRealAverage(259);
+            framePic.Width = this.GetPictrueRealSize(386);
+            framePic.Height = this.GetPictrueRealSize(255);
             framePic.Gravity = Gravity.CenterHorizontal;
-            framePic.Y = Application.GetRealHeight(426);
+            framePic.Y = Application.GetRealHeight(228);
             framePic.BackgroundImagePath = "Gateway/WirelessApDirection.png";
             bodyFrameLayout.AddChidren(framePic);
 
-            //闀挎寜缃戝叧HID/WCFG鎸夐敭5绉�
-            //绯荤粺鐏父浜�60绉掑悗鍒欒繘鍏ラ厤缃戠姸鎬�
-            string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg1).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
-            int yy = framePic.Bottom + Application.GetRealHeight(291);
+            //缃戝叧涓婄數閰嶇綉
+            var btnTitle = new NormalViewControl(300, 60, true);
+            btnTitle.TextID = R.MyInternationalizationString.uGatewayPowerDistributionNetwork;
+            btnTitle.X = Application.GetRealWidth(75);
+            btnTitle.Y = framePic.Bottom + Application.GetRealHeight(213);
+            btnTitle.IsBold = true;
+            btnTitle.TextSize = 14;
+            bodyFrameLayout.AddChidren(btnTitle);
+
+            //1.涓婄數,绯荤粺鍚姩(绯荤粺鎸囩ず鐏疭YS 7绉掑悗浜捣,鎸佺画50绉掑父浜�)
+            //2.缃戝叧杩炴帴灞�鍩熺綉(SYS 3绉掑懆鏈熼棯鐑�,鐏厜鍋忔殫,鎸佺画20绉�)
+            //3.缃戝叧寤虹珛WI-FI鐑偣(SYS 5绉掑懆鏈熼棯鐑�,鐏厜鍙樹寒)
+            //4.缃戝叧寤虹珛鐑偣鎴愬姛
+            //5.鐐瑰嚮涓嬩竴姝�
+            string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddWirelessApGatewayMsg1).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+            int YY = btnTitle.Bottom + Application.GetRealHeight(23);
             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 btnMsg1 = new NormalViewControl(942, 60, true);
+                btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor1;
+                btnMsg1.TextSize = 12;
+                btnMsg1.Text = msg;
+                btnMsg1.Y = YY;
+                btnMsg1.X = Application.GetRealWidth(75);
+                btnMsg1.IsMoreLines = true;
+                btnMsg1.Height = Application.GetRealHeight(60) * this.GetRowCountByTextLength(btnMsg1, 942);
+                bodyFrameLayout.AddChidren(btnMsg1);
+
+                YY = btnMsg1.Bottom;
             }
 
             //鏌ョ湅甯姪
             var btnHelp = this.AddHelpControl();
             btnHelp.ButtonClickEvent += (sender, e) =>
             {
-                var form = new DeviceDirection.DeviceDirectionHelpForm();
-                form.AddForm("WirelessUdp");
+                var form = new AddGatewayHelpForm();
+                form.AddForm("Ap");
             };
 
             //涓嬩竴姝�
@@ -74,6 +90,26 @@
             };
         }
 
+        /// <summary>
+        /// 鏍规嵁鏂囨湰闀垮害,鑾峰彇琛屾暟
+        /// </summary>
+        /// <param name="btnContr"></param>
+        /// <param name="i_width"></param>
+        /// <returns></returns>
+        private int GetRowCountByTextLength(NormalViewControl btnContr, int i_width)
+        {
+            int realWidth = btnContr.GetRealWidthByText();
+            int myWidth = Application.GetRealWidth(i_width);
+
+            int row = realWidth / myWidth;
+            int value = realWidth % myWidth;
+            if (value > 8)
+            {
+                row++;
+            }
+            return row;
+        }
+
         #endregion
     }
 }

--
Gitblit v1.8.0