From 06802250b4b9041d39d568c1dbe77684075006b2 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 11 三月 2020 10:03:44 +0800 Subject: [PATCH] 上传一个版本 --- ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs | 40 ++++++++++++++++++++++++++++------------ 1 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs index ee2e08c..f1d948a 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs @@ -83,7 +83,7 @@ //鏄惁涓哄綋鍓嶈澶� if ((temperDevice?.DeviceEpoint != common.DeviceEpoint || temperDevice?.DeviceAddr != common.DeviceAddr) && (humidDevice?.DeviceEpoint != common.DeviceEpoint || humidDevice?.DeviceAddr != common.DeviceAddr) ) { - //return; + return; } //if (common.Type == DeviceType.TemperatureSensor) @@ -189,7 +189,8 @@ var roomBackView = new FrameLayout() { Width = Application.GetRealWidth(717), - Height = Application.GetRealHeight(478) + Height = Application.GetRealHeight(478), + Radius = (uint)Application.GetRealHeight(17) }; AddChidren(roomBackView); @@ -199,6 +200,14 @@ Radius = (uint)Application.GetRealHeight(17) }; roomBackView.AddChidren(roomImg); + + //鍔犱釜鐗规畩鐨勯伄缃� + var frameBackGroudTemp = new FrameLayout(); + frameBackGroudTemp.Width = roomBackView.Width; + frameBackGroudTemp.Height = roomBackView.Height; + frameBackGroudTemp.Radius = roomBackView.Radius; + frameBackGroudTemp.BackgroundColor = 0x12000000; + roomBackView.AddChidren(frameBackGroudTemp); roomNameBackground = new FrameLayout { @@ -250,10 +259,14 @@ { X = Application.GetRealWidth(69), Width = Application.GetRealWidth(120), - Text = room.Temperatrue == 0 ? "--鈩�" : $"{room.Temperatrue}鈩�", + Text = "--鈩�", TextSize = 14, TextAlignment=TextAlignment.CenterLeft }; + if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) + { + temperatureText.Text = room.Temperatrue == 0 ? "0.0鈩�" : room.Temperatrue.ToString() + "鈩�"; + } roomTemperatureBackground.AddChidren(temperatureText); temperatureText.Width = temperatureText.GetTextWidth() + Application.GetRealWidth(60); @@ -271,16 +284,20 @@ { X = humidityIcon.Right, Width = Application.GetRealWidth(120), - Text = room.Humidity == 0 ? "--%" : $"{room.Humidity}%", + Text = "--%", TextSize = 14, TextAlignment = TextAlignment.CenterLeft }; + if (string.IsNullOrEmpty(room.HumidityDevice) == false) + { + humidityText.Text = room.Humidity == 0 ? "0.0%" : room.Humidity.ToString() + "%"; + } roomTemperatureBackground.AddChidren(humidityText); humidityText.Width = humidityText.GetTextWidth() + Application.GetRealWidth(60); roomTemperatureBackground.Width = (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)) > Application.GetRealWidth(600) ? Application.GetRealWidth(600) : (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)); if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) - { + { //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护 var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); ReadDeviceAttributeLogic.Instance.SendTemperatureStatuComand(dev); @@ -305,13 +322,12 @@ roomListBtn.MouseUpEventHandler += (send, e) => { CommonPage.Instance.IsDrawerLockMode = true; - var editRoom = new Device.Room.EditRoom(); - HomePage.Instance.AddChidren(editRoom); - HomePage.Instance.PageIndex += 1; - editRoom.Show(room); - editRoom.action += () => - { - action?.Invoke(); + + var form = new UserCenter.Residence.EditorRoomInforForm(); + form.AddForm(room); + form.FinishEditorEvent += (roomName2) => + { + action?.Invoke(); }; }; } -- Gitblit v1.8.0