From e22fdb94322e6cec38e5e4a9aec13d431a133fde Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期二, 28 四月 2020 16:32:35 +0800 Subject: [PATCH] 上传合并后的代码 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs | 198 ++++++++++++++++++++++++------------------------ 1 files changed, 99 insertions(+), 99 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs index bb77abd..6181276 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs @@ -2,17 +2,17 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; -using ZigBee.Device; -namespace Shared.Phone.UserCenter.DevicePanel -{ - public class PanelBackLighWithSensorForm : EditorCommonForm - { - #region 鈻� 鍙橀噺澹版槑___________________________ +using ZigBee.Device; +namespace Shared.Phone.UserCenter.DevicePanel +{ + public class PanelBackLighWithSensorForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> /// 鍒楄〃鎺т欢 /// </summary> - private VerticalScrolViewLayout listview = null; - + private VerticalScrolViewLayout listview = null; + /// <summary> /// 闈㈡澘鐨勫洖璺� /// </summary> @@ -68,35 +68,35 @@ if (result == false) { return; - } - - //娓呯┖bodyFrame - this.ClearBodyFrame(); - + } + + //娓呯┖bodyFrame + this.ClearBodyFrame(); + HdlThreadLogic.Current.RunMain(() => { - listview = new VerticalScrolViewLayout(); - listview.Height = Application.GetRealHeight(1981 - 184); - bodyFrameLayout.AddChidren(listview); - - //娣诲姞鑺傝兘妯″紡 - this.AddEnergyConservationRow(); - //娣诲姞鐐瑰嚮鍓嶏紝浜害杩涘害鏉� + listview = new VerticalScrolViewLayout(); + listview.Height = Application.GetRealHeight(1981 - 184); + bodyFrameLayout.AddChidren(listview); + + //娣诲姞鑺傝兘妯″紡 + this.AddEnergyConservationRow(); + //娣诲姞鐐瑰嚮鍓嶏紝浜害杩涘害鏉� this.AddBeforeClickProgress(); //娣诲姞鐐瑰嚮鍚庯紝浜害杩涘害鏉� - this.AddAfterClickProgress(); - - this.FinishInitControl(listview, energyModeInfo.enable); + this.AddAfterClickProgress(); - //淇濆瓨 - var btnSave = new BottomClickButton(); - btnSave.TextID = R.MyInternationalizationString.uSave; - bodyFrameLayout.AddChidren(btnSave); - btnSave.ButtonClickEvent += (sender, e) => - { - //淇濆瓨闈㈡澘鏁版嵁 - this.SavePanelData(); - }; + this.FinishInitControl(listview, energyModeInfo.enable); + + //淇濆瓨 + var btnSave = new BottomClickButton(); + btnSave.TextID = R.MyInternationalizationString.uSave; + bodyFrameLayout.AddChidren(btnSave); + btnSave.ButtonClickEvent += (sender, e) => + { + //淇濆瓨闈㈡澘鏁版嵁 + this.SavePanelData(); + }; }); } @@ -123,18 +123,18 @@ btnSwitch.ButtonClickEvent += (sender, e) => { btnSwitch.IsSelected = !btnSwitch.IsSelected; - energyModeInfo.enable = btnSwitch.IsSelected; - //灞曞紑鎴栬�呯缉灏忕殑楂樺害 + energyModeInfo.enable = btnSwitch.IsSelected; + //灞曞紑鎴栬�呯缉灏忕殑楂樺害 var value = Application.GetRealHeight(443); if (btnSwitch.IsSelected == true) { - frameBack.Height += value; + frameBack.Height += value; } else { - frameBack.Height -= value; - } - //瀹瑰櫒琛ュ厖 + frameBack.Height -= value; + } + //瀹瑰櫒琛ュ厖 this.FinishInitControl(listview, energyModeInfo.enable); }; if (energyModeInfo.enable == true) @@ -195,20 +195,20 @@ frameBack.Height += value; } - //娣诲姞鎺ヨ繎鎰熷簲 - this.AddProximitySensorsRow(frameBack); - } - + //娣诲姞鎺ヨ繎鎰熷簲 + this.AddProximitySensorsRow(frameBack); + } + #endregion - + #region 鈻� 鎺ヨ繎鎰熷簲___________________________ - + /// <summary> /// 鎺ヨ繎鎰熷簲琛� /// </summary> private void AddProximitySensorsRow(FrameRowControl frameRowControl) - { - //鎺ヨ繎鎰熷簲琛� + { + //鎺ヨ繎鎰熷簲琛� var frameBack = new FrameRowControl(); frameBack.BackgroundColor = UserCenterColor.Current.White; frameBack.UseClickStatu = false; @@ -219,22 +219,22 @@ //鎺ヨ繎鎰熷簲 frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.ProximitySensors), 400); //寮�鍏虫帶浠� - var btnSwitch = frameBack.AddMostRightSwitchIcon(); - - btnSwitch.ButtonClickEvent += (sender, e) => - { - btnSwitch.IsSelected = !btnSwitch.IsSelected; - proximitySensorsInfo.enable = btnSwitch.IsSelected; - }; + var btnSwitch = frameBack.AddMostRightSwitchIcon(); + + btnSwitch.ButtonClickEvent += (sender, e) => + { + btnSwitch.IsSelected = !btnSwitch.IsSelected; + proximitySensorsInfo.enable = btnSwitch.IsSelected; + }; if (proximitySensorsInfo.enable == true) { btnSwitch.IsSelected = true; - } - } + } + } #endregion - + #region 鈻� 鐐瑰嚮鍓峗____________________________ - + /// <summary> /// 娣诲姞鐐瑰嚮鍓嶇殑鑳屽厜鐏繘搴︽潯 /// </summary> @@ -243,7 +243,7 @@ { //鐐瑰嚮鍓� var btnClick = new NormalViewControl(600, 107, true); - btnClick.X = ControlCommonResourse.XXLeft; + btnClick.X = ControlCommonResourse.XXLeft; btnClick.TextSize = 12; btnClick.TextColor = UserCenterColor.Current.TextGrayColor3; btnClick.TextID = R.MyInternationalizationString.uBeforeClick; @@ -299,16 +299,16 @@ btnTemp2.Text = "100%"; frameBack.AddChidren(btnTemp2); - var frameColor = new FrameLayoutControl(); + var frameColor = new FrameLayoutStatuControl(); frameColor.UseClickStatu = false; frameColor.Width = Application.GetRealHeight(262); - frameColor.Height = Application.GetMinRealAverage(79); + frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); frameBack.AddChidren(frameColor); //棰滆壊 - var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false); + var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false); btnColorView.Gravity = Gravity.CenterVertical; btnColorView.TextAlignment = TextAlignment.CenterRight; btnColorView.TextSize = 12; @@ -320,33 +320,33 @@ int R1 = Convert.ToInt32(this.keyColorData.CloseColorR, 16); int G1 = Convert.ToInt32(this.keyColorData.CloseColorG, 16); int B1 = Convert.ToInt32(this.keyColorData.CloseColorB, 16); - uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); - - //棰滆壊澶栨 - var btnColorLine = new FrameLayoutControl(); + uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); + + //棰滆壊澶栨 + var btnColorLine = new FrameLayoutStatuControl(); btnColorLine.Width = Application.GetRealHeight(79); - btnColorLine.Height = Application.GetMinRealAverage(79); + btnColorLine.Height = this.GetPictrueRealSize(79); btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18); - btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2; + btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2; btnColorLine.BorderWidth = 1; - btnColorLine.BorderColor = 0xffcccccc; + btnColorLine.BorderColor = 0xffcccccc; frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); - var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false); + var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false); btnColor.Gravity = Gravity.Center; - btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2; + btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2; btnColor.BackgroundColor = backColor; btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly); //鍙樻洿婊戝姩鏉$殑棰滆壊 seekBar1.ProgressBarColor = backColor; - var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false); + var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false); btnRight.UnSelectedImagePath = "Item/RightNext.png"; btnRight.Y = Application.GetRealHeight(5); - btnRight.X = frameColor.Width - Application.GetMinRealAverage(58); + btnRight.X = frameColor.Width - this.GetPictrueRealSize(58); frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly); - btnRight.Y += Application.GetMinRealAverage(8); + btnRight.Y += this.GetPictrueRealSize(8); frameColor.ButtonClickEvent += (sender, e) => { @@ -437,16 +437,16 @@ btnTemp2.Text = "100%"; frameBack.AddChidren(btnTemp2); - var frameColor = new FrameLayoutControl(); + var frameColor = new FrameLayoutStatuControl(); frameColor.UseClickStatu = false; frameColor.Width = Application.GetRealHeight(262); - frameColor.Height = Application.GetMinRealAverage(79); + frameColor.Height = this.GetPictrueRealSize(79); frameColor.Y = Application.GetRealHeight(26); frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262); - frameBack.AddChidren(frameColor); - - //棰滆壊 - var btnColorView = new NormalViewControl(Application.GetRealHeight(110), Application.GetMinRealAverage(49), false); + frameBack.AddChidren(frameColor); + + //棰滆壊 + var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false); btnColorView.Gravity = Gravity.CenterVertical; btnColorView.TextAlignment = TextAlignment.CenterRight; btnColorView.TextSize = 12; @@ -458,33 +458,33 @@ int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16); int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16); int B1 = Convert.ToInt32(this.keyColorData.OpenColorB, 16); - uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); - - //棰滆壊澶栨 - var btnColorLine = new FrameLayoutControl(); + uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); + + //棰滆壊澶栨 + var btnColorLine = new FrameLayoutStatuControl(); btnColorLine.Width = Application.GetRealHeight(79); - btnColorLine.Height = Application.GetMinRealAverage(79); + btnColorLine.Height = this.GetPictrueRealSize(79); btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18); - btnColorLine.Radius = (uint)Application.GetMinRealAverage(79) / 2; + btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2; btnColorLine.BorderWidth = 1; - btnColorLine.BorderColor = 0xffcccccc; - frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); - - var btnColor = new NormalViewControl(Application.GetMinRealAverage(69), Application.GetMinRealAverage(69), false); + btnColorLine.BorderColor = 0xffcccccc; + frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); + + var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false); btnColor.Gravity = Gravity.Center; - btnColor.Radius = (uint)Application.GetMinRealAverage(69) / 2; + btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2; btnColor.BackgroundColor = backColor; btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly); //鍙樻洿婊戝姩鏉$殑棰滆壊 seekBar1.ProgressBarColor = backColor; - var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false); + var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false); btnRight.UnSelectedImagePath = "Item/RightNext.png"; btnRight.Y = Application.GetRealHeight(5); - btnRight.X = frameColor.Width - Application.GetMinRealAverage(58); + btnRight.X = frameColor.Width - this.GetPictrueRealSize(58); frameColor.AddChidren(btnRight, ChidrenBindMode.BindEventOnly); - btnRight.Y += Application.GetMinRealAverage(8); + btnRight.Y += this.GetPictrueRealSize(8); frameColor.ButtonClickEvent += (sender, e) => { @@ -575,15 +575,15 @@ } //鑺傝兘妯″紡淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) - //璁惧鍚屼簨璇撮粯璁ゅ幓绉掓椂闂达紝杩欐牱鎺ヨ繎鎰熷簲鍔熻兘鎵嶅悎鐞� - energyModeInfo.time = 1; + //鑲栧織璞粰鎸夐敭鎺у埗闈㈡澘锛堝洓寮�鍏帶锛夎澶囷紝璇撮粯璁�15绉掓椂闂达紝杩欐牱鎺ヨ繎鎰熷簲鍔熻兘鎵嶅悎鐞� + energyModeInfo.time = 15; result = await HdlDevicePanelLogic.Current.SetDeviceEnergyConservationMode(panelDevice, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); if (result == false) { this.CloseProgressBar(); return; } - //鎺ヨ繎淇敼(浠栦滑璇撮殢渚夸竴涓洖璺氨琛�) + //鎺ヨ繎浼犳劅璁剧疆 (鑲栧織璞粰鎸夐敭鎺у埗闈㈡澘锛堝洓寮�鍏帶锛夎澶囷紝浼犳劅璺濈鍜岃Е鍙戝欢杩熸椂闂撮粯璁ょ敤鏈�澶у��) result = await HdlDevicePanelLogic.Current.SetProximitySensorStatus(panelDevice, proximitySensorsInfo.enable); if (result == false) { @@ -640,8 +640,8 @@ private uint GetColorByRGB(byte R, byte G, byte B) { return (uint)(0xFF000000 + R * 256 * 256 + G * 256 + B); - } - + } + #endregion } -} +} -- Gitblit v1.8.0