From d78515ac4ac8cf4a1785d9df18058d6724f12b79 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 14 一月 2021 19:34:59 +0800
Subject: [PATCH] 合并xm2021-01-13  wjc2021-02-06

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewayDirectionForm.cs |   79 ++++++++++++++++++++++-----------------
 1 files changed, 45 insertions(+), 34 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewayDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewayDirectionForm.cs
index 1d753b5..3d0b200 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewayDirectionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WiredGatewayDirectionForm.cs
@@ -27,50 +27,41 @@
             this.ClearBodyFrame();
 
             //鍥炬爣
-            var btnimage = new PicViewControl(533, 884, true);
-            btnimage.Y = Application.GetRealHeight(173);
+            var btnimage = new PicViewControl(496, 781, true);
+            btnimage.Y = Application.GetRealHeight(86);
             btnimage.Gravity = Gravity.CenterHorizontal;
             btnimage.UnSelectedImagePath = "Gateway/WiredGatewayInstruct.png";
             bodyFrameLayout.AddChidren(btnimage);
 
-            //璇风‘淇濈綉鍏崇敤缃戠嚎姝e父杩炴帴璺敱鍣▄0}姝e父杩炴帴鍒欑郴缁熸寚绀虹伅1绉掗棯鐑�
-            string[] strMsg = Language.StringByID(R.MyInternationalizationString.ConfirmLineConnectMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
-            var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
-            btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnMsg1.TextAlignment = TextAlignment.Center;
-            btnMsg1.Text = strMsg[0];
-            btnMsg1.Y = btnimage.Bottom + Application.GetRealHeight(101);
-            bodyFrameLayout.AddChidren(btnMsg1);
-            if (strMsg.Length > 1)
+            //1.璇风‘淇濈綉鍏崇敤缃戠嚎姝e父杩炴帴璺敱鍣�
+            //2.缃戝彛鎸囩ず鐏疞AN鏃犺寰嬮棯鐑�
+            //3.绯荤粺鎸囩ず鐏疭YS涓�1绉掑懆鏈熼棯鐑侊紝鐏厜鍋忔殫
+            //4.鎵嬫満APP鍜岀綉鍏抽娆¤繛鎺�,璇峰皢鎵嬫満淇濇寔鍦ㄤ笌缃戝叧鍚屼竴涓眬鍩熺綉涓�(WIFI)
+            //5.杩涜鈥滀笅涓�姝モ�濇搷浣�
+            string[] strMsg = Language.StringByID(R.MyInternationalizationString.uAddWiredGatewayMsg1).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+            int YY = btnimage.Bottom + Application.GetRealHeight(66);
+            foreach (var msg in strMsg)
             {
-                var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
-                btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor3;
-                btnMsg2.TextAlignment = TextAlignment.Center;
-                btnMsg2.Text = strMsg[1];
-                btnMsg2.Y = btnMsg1.Bottom;
-                bodyFrameLayout.AddChidren(btnMsg2);
-            }
-
+                var btnMsg1 = new NormalViewControl(910, 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, 910);
+                bodyFrameLayout.AddChidren(btnMsg1);
+
+                YY = btnMsg1.Bottom;
+            }
+
             //鏌ョ湅甯姪
-            var btnHelp = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(49), false);
-            btnHelp.Y = Application.GetRealHeight(1388);
-            btnHelp.TextSize = 12;
-            btnHelp.TextAlignment = TextAlignment.Center;
-            btnHelp.TextColor = UserCenterColor.Current.TextOrangeColor;
-            btnHelp.Text = Language.StringByID(R.MyInternationalizationString.uSearchHelp);
+            var btnHelp = this.AddHelpControl();
             btnHelp.ButtonClickEvent += (sender, e) =>
             {
                 var form = new AddGatewayHelpForm();
                 form.AddForm("Wired");
-            };
-            bodyFrameLayout.AddChidren(btnHelp);
-            //搴曠嚎
-            int lineWidth = btnHelp.GetRealWidthByText();
-            var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
-            btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
-            btnLine.Gravity = Gravity.CenterHorizontal;
-            btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8);
-            bodyFrameLayout.AddChidren(btnLine);
+            };
 
             //涓嬩竴姝�
             var btnNext = new BottomClickButton();
@@ -83,5 +74,25 @@
                 this.AddFromAndRemoveNowForm(form);
             };
         }
+
+        /// <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;
+        }
     }
 }

--
Gitblit v1.8.0