From 43c70fc6de6ac0710c5e89b591c2d141c4e1ff93 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 03 一月 2024 16:45:32 +0800
Subject: [PATCH] 版本信息更新

---
 HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs |  114 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 98 insertions(+), 16 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
index 4a05b7c..2837dd2 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
@@ -1,10 +1,7 @@
 锘縰sing System;
 using System.Collections.Generic;
-using HDL_ON.Common;
-using HDL_ON.DriverLayer;
 using HDL_ON.Entity;
 using HDL_ON.UI.CSS;
-using Java.Util.Functions;
 using Shared;
 
 namespace HDL_ON.UI
@@ -51,7 +48,7 @@
             controlView = new FrameLayout()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(88),
+                Y = Application.GetRealHeight(88 + 10),
                 Width = Application.GetRealWidth(327),
                 Height = Application.GetRealHeight(526),
                 BackgroundImagePath = "Public/Fragmentbg.png",
@@ -216,10 +213,22 @@
                 Y = Application.GetRealHeight(466),
                 Width = Application.GetMinRealAverage(32),
                 Height = Application.GetMinRealAverage(32),
-                //UnSelectedImagePath = "Public/PowerClose.png",
-                UnSelectedImagePath = "Public/PowerOpen.png",
+                UnSelectedImagePath = "FunctionIcon/Light/LightScene/gp_all_on.png",
             };
             controlView.AddChidren(btnOn);
+            var btnOnText = new Button()
+            {
+                X = Application.GetRealWidth(100-9),
+                Y = Application.GetRealHeight(495),
+                Width = Application.GetMinRealAverage(50),
+                Height = Application.GetMinRealAverage(32),
+                TextColor = CSS_Color.TextualColor,
+                TextSize = CSS_FontSize.TextFontSize,
+                TextAlignment = TextAlignment.Center,
+                TextID = StringId.Open,
+            };
+            controlView.AddChidren(btnOnText);
+
 
             var btnOff = new Button()
             {
@@ -227,10 +236,24 @@
                 Y = Application.GetRealHeight(466),
                 Width = Application.GetMinRealAverage(32),
                 Height = Application.GetMinRealAverage(32),
-                UnSelectedImagePath = "Public/PowerClose.png",
-                //UnSelectedImagePath = "Public/PowerOpen.png",
+                UnSelectedImagePath = "FunctionIcon/Light/LightScene/gp_all_off.png",
             };
             controlView.AddChidren(btnOff);
+            var btnOffText = new Button()
+            {
+                X = Application.GetRealWidth(180 - 9),
+                Y = Application.GetRealHeight(495),
+                Width = Application.GetMinRealAverage(50),
+                Height = Application.GetMinRealAverage(32),
+                TextColor = CSS_Color.TextualColor,
+                TextSize = CSS_FontSize.TextFontSize,
+                TextAlignment = TextAlignment.Center,
+                TextID = StringId.Close,
+            };
+            controlView.AddChidren(btnOffText);
+
+
+
             btnOn.MouseUpEventHandler = (sender, e) =>
             {
                 var d = new Dictionary<string, string>();
@@ -244,19 +267,32 @@
                 d.Add(FunctionAttributeKey.OnOff, "off");
                 function.Control(d);
             };
+            btnOnText.MouseUpEventHandler = (sender, e) =>
+            {
+                var d = new Dictionary<string, string>();
+                d.Add(FunctionAttributeKey.OnOff, "on");
+                function.Control(d);
+            };
+
+            btnOffText.MouseUpEventHandler = (sender, e) =>
+            {
+                var d = new Dictionary<string, string>();
+                d.Add(FunctionAttributeKey.OnOff, "off");
+                function.Control(d);
+            };
 
 
             if (hadRGB)
             {
-                LoadRgbAttrView(hadCCT,hadColorful);
+                LoadRgbAttrView(hadCCT,hadColorful,btnOn,btnOff);
             }
             else if (hadCCT)
             {
-                LoadCctAttrView(attrView);
+                LoadCctAttrView(attrView, btnOn, btnOff);
             }
             else if (hadDimming)
             {
-                LoadDimmingAttrView(attrView);
+                LoadDimmingAttrView(attrView, btnOn, btnOff);
             }
             else
             {
@@ -298,7 +334,7 @@
         /// 鍔犺浇璋冨厜灞炴�ц缃帶浠�
         /// </summary>
         /// <param name="attrView"></param>
-        void LoadDimmingAttrView(VerticalScrolViewLayout attrView)
+        void LoadDimmingAttrView(VerticalScrolViewLayout attrView,Button btnOn,Button btnOff)
         {
 
 
@@ -352,6 +388,10 @@
 
             dimmerBar.OnProgressChangedEvent = (sender, e) =>
             {
+
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+                return;
                 if (e == 0 && lastBrightness != 0)
                 {
                     lastBrightness = 0;
@@ -383,10 +423,21 @@
                     }
                 }
 
+            };
 
+
+
+            btnOn.MouseUpEventHandler += (sender, e) => {
+                dimmerBar.Progress = 100;
                 btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
                 btnBrightnessText.Text = dimmerBar.Progress + "%";
             };
+            btnOff.MouseUpEventHandler += (sender, e) => {
+                dimmerBar.Progress = 0;
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+            };
+
 
         }
         int lastBrightness = 0;
@@ -395,7 +446,7 @@
         /// 鍔犺浇cct灞炴�ц缃帶浠�
         /// </summary>
         /// <param name="attrView"></param>
-        void LoadCctAttrView(VerticalScrolViewLayout attrView)
+        void LoadCctAttrView(VerticalScrolViewLayout attrView,Button btnOn,Button btnOff)
         {
             attrView.AddChidren(new Button
             {
@@ -446,6 +497,9 @@
 
             dimmerBar.OnProgressChangedEvent = (sender, e) =>
             {
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+                return;
                 if (e == 0 && lastBrightness != 0)
                 {
                     lastBrightness = 0;
@@ -479,8 +533,6 @@
                 }
 
 
-                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
-                btnBrightnessText.Text = dimmerBar.Progress + "%";
             };
 
       
@@ -578,13 +630,29 @@
             cctView.AddChidren(btnTempClolorMax);
 
             #endregion
+
+
+
+
+            btnOn.MouseUpEventHandler += (sender, e) => {
+                dimmerBar.Progress = 100;
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+            };
+            btnOff.MouseUpEventHandler += (sender, e) => {
+                dimmerBar.Progress = 0;
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+            };
+
+
         }
 
         /// <summary>
         /// 鍔犺浇rgb灞炴�ц缃帶浠�
         /// </summary>
         /// <param name="attrView"></param>
-        void LoadRgbAttrView(bool hadCCT,bool hadColorful)
+        void LoadRgbAttrView(bool hadCCT,bool hadColorful,Button btnOn,Button btnOff)
         {
             Light lightTemp = new Light();
             int magriHeight = 0;
@@ -767,6 +835,9 @@
 
             dimmerBar.OnProgressChangedEvent = (sender, e) =>
             {
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+                return;
                 if (e == 0 && lastBrightness != 0)
                 {
                     lastBrightness = 0;
@@ -1012,6 +1083,17 @@
                 #endregion
             }
 
+            btnOn.MouseUpEventHandler += (sender, e) => {
+                dimmerBar.Progress = 100;
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+            };
+            btnOff.MouseUpEventHandler += (sender, e) => {
+                dimmerBar.Progress = 0;
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+            };
+
 
 
         }

--
Gitblit v1.8.0