From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 10 七月 2020 10:52:13 +0800 Subject: [PATCH] 2020-07-10-01 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs | 59 ++++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 36 insertions(+), 23 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs index ccccd7c..441b86e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs @@ -234,8 +234,8 @@ } } else - { - // 鑾峰彇妤煎眰瀵瑰簲瀵规埧闂� + { + // 鑾峰彇妤煎眰瀵瑰簲瀵规埧闂� var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); foreach (var room in listAllRoom) { @@ -354,10 +354,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 { @@ -391,6 +393,18 @@ curentOldRoom = btnRoom; curentOldRoomFrameLayout = btnRoomFrameLayout; } + if (index == roomTempList.Count - 1 && index > 3) + { + 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) => { if (!btnRoom.IsSelected) @@ -416,7 +430,6 @@ curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; } curRoom = room; - currentKey.RoomId = room.Id; RefreshDeviceList(curRoom); if (curTypeDeviceList.Count == 0) { @@ -453,7 +466,7 @@ /// <returns></returns> List<CommonDevice> GetALlDispalyRoomDeviceList() { - currentKeyAllRoomDeviceList.Clear(); + currentKeyAllRoomDeviceList.Clear(); var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); switch (curDeviceBindType) { @@ -492,7 +505,7 @@ if (r.IsLove == true) { continue; - } + } foreach (var deviceKeys in r.ListDevice) { var device = LocalDevice.Current.GetDevice(deviceKeys); @@ -548,9 +561,9 @@ switch (curDeviceBindType) { case "AddSwitch": - foreach (var deviceKeys in curRoom.ListDevice) - { - var device = LocalDevice.Current.GetDevice(deviceKeys); + foreach (var deviceKeys in curRoom.ListDevice) + { + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 6)); @@ -561,10 +574,10 @@ } } break; - case "AddDimmer": - foreach (var deviceKeys in curRoom.ListDevice) - { - var device = LocalDevice.Current.GetDevice(deviceKeys); + case "AddDimmer": + foreach (var deviceKeys in curRoom.ListDevice) + { + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 8)); @@ -575,10 +588,10 @@ } } break; - case "AddCurtain": - foreach (var deviceKeys in curRoom.ListDevice) - { - var device = LocalDevice.Current.GetDevice(deviceKeys); + case "AddCurtain": + foreach (var deviceKeys in curRoom.ListDevice) + { + var device = LocalDevice.Current.GetDevice(deviceKeys); if (device != null) { var dev = device.InClusterList.Find(obj => (obj != null) && (obj.InCluster == 258)); @@ -839,9 +852,9 @@ btnMethodText.IsSelected = true; oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; oldbuttonText.IsBold = true; - } - - //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� + } + + //鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂� var listAllRoom = HdlRoomLogic.Current.GetAllListRooms(); foreach (var room in listAllRoom) { -- Gitblit v1.8.0