From cf0bffdf072bae11bdb8c780d0a355818700f713 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期一, 18 五月 2020 15:42:45 +0800 Subject: [PATCH] 请合并代码,优化面板问题 --- ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 58 insertions(+), 1 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs index 7e3146e..f7ac7c2 100644 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs @@ -156,7 +156,7 @@ framePmPic.AddChidren(btnPmStatus); this.listControl.Add(btnPmStatus); - //PM2.5鍗曚綅 + //PM2.5鍗曚綅 锛堢4涓紝listControl銆�3銆戯級 var btnPmUnit = new NormalViewControl(120 + 26, 43, true); btnPmUnit.Y = Application.GetRealHeight(181 + 46); btnPmUnit.X = Application.GetRealWidth(153); @@ -165,6 +165,23 @@ btnPmUnit.TextColor = ZigbeeColor.Current.XMWhite; btnPmUnit.TextAlignment = TextAlignment.CenterLeft; framePmPic.AddChidren(btnPmUnit); + this.listControl.Add(btnPmUnit); + + frameHumidityPic.MouseUpEventHandler += (sender, e) => + { + pMSensor.currentPmData = 35; + UpdateStatus(); + }; + frameTemperaturePic.MouseUpEventHandler += (sender, e) => + { + pMSensor.currentPmData = 99; + UpdateStatus(); + }; + framePmPic.MouseUpEventHandler += (sender, e) => + { + pMSensor.currentPmData = 100; + UpdateStatus(); + }; } #endregion @@ -261,30 +278,70 @@ if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0) { curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + + if (pMSensor.currentPmData < 10) + { + this.listControl[2].Width = Application.GetRealWidth(193 - 70); + this.listControl[3].X = Application.GetRealWidth(180 - 70); + } + else + { + this.listControl[2].Width = Application.GetRealWidth(193 - 40); + this.listControl[3].X = Application.GetRealWidth(153 - 25); + + this.listControl[2].BackgroundColor = 0xff00ff00; + this.listControl[3].BackgroundColor = 0xff00ffff; + } } + else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35) { curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + this.listControl[2].Width = Application.GetRealWidth(193 - 40); + this.listControl[3].X = Application.GetRealWidth(153 - 25); } else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75) { curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + + if (pMSensor.currentPmData < 100) + { + this.listControl[2].Width = Application.GetRealWidth(193 - 40); + this.listControl[3].X = Application.GetRealWidth(153 - 25); + this.listControl[2].BackgroundColor = 0xff00ff00; + this.listControl[3].BackgroundColor = 0xff00ffff; + } + else + { + this.listControl[2].Width = Application.GetRealWidth(162); + this.listControl[3].X = Application.GetRealWidth(153); + this.listControl[2].BackgroundColor = 0xff00ff00; + this.listControl[3].BackgroundColor = 0xff00ffff; + } } else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115) { curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + this.listControl[2].Width = Application.GetRealWidth(162); + this.listControl[3].X = Application.GetRealWidth(153); } else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150) { curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + this.listControl[2].Width = Application.GetRealWidth(162); + this.listControl[3].X = Application.GetRealWidth(153); } else if (pMSensor.currentPmData > 250) { curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); + this.listControl[2].Width = Application.GetRealWidth(162); + this.listControl[3].X = Application.GetRealWidth(153); } else { curQuality = ""; + this.listControl[2].Width = Application.GetRealWidth(0); + this.listControl[3].Gravity = Gravity.CenterHorizontal; } //璁剧疆鐘舵�佹枃瀛� return curQuality; -- Gitblit v1.8.0