From b9cb076fe6127160c96c35bf9c8cebcffe1d5ccd Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 10 一月 2020 17:35:23 +0800 Subject: [PATCH] 2020.1.10 --- ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs index ed3cd89..bcbcbbc 100644 --- a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs @@ -20,7 +20,7 @@ /// <summary> /// The action. /// </summary> - public Action action; + public Action<DeviceUI, Common.Room> action; /// <summary> /// The light image. @@ -137,7 +137,7 @@ } light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData; deviceIMG.IsSelected = switchBtn.IsSelected = light.OnOffStatus == 1; - StatuBtn.Text = CommonFormResouce.GetSwitchStatu(deviceIMG.IsSelected); + StatuBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}"; light.LastDateTime = DateTime.Now; } } @@ -185,8 +185,8 @@ public override void RemoveFromParent() { ZbGateway.StatusList.Remove(this); - //action(); - //action = null; + action(device, room); + action = null; if (IsDrawerLockMode) { CommonPage.Instance.IsDrawerLockMode = false; @@ -241,8 +241,7 @@ } } - var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName); - if (de == null) + if(Common.Room.CurrentRoom.IsCollectInRoom(device.FileName) == false) { collectionBtn.IsSelected = false; } @@ -330,7 +329,8 @@ Gravity = Gravity.CenterHorizontal, Text = device.CommonDevice.DeviceEpointName, TextColor = ZigbeeColor.Current.GXCTextBlackColor, - TextSize=15 + TextSize=15, + IsBold=true }; itemView.AddChidren(deviceNameBtn); @@ -341,9 +341,11 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterHorizontal, TextColor = ZigbeeColor.Current.GXCTextGrayColor, - Text=CommonFormResouce.GetSwitchStatu((device.CommonDevice as ToggleLight).OnOffStatus == 1) + Text= $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}", + TextSize =10 }; itemView.AddChidren(StatuBtn); + deviceIMG = new Button() { @@ -404,7 +406,8 @@ Height = Application.GetRealHeight(50), Text = room.Name, TextAlignment = TextAlignment.CenterLeft, - TextColor = ZigbeeColor.Current.GXCTextWhiteColor + TextColor = ZigbeeColor.Current.GXCTextWhiteColor, + TextSize=12 }; itemView.AddChidren(roomName); } @@ -437,7 +440,8 @@ zbGateway.ReportAction += UpdateDeviceControllStatu; switchBtn.IsSelected = !switchBtn.IsSelected; deviceIMG.IsSelected = !deviceIMG.IsSelected; - StatuBtn.Text = CommonFormResouce.GetSwitchStatu(deviceIMG.IsSelected); + StatuBtn.Text = deviceIMG.IsSelected ? $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Open)}" : $"{Language.StringByID(R.MyInternationalizationString.Current)} {Language.StringByID(R.MyInternationalizationString.Shut)}"; + if (switchBtn.IsSelected == true) { (device.CommonDevice as ToggleLight).SwitchControl(1); @@ -477,9 +481,9 @@ UserView.HomePage.Instance.AddChidren(detailInfo); UserView.HomePage.Instance.PageIndex += 1; detailInfo.Show(device, room); - detailInfo.action = () => + detailInfo.EditAction += (curDev, curRoom) => { - Show(device, room); + Show(curDev, curRoom); }; } -- Gitblit v1.8.0