From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs | 51 ++++++++++++++++++++++++++++++++------------------- 1 files changed, 32 insertions(+), 19 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs index f81d8a3..3c650d2 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs @@ -14,10 +14,6 @@ #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> - /// 璁惧Mac鍦板潃 - /// </summary> - private string deviceMac = string.Empty; - /// <summary> /// 浜害璋冭妭鐨勪俊鎭� /// </summary> private Panel.PanelSwitchLevelInfo linghtLevelInfo = null; @@ -45,7 +41,6 @@ { this.ScrollEnabled = false; - this.deviceMac = i_deviceMac; this.listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac); //璁剧疆澶撮儴淇℃伅 @@ -58,10 +53,10 @@ /// <summary> /// 鍒濆鍖栦腑閮ㄤ俊鎭� /// </summary> - private async void InitMiddleFrame() + private void InitMiddleFrame() { //鑾峰彇璁惧鍒濆鏁版嵁 - var result = await this.GetDeviceDefultData(); + var result = this.GetDeviceDefultData(); if (result == false) { return; @@ -96,20 +91,20 @@ var btnSave = new BottomClickButton(); btnSave.TextID = R.MyInternationalizationString.uSave; bodyFrameLayout.AddChidren(btnSave); - btnSave.ButtonClickEvent += async (sender, e) => + btnSave.ButtonClickEvent += (sender, e) => { if (valueChanged == true) { this.ShowProgressBar(); //浜害璋冭妭鏇存敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) - result = await HdlDevicePanelLogic.Current.SetDeviceLightSettion(listDevice[0], linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel); + result = HdlDevicePanelLogic.Current.SetDeviceLightSettion(listDevice[0], linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel); if (result == false) { this.CloseProgressBar(); return; } //鑺傝兘妯″紡淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) - result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(listDevice[0], energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); + result = HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(listDevice[0], energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); this.CloseProgressBar(); if (result == false) { @@ -235,6 +230,12 @@ btnProgressView1.Visible = true; btnProgress1.Visible = true; } + //濡傛灉褰撳墠鏄睍绀烘ā鏉� + if (Common.Config.Instance.Home.IsShowTemplate == true) + { + seekBar1.Enable = false; + btnSwitch.CanClick = false; + } } #endregion @@ -259,7 +260,7 @@ btnProgress1.Y = Application.GetRealHeight(29); btnProgress1.TextSize = 12; btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1; - btnProgress1.Text = linghtLevelInfo.panelBacklightLevel + "%"; + btnProgress1.Text = linghtLevelInfo.panelDirectionsLevel + "%"; frameLinght.AddChidren(btnProgress1); //杩涘害鏉� @@ -271,10 +272,10 @@ { btnProgress1.Text = value + "%"; //鏁版嵁鍙樻洿 - linghtLevelInfo.panelBacklightLevel = value; + linghtLevelInfo.panelDirectionsLevel = value; valueChanged = true; }; - seekBar1.Progress = linghtLevelInfo.panelBacklightLevel; + seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel; var btnTemp1 = new NormalViewControl(200, 49, true); btnTemp1.X = ControlCommonResourse.XXLeft; @@ -299,6 +300,12 @@ btnLine.Gravity = Gravity.CenterHorizontal; btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine; frameLinght.AddChidren(btnLine); + + //濡傛灉褰撳墠鏄睍绀烘ā鏉� + if (Common.Config.Instance.Home.IsShowTemplate == true) + { + seekBar1.Enable = false; + } } #endregion @@ -323,7 +330,7 @@ btnProgress1.Y = Application.GetRealHeight(369); btnProgress1.TextSize = 12; btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1; - btnProgress1.Text = linghtLevelInfo.panelDirectionsLevel + "%"; + btnProgress1.Text = linghtLevelInfo.panelBacklightLevel + "%"; frameLinght.AddChidren(btnProgress1); //杩涘害鏉� @@ -335,10 +342,10 @@ { btnProgress1.Text = value + "%"; //鏁版嵁鍙樻洿 - linghtLevelInfo.panelDirectionsLevel = value; + linghtLevelInfo.panelBacklightLevel = value; valueChanged = true; }; - seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel; + seekBar1.Progress = linghtLevelInfo.panelBacklightLevel; var btnTemp1 = new NormalViewControl(200, 49, true); btnTemp1.X = ControlCommonResourse.XXLeft; @@ -363,6 +370,12 @@ btnLine.Y = Application.GetRealHeight(651); btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine; frameLinght.AddChidren(btnLine); + + //濡傛灉褰撳墠鏄睍绀烘ā鏉� + if (Common.Config.Instance.Home.IsShowTemplate == true) + { + seekBar1.Enable = false; + } } #endregion @@ -373,12 +386,12 @@ /// 鑾峰彇璁惧鍒濆鏁版嵁 /// </summary> /// <returns></returns> - private async Task<bool> GetDeviceDefultData() + private bool GetDeviceDefultData() { //寮�鍚繘搴︽潯 this.ShowProgressBar(); //浜害璋冭妭(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡) - linghtLevelInfo = await HdlDevicePanelLogic.Current.GetDeviceLightSettion(listDevice[0]); + linghtLevelInfo = HdlDevicePanelLogic.Current.GetDeviceLightSettion(listDevice[0]); if (linghtLevelInfo == null) { //鍏抽棴杩涘害鏉� @@ -386,7 +399,7 @@ return false; } //鑺傝兘妯″紡(浠栦滑璇撮殢渚挎嬁涓�璺洖璺氨琛屼簡) - energyModeInfo = await HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(listDevice[0]); + energyModeInfo = HdlDevicePanelLogic.Current.GetDeviceEnergyConservationMode(listDevice[0]); if (energyModeInfo == null) { //鍏抽棴杩涘害鏉� -- Gitblit v1.8.0