From b94f318b1cb5c3618dd53b5240c1d999c8427b71 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 29 十一月 2019 13:09:25 +0800 Subject: [PATCH] 2019.11.29 --- ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs | 30 ++++++++++++++---------------- 1 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs index 019f512..551355a 100644 --- a/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs +++ b/ZigbeeApp/Shared/Phone/Device/Room/EditRoom.cs @@ -60,7 +60,7 @@ room = r; IconPathType = r.BackgroundImageType; OldIconPathType= r.BackgroundImageType; - if (IconPathType != 1) + if (IconPathType != 0) { OldBackgroundImagePath = r.BackgroundImage; } @@ -75,6 +75,7 @@ HdlDeviceAttributeLogic.Current.RemoveEvent("TemperatrueDevice"); HdlDeviceAttributeLogic.Current.RemoveEvent("HumidityDevice"); + CommonPage.Instance.IsDrawerLockMode = false; base.RemoveFromParent(); } @@ -108,16 +109,6 @@ }; AddChidren(bodyFrameLayout); - var imgFL = new Button - { - Y = Application.GetRealHeight(60), - Width = Application.GetMinRealAverage(916), - Height = Application.GetMinRealAverage(487), - Gravity = Gravity.CenterHorizontal, - UnSelectedImagePath = "Room/Room_Rectangle.png" - }; - bodyFrameLayout.AddChidren(imgFL); - backGround = new Button() { Y = Application.GetRealHeight(60), @@ -127,7 +118,12 @@ Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius), UnSelectedImagePath = room.BackgroundImage }; + if (room.BackgroundImageType != 0) + { + backGround.UnSelectedImagePath = System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage); + } bodyFrameLayout.AddChidren(backGround); + backGround.SetViewShadow(true); backGround.MouseUpEventHandler += backGroundIMGHander; var infoFL = new FrameLayout @@ -137,6 +133,8 @@ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor }; bodyFrameLayout.AddChidren(infoFL); + var rectCornerID = HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight; + infoFL.SetCornerWithSameRadius(Application.GetRealHeight(50), rectCornerID); var infoEdit = new Button { @@ -188,7 +186,6 @@ var temperatureRow = new DeviceInfoRow(446); temperatureRow.Init(); temperatureRow.SetTipTitle(R.MyInternationalizationString.Temperature); - temperatureRow.SetTitle("26.8鈩�"); temperatureRow.NameText.TextAlignment = TextAlignment.CenterRight; infoFL.AddChidren(temperatureRow); temperatureRow.ClickBtn.MouseUpEventHandler += (sender, e) => @@ -300,7 +297,6 @@ var humidityRow = new DeviceInfoRow(585); humidityRow.Init(); humidityRow.SetTipTitle(R.MyInternationalizationString.Humidity); - humidityRow.SetTitle("66.5%"); humidityRow.NameText.TextAlignment = TextAlignment.CenterRight; infoFL.AddChidren(humidityRow); humidityRow.ClickBtn.MouseUpEventHandler += (sender, e) => @@ -308,6 +304,7 @@ var tem = new RoomHumiditySetting { }; HomePage.Instance.AddChidren(tem); HomePage.Instance.PageIndex += 1; + tem.tempDevice = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); tem.Show(room); tem.selectDeviceAction = (selectTemp) => { @@ -398,9 +395,9 @@ var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo); var fileName = $"Room_{tradeTime}"; room.Name = nameRow.NameText.Text.Trim(); - if (OldIconPathType != 1) + if (OldIconPathType != 0) { - Shared.IO.FileUtils.DeleteFile(OldBackgroundImagePath); + Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath,OldBackgroundImagePath)); } if (IconPathType == 0) { @@ -409,7 +406,7 @@ else { Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); - room.BackgroundImage = System.IO.Path.Combine(Config.Instance.FullPath, fileName); + room.BackgroundImage = fileName; } room.BackgroundImageType = IconPathType; room.Save(); @@ -515,6 +512,7 @@ localPic.action = (imgPath) => { IconPathType = 0; + backGround.ImageBytes = null; backGround.UnSelectedImagePath = imgPath; }; }; -- Gitblit v1.8.0