From 1802b849f0dadc81644fb0a706d6fb45efdf2a20 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 24 十一月 2021 16:13:06 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/newBranch1' into WJC

---
 HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs |  134 +++++++++++++++++++++++---------------------
 1 files changed, 71 insertions(+), 63 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
index 2da3103..52f25af 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
@@ -166,74 +166,82 @@
             };
             controlView.AddChidren(btnBrightnessText);
 
-            #region 娓愬彉鏃堕棿璋冭妭
-            var btnGradualChangeText = new Button()
+            if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null)
             {
-                X = Application.GetRealWidth(35),
-                Y = Application.GetRealHeight(385),
-                Width = Application.GetRealWidth(224),
-                Height = Application.GetRealHeight(21),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = CSS_Color.FirstLevelTitleColor,
-                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                TextID = StringId.SpeedOfChange,
-                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime)!= null,
-                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime)!= null,
-            };
-            controlView.AddChidren(btnGradualChangeText);
+                #region 娓愬彉鏃堕棿璋冭妭
 
-            var btnGradualChangeMinValuesText = new Button()
-            {
-                X = Application.GetRealWidth(35),
-                Y = btnGradualChangeText.Bottom+ Application.GetRealHeight(8),
-                Width = Application.GetRealWidth(22),
-                Height = Application.GetRealHeight(21),
-                Text = "0s",
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = CSS_Color.PromptingColor1,
-                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-            };
-            controlView.AddChidren(btnGradualChangeMinValuesText);
+                var btnGradualChangeText = new Button()
+                {
+                    X = Application.GetRealWidth(35),
+                    Y = Application.GetRealHeight(385),
+                    Width = Application.GetRealWidth(224),
+                    Height = Application.GetRealHeight(21),
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextID = StringId.SpeedOfChange,
+                    Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+                    Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+                };
+                controlView.AddChidren(btnGradualChangeText);
 
-            barFadeTime = new DiyImageSeekBar()
-            {
-                X = btnGradualChangeMinValuesText.Right,
-                Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
-                Width = Application.GetRealWidth(210),
-                Height = Application.GetRealHeight(54),
-                SeekBarViewHeight = Application.GetRealHeight(8),
-                ThumbImagePath = "Public/ThumbImage.png",
-                ThumbImageHeight = Application.GetRealHeight(54),
-                ProgressBarColor = CSS_Color.MainColor,
-                ProgressTextColor = CSS_Color.FirstLevelTitleColor,
-                ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                ProgressBarUnitSring = "s",
-                MaxValue = 10,
-                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)),
-                SeekBarPadding = Application.GetRealWidth(20),
-                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-            };
-            controlView.AddChidren(barFadeTime);
+                var btnGradualChangeMinValuesText = new Button()
+                {
+                    X = Application.GetRealWidth(35),
+                    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
+                    Width = Application.GetRealWidth(22),
+                    Height = Application.GetRealHeight(21),
+                    Text = "0s",
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = CSS_Color.PromptingColor1,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+                    Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+                };
+                controlView.AddChidren(btnGradualChangeMinValuesText);
 
-            var btnGradualChangeMaxValuesText = new Button()
-            {
-                X = barFadeTime.Right,
-                Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
-                Width = Application.GetRealWidth(35),
-                Height = Application.GetRealHeight(21),
-                Text = "10s",
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = CSS_Color.PromptingColor1,
-                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-                Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-            };
-            controlView.AddChidren(btnGradualChangeMaxValuesText);
-            #endregion
+                barFadeTime = new DiyImageSeekBar()
+                {
+                    X = btnGradualChangeMinValuesText.Right,
+                    Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
+                    Width = Application.GetRealWidth(210),
+                    Height = Application.GetRealHeight(54),
+                    SeekBarViewHeight = Application.GetRealHeight(8),
+                    ThumbImagePath = "Public/ThumbImage.png",
+                    ThumbImageHeight = Application.GetRealHeight(54),
+                    ProgressBarColor = CSS_Color.MainColor,
+                    ProgressTextColor = CSS_Color.FirstLevelTitleColor,
+                    ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    ProgressBarUnitSring = "s",
+                    MaxValue = 10,
+                    Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)),
+                    SeekBarPadding = Application.GetRealWidth(20),
+                    Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+                    Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+                };
+                controlView.AddChidren(barFadeTime);
+                barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
+                {
+                    function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString());
+                    function.UpdataFuncitonInfo();
+                };
 
+                var btnGradualChangeMaxValuesText = new Button()
+                {
+                    X = barFadeTime.Right,
+                    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
+                    Width = Application.GetRealWidth(35),
+                    Height = Application.GetRealHeight(21),
+                    Text = "10s",
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = CSS_Color.PromptingColor1,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+                    Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+                };
+                controlView.AddChidren(btnGradualChangeMaxValuesText);
+                #endregion
+            }
             btnSwitch = new Button()
             {
                 Gravity = Gravity.CenterHorizontal,

--
Gitblit v1.8.0