From 1fe7427f699eec97bb57d12af9bf17476260c9b4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 20 七月 2023 10:43:24 +0800
Subject: [PATCH] Merge branch 'Dev-1.9' into Dev-Branch
---
HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs | 68 ++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
index 63cd333..2fd1ff6 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
@@ -41,6 +41,74 @@
};
bodyView.AddChidren(contentView);
+ #region 鐐僵寮�鍏�
+ contentView.AddChidren(new Button
+ {
+ Height = Application.GetRealHeight(10),
+ BackgroundColor = CSS_Color.BackgroundColor,
+ });
+
+ var viewSwitch = new FrameLayout()
+ {
+ Height = Application.GetRealHeight(50),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ };
+ contentView.AddChidren(viewSwitch);
+
+ var btnSwitchText = new Button()
+ {
+ X = Application.GetRealWidth(16),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextID = StringId.ColorfulFunction,
+ };
+ viewSwitch.AddChidren(btnSwitchText);
+
+ var btnColorfulSwitch = new Button()
+ {
+ X = Application.GetRealWidth(314),
+ Gravity = Gravity.CenterVertical,
+ Width = Application.GetMinRealAverage(48),
+ Height = Application.GetMinRealAverage(36),
+ UnSelectedImagePath = "Public/Switch.png",
+ SelectedImagePath = "Public/SwitchOn.png",
+ IsSelected = function.GetAttrState(FunctionAttributeKey.Colorful) == "on"
+ };
+ viewSwitch.AddChidren(btnColorfulSwitch);
+
+ btnColorfulSwitch.MouseUpEventHandler = (sender, e) => {
+ btnColorfulSwitch.IsSelected = !btnColorfulSwitch.IsSelected;
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ var controlColorfulState = btnColorfulSwitch.IsSelected ? "on" : "off";
+ function.SetAttrState(FunctionAttributeKey.Colorful, controlColorfulState);
+ var d = new Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.Colorful, controlColorfulState);
+ if (controlColorfulState == "on")
+ {
+ var color = function.GetAttrState(FunctionAttributeKey.ColorfulBegin).Split(",");
+ var sendColorString = color[0] + "," + color[1] + "," + color[2];
+ d.Add(FunctionAttributeKey.ColorfulBegin, sendColorString);
+ color = function.GetAttrState(FunctionAttributeKey.ColorfulEnd).Split(",");
+ sendColorString = color[0] + "," + color[1] + "," + color[2];
+ d.Add(FunctionAttributeKey.ColorfulEnd, sendColorString);
+ d.Add(FunctionAttributeKey.ColorfulTime, function.GetAttrState(FunctionAttributeKey.ColorfulTime));
+ }
+ Control.Ins.SendWriteCommand(function, d);
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"鎺у埗鐐僵寮�鍏冲紓甯�:{ex.Message}");
+ }
+ })
+ { IsBackground = true }.Start();
+ };
+
+ #endregion
+
#region 璧峰棰滆壊
var startView = new FrameLayout()
{
--
Gitblit v1.8.0