From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs |   42 +++++++++++++++++++++++++++++-------------
 1 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
index 1685d91..029faad 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
@@ -7,6 +7,9 @@
 using static ZigBee.Device.Panel;
 namespace Shared.Phone.UserCenter.DeviceBind
 {
+    /// <summary>
+    /// 鏅�氶潰鏉跨殑缁戝畾璁惧鐣岄潰銆愬彲缁戝畾澶氫釜璁惧銆�
+    /// </summary>
     public class AddDevicePage : BindCommonLayout
     {
         /// 鏋勯�犲嚱鏁�
@@ -354,10 +357,12 @@
                     continue;
                 }
                 roomTempList.Add(room);
-                if (roomTempList.Count != 0)
-                {
-                    curRoom = roomTempList[0];
-                }
+            }
+
+            for (int i = 0; i < roomTempList.Count; i++)
+            {
+                var room = roomTempList[i];
+                curRoom = roomTempList[0];
 
                 var btnRoomFrameLayout = new FrameLayout
                 {
@@ -373,7 +378,7 @@
                 var btnRoom = new Button
                 {
                     Height = Application.GetRealHeight(58),
-                    Width = Application.GetRealWidth(127),
+                    Width = Application.GetRealWidth(255),
                     Y = Application.GetRealHeight(58),
                     X = Application.GetRealWidth(14),
                     Text = room.Name,
@@ -390,6 +395,18 @@
                     btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite;
                     curentOldRoom = btnRoom;
                     curentOldRoomFrameLayout = btnRoomFrameLayout;
+                }
+                if (index == roomTempList.Count - 1 && index > 2)
+                {
+                    var btnRoomFrameLayoutEmpty = new FrameLayout
+                    {
+                        Height = Application.GetMinReal(159),
+                        Width = Application.GetMinReal(50),
+                        Y = Application.GetRealHeight(23),
+                        X = Application.GetRealWidth(5),
+                        BorderWidth = 1,
+                    };
+                    btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayoutEmpty);
                 }
                 EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                 {
@@ -416,7 +433,6 @@
                         curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png";
                     }
                     curRoom = room;
-                    currentKey.RoomId = room.Id;
                     RefreshDeviceList(curRoom);
                     if (curTypeDeviceList.Count == 0)
                     {
@@ -470,7 +486,7 @@
                         }
                         foreach (var deviceKeys in r.ListDevice)
                         {
-                            var device = LocalDevice.Current.GetDevice(deviceKeys);
+                            var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys);
                             if (device != null)
                             {
                                 var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 6));
@@ -495,7 +511,7 @@
                         }
                         foreach (var deviceKeys in r.ListDevice)
                         {
-                            var device = LocalDevice.Current.GetDevice(deviceKeys);
+                            var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys);
                             if (device != null)
                             {
                                 var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 8));
@@ -520,7 +536,7 @@
                         }
                         foreach (var deviceKeys in r.ListDevice)
                         {
-                            var device = LocalDevice.Current.GetDevice(deviceKeys);
+                            var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys);
                             if (device != null)
                             {
                                 var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 258));
@@ -550,7 +566,7 @@
                 case "AddSwitch":
                     foreach (var deviceKeys in curRoom.ListDevice)
                     {
-                        var device = LocalDevice.Current.GetDevice(deviceKeys);
+                        var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys);
                         if (device != null)
                         {
                             var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 6));
@@ -564,7 +580,7 @@
                 case "AddDimmer":
                     foreach (var deviceKeys in curRoom.ListDevice)
                     {
-                        var device = LocalDevice.Current.GetDevice(deviceKeys);
+                        var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys);
                         if (device != null)
                         {
                             var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 8));
@@ -578,7 +594,7 @@
                 case "AddCurtain":
                     foreach (var deviceKeys in curRoom.ListDevice)
                     {
-                        var device = LocalDevice.Current.GetDevice(deviceKeys);
+                        var device = HdlDeviceCommonLogic.Current.GetDevice(deviceKeys);
                         if (device != null)
                         {
                             var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 258));
@@ -625,7 +641,7 @@
                     TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
                     TextAlignment = TextAlignment.CenterLeft,
                     Tag = device.DeviceEpointName,
-                    Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
+                    Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device),
                     TextSize = 15,
                 };
                 rowLayout.AddChidren(btnBindName);

--
Gitblit v1.8.0