From 330e3ae4cdd1e9facb14b6ea2b3e609166c04fd3 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 12 一月 2021 16:00:27 +0800 Subject: [PATCH] 2021-1-12-1 --- HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs | 55 ++++++++++++++++++++++++++++--------------------------- 1 files changed, 28 insertions(+), 27 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs index 3b56c1e..98bcf74 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPage.cs @@ -17,6 +17,7 @@ /// </summary> VerticalScrolViewLayout contentView; + Button btnAllRoomText; Button btnChooseAll; #endregion @@ -59,17 +60,6 @@ }; contentView.AddChidren(allRoomView); - Button btnAllRoomText = new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(280), - TextID = StringId.All, - TextSize= CSS_FontSize.SubheadingFontSize, - TextColor = CSS_Color.FirstLevelTitleColor, - TextAlignment = TextAlignment.CenterLeft, - }; - allRoomView.AddChidren(btnAllRoomText); - btnChooseAll = new Button() { X = Application.GetRealWidth(331), @@ -82,7 +72,18 @@ }; allRoomView.AddChidren(btnChooseAll); - foreach(var room in DB_ResidenceData.Rooms) + btnAllRoomText = new Button() + { + X = Application.GetRealWidth(16), + TextID = StringId.All, + TextSize= CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + TextAlignment = TextAlignment.CenterLeft, + }; + allRoomView.AddChidren(btnAllRoomText); + + + foreach(var room in SpatialInfo.CurrentSpatial.RoomList) { var roomView = new FrameLayout() { @@ -101,6 +102,19 @@ }; roomView.AddChidren(btnLine); + Button btnChoose = new Button() + { + X = Application.GetRealWidth(331), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(28), + Height = Application.GetMinRealAverage(28), + UnSelectedImagePath = "Public/ChooseIcon.png", + SelectedImagePath = "Public/ChooseOnIcon.png", + IsSelected = function.roomIds.Contains(room.roomId), + Tag = "ChooseIcon" + }; + roomView.AddChidren(btnChoose); + Button btnRoomText = new Button() { X = Application.GetRealWidth(16), @@ -111,25 +125,12 @@ Text = room.floorName + room.roomName, }; roomView.AddChidren(btnRoomText); - - Button btnChoose = new Button() - { - X = Application.GetRealWidth(331), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(28), - Height = Application.GetMinRealAverage(28), - UnSelectedImagePath = "Public/ChooseIcon.png", - SelectedImagePath = "Public/ChooseOnIcon.png", - IsSelected = function.roomIds.Contains(room.uid), - Tag = "ChooseIcon" - }; - roomView.AddChidren(btnChoose); - btnChoose.MouseUpEventHandler = (sender, e) => { + btnRoomText.MouseUpEventHandler = (sender, e) => { btnChoose.IsSelected = !btnChoose.IsSelected; LoadEvent_RoomSelected(room, btnChoose.IsSelected); }; - if (!function.roomIds.Contains(room.uid) && btnChooseAll.IsSelected) + if (!function.roomIds.Contains(room.roomId) && btnChooseAll.IsSelected) { btnChooseAll.IsSelected = false; } -- Gitblit v1.8.0