From 3dcbd186c42c598c0c08d1cd37034cf2baa09e54 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 30 十二月 2019 15:47:51 +0800
Subject: [PATCH] 合并了代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs |   51 +++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 37 insertions(+), 14 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
index 871c1ad..d6dd689 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs
@@ -57,12 +57,32 @@
             //鍒濆鍖栨甯�
             this.InitFrameTable();
 
+            var framePic = new FrameLayout();
+            framePic.Width = Application.GetRealWidth(855);
+            framePic.Height = Application.GetRealHeight(570);
+            framePic.Gravity = Gravity.CenterHorizontal;
+            framePic.Y = Application.GetRealHeight(58);
+            bodyFrameLayout.AddChidren(framePic);
+
+            var imageFile = Common.LocalDevice.Current.GetRealDeviceIcon(listNewDevice);
+            string fullName = IO.FileUtils.GetImageFilePath(imageFile);
+
+#if Android
             //璁惧鍥剧墖
-            var btnpictrue = new PicViewControl(855, 570);
-            btnpictrue.Gravity = Gravity.CenterHorizontal;
-            btnpictrue.Y = Application.GetRealHeight(58);
-            Common.LocalDevice.Current.SetRealDeviceIconToControl(btnpictrue, listNewDevice);
-            bodyFrameLayout.AddChidren(btnpictrue);
+            var bim = Android.Graphics.BitmapFactory.DecodeFile(fullName);
+            var btnpictrue = new PicViewControl(bim.Width, bim.Height);
+#endif
+#if iOS
+            //璁惧鍥剧墖
+            var bim = UIKit.UIImage.FromFile(fullName);
+            var btnpictrue = new PicViewControl((int)bim.Size.Width, (int)bim.Size.Height);
+#endif
+            bim.Dispose();
+            bim = null;
+
+            btnpictrue.Gravity = Gravity.Center;
+            btnpictrue.UnSelectedImagePath = imageFile;
+            framePic.AddChidren(btnpictrue);
 
             string nameValue = Common.LocalDevice.Current.GetDeviceMacName(listNewDevice[0]);
             this.saveDefultName = nameValue;
@@ -140,7 +160,7 @@
             };
             bodyFrameLayout.AddChidren(btnHelp);
             //搴曠嚎
-            int lineWidth = btnHelp.GetRealWidthByText(12);
+            int lineWidth = btnHelp.GetRealWidthByText();
             var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
             btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
             btnLine.Gravity = Gravity.CenterHorizontal;
@@ -193,9 +213,9 @@
             };
         }
 
-        #endregion
+#endregion
 
-        #region 鈻� 淇敼鍚嶅瓧___________________________
+#region 鈻� 淇敼鍚嶅瓧___________________________
 
         /// <summary>
         /// 璁惧閲嶅懡鍚嶇劧鍚庢墦寮�鏂扮殑鐢婚潰
@@ -249,18 +269,21 @@
                     if (deviceInfoType.BeloneType == Common.DeviceBeloneType.A鎸夐敭闈㈡澘 && device.Type == DeviceType.TemperatureSensor)
                     {
                         //闈㈡澘鐨勬渶鍚庝竴涓洖璺槸娓╁害浼犳劅鍣�
-                        epointName = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId11);
+                        epointName += Language.StringByID(R.MyInternationalizationString.uDeviceBelongId11);
                     }
-                    //XXXXX(N鍥炶矾)
-                    epointName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
+                    else
+                    {
+                        //XXXXX(N鍥炶矾)
+                        epointName += "(" + device.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit) + ")";
+                    }
                 }
                 await Common.LocalDevice.Current.ReName(device, epointName, ShowErrorMode.NO);
             }
         }
 
-        #endregion
+#endregion
 
-        #region 鈻� 鐢婚潰鍏抽棴___________________________
+#region 鈻� 鐢婚潰鍏抽棴___________________________
 
         /// <summary>
         /// 鐢婚潰鍏抽棴
@@ -277,6 +300,6 @@
 
             base.CloseFormBefore();
         }
-        #endregion
+#endregion
     }
 }

--
Gitblit v1.8.0