From 18b93d511dc764b469d7c4a7e755f7274f89cdb4 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 27 四月 2020 17:55:14 +0800
Subject: [PATCH] 2020-4-27-1

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs |   37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
index afd919d..47590b7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFunctionSettionForm.cs
@@ -15,7 +15,7 @@
         /// <summary>
         /// 鍒楄〃鎺т欢
         /// </summary>
-        private VerticalListControl listview = null;
+        private FrameListControl listview = null;
         /// <summary>
         /// 褰撳墠閫夋嫨鐨勮澶�
         /// </summary>
@@ -75,12 +75,16 @@
             //娓呯┖bodyFrame
             this.ClearBodyFrame();
 
+            var listBackControl = new VerticalFrameControl();
+            listBackControl.Height = bodyFrameLayout.Height;
+            bodyFrameLayout.AddChidren(listBackControl);
+
             //鍒濆鍖栨甯�
             this.tableContr = new InformationEditorControl();
-            this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 708, 1028);
+            this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
 
             //鍒濆鍖栬澶囧洖璺浘鏍�
-            this.InitDeviceEpointIcon();
+            this.InitDeviceEpointIcon(listBackControl);
 
             //淇濆瓨
             var btnFinish = new BottomClickButton();
@@ -139,6 +143,10 @@
                     else if (device.DfunctionType == DeviceFunctionType.A鐏厜)
                     {
                         device.IconPath = "Device/Light.png";
+                    }
+                    else
+                    {
+                        device.IconPath = "Device/RelayEpoint.png";
                     }
                     device.ReSave();
                 }
@@ -204,7 +212,7 @@
             //娣诲姞鍔熻兘绫诲瀷琛�
             this.AddFunctionTypeRow();
             //鍒濆鍖栨甯冨畬鎴�
-            tableContr.FinishInitControl(bodyFrameLayout, this.listview);
+            tableContr.FinishInitControl();
         }
 
         #endregion
@@ -328,10 +336,19 @@
                         var title = Language.StringByID(R.MyInternationalizationString.uSelectFunctionType);
 
                         var form = new BottomItemSelectForm();
+                        form.CancelCallEvent = true;//鍏佽鍙栨秷
                         form.AddForm(title, listText, nowSelectNo);
                         form.FinishSelectEvent += (selectNo) =>
                         {
-                            btnFunction.Text = listText[selectNo];
+                            if (selectNo == -1)
+                            {
+                                //閫夋嫨鍙栨秷
+                                btnFunction.Text = string.Empty;
+                            }
+                            else
+                            {
+                                btnFunction.Text = listText[selectNo];
+                            }
                             nowSelectNo = selectNo;
                             //璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨�
                             if (selectNo == 0)
@@ -342,9 +359,13 @@
                             {
                                 dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A鐏厜;
                             }
-                            else
+                            else if (selectNo == 2)
                             {
                                 dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A鎻掑骇;
+                            }
+                            else
+                            {
+                                dicDeviceFuncType[nowSelectDevice.DeviceEpoint] = DeviceFunctionType.A鏈畾涔�;
                             }
                         };
                     };
@@ -359,7 +380,7 @@
         /// <summary>
         /// 鍒濆鍖栬澶囧洖璺浘鏍�
         /// </summary>
-        private void InitDeviceEpointIcon()
+        private void InitDeviceEpointIcon(VerticalFrameControl listBackControl)
         {
             bool hadDevice = false;
             var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceObj.DeviceAddr);
@@ -398,7 +419,7 @@
             frameBorder.Gravity = Gravity.CenterHorizontal;
             frameBorder.Width = Application.GetMinRealAverage(426);
             frameBorder.Height = Application.GetMinRealAverage(426);
-            bodyFrameLayout.AddChidren(frameBorder);
+            listBackControl.frameTable.AddChidren(frameBorder);
 
             var btnPic = new PicViewControl(frameBorder.Width, frameBorder.Height, false);
             btnPic.UnSelectedImagePath = "DeviceItem/PanelTable.png";

--
Gitblit v1.8.0