From 9cfd22c2c308adc7a7ce38cf96be04a70048de01 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 20 七月 2020 15:57:57 +0800 Subject: [PATCH] 2020-07-20-1 --- ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs | 141 ++++++++++++++++++++++++----------------------- 1 files changed, 72 insertions(+), 69 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs index 45f0f72..875c64b 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs @@ -12,8 +12,17 @@ { Tag = "Logic"; } + /// <summary> + /// 璁板綍鐐瑰嚮鎴块棿 + /// </summary> Button roombjButton = new Button(); + /// <summary> + /// 璁板綍鐐瑰嚮鎴块棿鍚嶇О + /// </summary> Button roomTextButton = new Button(); + /// <summary> + /// 璁板綍鐐瑰嚮璁惧 + /// </summary> Button devicetypeButton = new Button(); FrameLayout clickframeLayout = new FrameLayout(); Button clickbutton = new Button(); @@ -27,9 +36,9 @@ /// </summary> public HorizontalScrolViewLayout roomhorizontalScrol = new HorizontalScrolViewLayout { - Width = Application.GetRealWidth(1080 - 58), - Height = Application.GetRealHeight(200), - X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(1080 - 29), + Height = Application.GetRealHeight(204), + X = Application.GetRealWidth(29), Y = Application.GetRealHeight(184), }; /// <summary> @@ -37,11 +46,11 @@ /// </summary> public HorizontalScrolViewLayout devicetypehorizontalScrol = new HorizontalScrolViewLayout { - Width = Application.GetRealWidth(1080 - 58), + Width = Application.GetRealWidth(1080 - 52), Height = Application.GetRealHeight(280), - Y = Application.GetRealHeight(184 + 200), + Y = Application.GetRealHeight(184 + 204), BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, - X = Application.GetRealWidth(58), + X = Application.GetRealWidth(52), // Radius = (uint)Application.GetRealHeight(50), }; @@ -51,8 +60,8 @@ public VerticalScrolViewLayout middle = new VerticalScrolViewLayout { X = Application.GetRealWidth(58), - Y = Application.GetRealHeight(184 + 200 + 280 + 40), - Height = Application.GetRealHeight(Method.H - 40 - 184 - 280 - 200), + Y = Application.GetRealHeight(184 + 204 + 280 + 40), + Height = Application.GetRealHeight(Method.H - 40 - 184 - 280 - 204), BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, }; @@ -214,49 +223,29 @@ { var room = roomlist[i]; - var fra = new FrameLayout - { - Height = Application.GetRealHeight(200), - Width = Application.GetRealWidth(255), - }; - roomhorizontalScrol.AddChidren(fra); - - var roombjBtn = new Button - { - Height = Application.GetRealHeight(158), - Width = Application.GetRealWidth(255), - UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png", - SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png", - Y = Application.GetRealHeight(21), - }; - fra.AddChidren(roombjBtn); - - var roomnameBtn = new Button - { - - Height = Application.GetRealHeight(152 - 26 - 20), - Width = Application.GetRealWidth(255 - 20 - 50), - Text = room.Name, - TextColor = ZigbeeColor.Current.LogicBtnCancelColor, - SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - Y = Application.GetRealHeight(21 + 13 + 10), - X = Application.GetRealWidth(10 + 25), - - }; - fra.AddChidren(roomnameBtn); + LogicView.RoomClickView roomClickView = new LogicView.RoomClickView(); + roomClickView.Show(roomhorizontalScrol); + roomClickView.roomnameBtn.Text = room.Name; if (i == 0)//榛樿閫変腑绗竴涓埧闂� { + roombjButton.IsSelected = false; - roombjButton = roombjBtn; - roombjBtn.IsSelected = true; - + roomClickView.roombjBtn.Height = Application.GetRealHeight(135); + roomClickView.roombjBtn.Width = Application.GetRealWidth(245); + roomClickView.roombjBtn.Y = Application.GetRealHeight(40); + roomClickView.roombjBtn.X = Application.GetRealWidth(0); + roombjButton = roomClickView.roombjBtn; + roomClickView.roombjBtn.IsSelected = true; roomTextButton.IsSelected = false; - roomTextButton = roomnameBtn; - roomnameBtn.IsSelected = true; + roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2); + roomClickView.roomnameBtn.X = Application.GetRealWidth(60); + roomTextButton = roomClickView.roomnameBtn; + roomClickView.roomnameBtn.IsSelected = true; - roombjBtn.IsSelected = true; - roomnameBtn.IsSelected = true; + roomClickView.roombjBtn.IsSelected = true; + roomClickView.roomnameBtn.IsSelected = true; + var list = Method.GetDeviceUIList(room, deviceTypeList); AllDeviceTypeView(list); @@ -264,20 +253,38 @@ EventHandler<MouseEventArgs> roomclick = (sender, e) => { + roombjButton.Height = Application.GetRealHeight(72); + roombjButton.Width = Application.GetRealWidth(170); + roombjButton.Y = Application.GetRealHeight(60); + roombjButton.X = Application.GetRealWidth(26); roombjButton.IsSelected = false; - roombjButton = roombjBtn; - roombjBtn.IsSelected = true; + roombjButton.Height = Application.GetRealHeight(72); + roombjButton.Width = Application.GetRealWidth(170); + roombjButton.Y = Application.GetRealHeight(60); + roombjButton.X = Application.GetRealWidth(26); + roombjButton.IsSelected = false; + + roomClickView.roombjBtn.Height = Application.GetRealHeight(135); + roomClickView.roombjBtn.Width = Application.GetRealWidth(245); + roomClickView.roombjBtn.Y = Application.GetRealHeight(40); + roomClickView.roombjBtn.X = Application.GetRealWidth(0); + roombjButton = roomClickView.roombjBtn; + roomClickView.roombjBtn.IsSelected = true; + + roomTextButton.Width = Application.GetRealWidth(125); + roomTextButton.X = Application.GetRealWidth(26 + 22); roomTextButton.IsSelected = false; - roomTextButton = roomnameBtn; - roomnameBtn.IsSelected = true; - + roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2); + roomClickView.roomnameBtn.X = Application.GetRealWidth(60); + roomTextButton = roomClickView.roomnameBtn; + roomClickView.roomnameBtn.IsSelected = true; var list = Method.GetDeviceUIList(room, deviceTypeList); AllDeviceTypeView(list); }; - roomnameBtn.MouseUpEventHandler += roomclick; - roombjBtn.MouseUpEventHandler += roomclick; + roomClickView.roomnameBtn.MouseUpEventHandler += roomclick; + roomClickView.roombjBtn.MouseUpEventHandler += roomclick; } } @@ -292,30 +299,27 @@ for (int i = 0; i < devicetypelist.Count; i++) { var devicetype = devicetypelist[i]; - var spaceRowLayout = new FrameLayout(); - devicetypehorizontalScrol.AddChidren(spaceRowLayout); + if (i == 0) { + var spaceRowLayout = new FrameLayout(); + devicetypehorizontalScrol.AddChidren(spaceRowLayout); spaceRowLayout.Width = Application.GetRealWidth(37); } - else - { - spaceRowLayout.Width = Application.GetRealWidth(80); - } + var deviceRowLayout = new FrameLayout { - Width = Application.GetRealWidth(156 + 20), - Height = Application.GetRealHeight(280 - 30), - Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(150+75), + Height = Application.GetRealHeight(173+52), + Y = Application.GetRealHeight(35), }; devicetypehorizontalScrol.AddChidren(deviceRowLayout); var backgroundColor = new Button { - Width = Application.GetMinRealAverage(156), - Height = Application.GetMinRealAverage(180), - X = Application.GetRealWidth(10), + Width = Application.GetMinRealAverage(150), + Height = Application.GetMinRealAverage(173), UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png", SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png", }; @@ -326,16 +330,16 @@ { Width = Application.GetMinRealAverage(84), Height = Application.GetMinRealAverage(84), - X = Application.GetRealWidth(46), - Y = Application.GetRealHeight(30), + X = Application.GetRealWidth(35), + Y = Application.GetRealHeight(29), UnSelectedImagePath =Method.GetDeviceTypeIcon(devicetype), }; deviceRowLayout.AddChidren(devicetypeicon); var devicetypename = new Button { - Width = Application.GetRealWidth(176), - Height = Application.GetRealHeight(40), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(52), Text = devicetype, TextAlignment = TextAlignment.Center, Y = backgroundColor.Bottom, @@ -362,7 +366,6 @@ var list = Method.GetDeviceType(devicetypename.Text); ConditionDeviceView(list, devicelist); }; - deviceRowLayout.MouseUpEventHandler += devicetypeclick; devicetypename.MouseUpEventHandler += devicetypeclick; devicetypeicon.MouseUpEventHandler += devicetypeclick; backgroundColor.MouseUpEventHandler += devicetypeclick; -- Gitblit v1.8.0