From f4c86f68b900bd506ef7214b2ae9bd23a9d2ffa8 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期六, 19 十二月 2020 17:48:11 +0800
Subject: [PATCH] 完成筛选房间的功能
---
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs | 150 +++----------------------------------------------
1 files changed, 11 insertions(+), 139 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
index cac5d2c..c140558 100755
--- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -163,146 +163,18 @@
/// </summary>
void LoadDialog_ChangeFloor()
{
- EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
- {
- var dialog = new Dialog();
- var dialogBody = new FrameLayout();
- dialog.AddChidren(dialogBody);
- dialogBody.MouseUpEventHandler += (sender1, e1) =>
- {
- dialog.Close();
- };
-
- var dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(110),
- BackgroundImagePath = "PersonalCenter/HomeList1bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- var contentView = new VerticalScrolViewLayout()
- {
- X = Application.GetRealWidth(8),
- Y = Application.GetRealHeight(15),
- Width = Application.GetRealWidth(150),
- Height = Application.GetRealHeight(45 * 2),
- ScrollEnabled = false
- };
- dispalyView.AddChidren(contentView);
-
- if (SpatialInfo.CurrentSpatial.RoomList.Count < 2)
- {
- }
- else if (SpatialInfo.CurrentSpatial.RoomList.Count < 3)
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(155),
- BackgroundImagePath = "PersonalCenter/HomeList2bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 3);
- dispalyView.AddChidren(contentView);
- }
- else if (SpatialInfo.CurrentSpatial.RoomList.Count < 4)
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(200),
- BackgroundImagePath = "PersonalCenter/HomeList3bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 4);
- dispalyView.AddChidren(contentView);
- }
- else
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(245),
- BackgroundImagePath = "PersonalCenter/HomeList4bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 5);
- contentView.ScrollEnabled = true;
- dispalyView.AddChidren(contentView);
- }
-
-
- List<Room> roomList = new List<Room>();
- roomList.Add(new Room() { roomName = Language.StringByID(StringId.All) });
- roomList.AddRange(SpatialInfo.CurrentSpatial.RoomList);
- foreach (var tempRoom in roomList)
- {
- var roomName = tempRoom.roomName;
- if (roomName != Language.StringByID(StringId.All))
- {
- contentView.AddChidren(new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealHeight(1),
- BackgroundColor = CSS_Color.BackgroundColor
- });
- }
- var btnHomeName = new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealHeight(44),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.FirstLevelTitleColor,
- SelectedTextColor = CSS_Color.MainColor,
- Text = roomName,
- TextSize = CSS_FontSize.SubheadingFontSize,
- IsSelected = btnFloor.Text == roomName,
- IsMoreLines = true,
- };
- contentView.AddChidren(btnHomeName);
-
- btnHomeName.MouseUpEventHandler += (senderH, en) =>
- {
- dialog.Close();
- btnFloor.Text = roomName;
- if (roomName == Language.StringByID(StringId.All))
- {
- ShowFunctionRow(functionList);
- }
- else
- {
- var showList = new List<Function>();
- foreach (var sf in functionList)
- {
- if(sf.roomIds.Contains(tempRoom.roomId))
- {
- showList.Add(sf);
- }
- }
- ShowFunctionRow(showList);
- }
- };
- }
-
- dialog.Show();
+ string nowSelectId = null;
+ btnFloor.MouseUpEventHandler += (sender, e) =>
+ {
+ //鏄剧ず涓嬫媺鍒楄〃
+ var form = new FloorRoomSelectPopupView();
+ form.ShowDeviceFunctionView(btnFloor, this.functionList, (selectId, listFunc) =>
+ {
+ nowSelectId = selectId;
+ //閲嶆柊鍔犺浇鐣岄潰
+ ShowFunctionRow(listFunc);
+ }, nowSelectId);
};
-
- btnFloor.MouseUpEventHandler = eventHandler;
- btnFloorDownIcon.MouseUpEventHandler = eventHandler;
}
}
}
\ No newline at end of file
--
Gitblit v1.8.0