From b69d7735274b8d0f741da8a6bb8b8e1347477a5a Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 19 三月 2020 17:14:16 +0800 Subject: [PATCH] 20200319 --- HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs index 7d098d7..6171977 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs @@ -9,7 +9,7 @@ { #region 鎺т欢闆嗗悎 - FrameLayout bodyView; + static DimmerPage bodyView; /// <summary> /// 鎺у埗鐣岄潰鍔犺浇鍖哄煙 /// </summary> @@ -27,6 +27,10 @@ /// </summary> Button btnCollection; /// <summary> + /// 璋冨厜鎺т欢 + /// </summary> + WaveSeekBar dimmerBar; + /// <summary> /// 寮�鍏虫寜閽� /// </summary> Button btnSwitch; @@ -42,6 +46,12 @@ /// </summary> Action actionRefresh; #endregion + + public override void RemoveFromParent() + { + base.RemoveFromParent(); + bodyView = null; + } public DimmerPage(Light func) { @@ -106,23 +116,23 @@ }; controlView.AddChidren(btnCollection); - var diyImageSeekBar = new WaveSeekBar() + dimmerBar = new WaveSeekBar() { Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(74+16), - Width = Application.GetRealWidth(168-40), - Height = Application.GetRealHeight(288-16-16), - WaveColor = CSS_Color.AuxiliaryColor1, + Y = Application.GetRealHeight(74 + 16), + Width = Application.GetRealWidth(168 - 40), + Height = Application.GetRealHeight(288 - 16 - 16), + WaveColor = light.on_off == 1 ? CSS_Color.AuxiliaryColor1 : CSS_Color.DividingLineColor, WaveBorderColor = CSS_Color.PromptingColor2, BorderColor = 0x00000000, CornerRadius = Application.GetRealWidth(1), BorderWidth = 0, - WavePadding =Application.GetRealWidth(-5), + WavePadding = Application.GetRealWidth(-5), BackgroundColor = CSS_Color.BackgroundColor, Radius = (uint)Application.GetRealWidth(40), - + Progress = light.brightness, }; - controlView.AddChidren(diyImageSeekBar); + controlView.AddChidren(dimmerBar); #region 娓愬彉鏃堕棿璋冭妭 var btnGradualChangeText = new Button() @@ -183,7 +193,6 @@ controlView.AddChidren(btnGradualChangeMaxValuesText); #endregion - btnSwitch = new Button() { Gravity = Gravity.CenterHorizontal, @@ -192,7 +201,8 @@ Height = Application.GetMinRealAverage(40), UnSelectedImagePath = "Public/PowerClose.png", SelectedImagePath = "Public/PowerOpen.png", - IsSelected = light.state != 0 + IsSelected = light.on_off != 0, + //Tag = }; controlView.AddChidren(btnSwitch); -- Gitblit v1.8.0