From a59663c4981c498f007307f7115f6850ab73e239 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 21 七月 2023 21:06:51 +0800
Subject: [PATCH] 群控界面修复  1.9版本bug修复

---
 HDL-ON_Android/Properties/AndroidManifest.xml                         |    2 
 HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg.png             |    0 
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs                                  |  532 ++++++++++++++-------
 HDL-ON_Android/Assets/Language.ini                                    |    7 
 HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs        |   28 
 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs                    |   15 
 HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs              |  170 +++++++
 HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs            |   14 
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs                  |   11 
 HDL_ON/DAL/Mqtt/MqttClient.cs                                         |    1 
 HDL_ON/HDL_ON.projitems                                               |    1 
 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs                               |  159 -----
 HDL-ON_iOS/Resources/Language.ini                                     |    5 
 HDL_ON/Entity/Function/Function.cs                                    |   20 
 HDL_ON/Common/HDLCommon.cs                                            |    1 
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs |    2 
 HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs                  |    2 
 HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs         |  412 +++++++++++++----
 HDL_ON/Common/R.cs                                                    |    3 
 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs        |   53 +
 HDL-ON_Android/Assets/Phone/Classification/Room/Roombg.png            |    0 
 HDL_ON/UI/UI1-Login/LoginPage.cs                                      |    2 
 22 files changed, 979 insertions(+), 461 deletions(-)

diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index 1bc5df1..6871f5f 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -666,6 +666,7 @@
 679=Group control
 680=Colorful switch
 681=Test
+682=Automatic coloring
 
 
 
@@ -2003,9 +2004,10 @@
 676=涓�
 677=楂�
 678=褰撳墠鐢ㄦ埛鏁版嵁宸叉竻绌猴紝鍗冲皢杩斿洖涓婁竴椤点��
-679=缇ゆ帶
+679=缁勬帶
 680=鐐僵寮�鍏�
 681=鑷姩鐐僵娴嬭瘯
+682=鑷姩鐐僵
 
 
 
@@ -3345,6 +3347,7 @@
 679=Group control
 680=Colorful switch
 681=Test
+682=Automatic Coloring
 
 
 
@@ -4680,6 +4683,7 @@
 679=Group control
 680=Colorful switch
 681=Test
+682=Automatic Coloring
 
 
 
@@ -6004,6 +6008,7 @@
 679=Group control
 680=Colorful switch
 681=Test
+682=Automatic Coloring
 
 
 
diff --git a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg.png b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg.png
index 625b965..a183c95 100644
--- a/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg.png
+++ b/HDL-ON_Android/Assets/Phone/Classification/Room/Roombg.png
Binary files differ
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 7ff26a8..48f8c90 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.9.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307201">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.9.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307211">
 	<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
 	<uses-permission android:name="android.permission.RECEIVE_SMS" />
 	<!--鍙嬬洘-->
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index 151518e..6871f5f 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -666,6 +666,7 @@
 679=Group control
 680=Colorful switch
 681=Test
+682=Automatic coloring
 
 
 
@@ -2006,6 +2007,7 @@
 679=缁勬帶
 680=鐐僵寮�鍏�
 681=鑷姩鐐僵娴嬭瘯
+682=鑷姩鐐僵
 
 
 
@@ -3345,6 +3347,7 @@
 679=Group control
 680=Colorful switch
 681=Test
+682=Automatic Coloring
 
 
 
@@ -4680,6 +4683,7 @@
 679=Group control
 680=Colorful switch
 681=Test
+682=Automatic Coloring
 
 
 
@@ -6004,6 +6008,7 @@
 679=Group control
 680=Colorful switch
 681=Test
+682=Automatic Coloring
 
 
 
diff --git a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg.png b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg.png
index 625b965..a183c95 100644
--- a/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg.png
+++ b/HDL-ON_iOS/Resources/Phone/Classification/Room/Roombg.png
Binary files differ
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index ba7989b..472927b 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -461,6 +461,7 @@
                 case "464027401@qq.com":
                 case "13580507523":
                 case "15626203746":
+                case "18316672920":
                     return;
             }
 
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index b870c59..4523120 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -4,6 +4,7 @@
 {
     public static class StringId
     {
+
         /// <summary>
         /// 鑷姩鐐僵娴嬭瘯
         /// </summary>
@@ -13,7 +14,7 @@
         /// </summary>
         public const int ColorfulSwitch = 680;
         /// <summary>
-        /// 缇ゆ帶
+        /// 缁勬帶
         /// </summary>
         public const int GroupControl = 679;
         /// <summary>
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index 0358a57..496722f 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -879,6 +879,7 @@
             //娴嬭瘯璐﹀彿锛屼笉鎸や笅绾�
             switch (UserInfo.Current.userMobileInfo)
             {
+                case "18316672920":
                 case "15626203746":
                 case "464027401@qq.com":
                     return;
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 8f4f3c3..0baf1eb 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -803,25 +803,27 @@
             var list = new List<FunctionAttributes>();
             if (spk == SPK.GroupControl)
             {
-                var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
-                if (gc != null)
+                lock (list)
                 {
-                    foreach (var temp in gc.sids)
+                    var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
+                    if (gc != null)
                     {
-                        var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid);
-                        if (light != null)
+                        foreach (var temp in gc.sids)
                         {
-                            foreach (var attr in light.attributes)
+                            var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid);
+                            if (light != null)
                             {
-                                if (list.Find((obj) => obj.key == attr.key) == null)
+                                foreach (var attr in light.attributes)
                                 {
-                                    list.Add(attr);
+                                    if (list.Find((obj) => obj.key == attr.key) == null)
+                                    {
+                                        list.Add(attr);
+                                    }
                                 }
                             }
                         }
                     }
                 }
-
             }
             else
             {
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 544dd99..f946b7e 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -561,6 +561,7 @@
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockFaceUnlockHelpPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockAudioSetupPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorlockBatteryManagementPage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\2-Classification\SeriesFunctionListPage.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs
index 1200b13..630f21c 100644
--- a/HDL_ON/UI/UI1-Login/LoginPage.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -320,12 +320,12 @@
                     //etAccount.Text = "18321091245";
                     //etAccount.Text = "13751916353";
                     etAccount.Text = "13549566666";
-                    etAccount.Text = "18316672920";
                     etAccount.Text = "support7@hdlautomation.com";
                     etAccount.Text = "13375012446";//娴嬭瘯鏈嶅姟鍣�
                     etAccount.Text = "15855403939";
                     etAccount.Text = "15006564444";
                     etAccount.Text = "13580507523";
+                    etAccount.Text = "18316672920";
                 }
                 else
                 {
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index e958818..47d6c7c 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -70,19 +70,20 @@
         /// <summary>
         /// 鍒囨崲鏄剧ず鍔熻兘绫诲瀷鍖哄煙
         /// </summary>
-        FrameLayout changeView;
-        /// <summary>
-        /// 鍒囨崲鏄剧ず璁惧鍔熻兘鎸夐挳
-        /// </summary>
-        Button btnChangeFunction;
-        /// <summary>
-        /// 鍒囨崲鏄剧ず鍦烘櫙鍔熻兘鎸夐挳
-        /// </summary>
-        Button btnChangeScene;
-        /// <summary>
-        /// 鍒囨崲鏄剧ず鍦虹粍鎺ф寜閽�
-        /// </summary>
-        Button btnChangeGroupControl;
+        FrameLayout changeBaseView;
+        //FrameLayout changeView;
+        ///// <summary>
+        ///// 鍒囨崲鏄剧ず璁惧鍔熻兘鎸夐挳
+        ///// </summary>
+        //Button btnChangeFunction;
+        ///// <summary>
+        ///// 鍒囨崲鏄剧ず鍦烘櫙鍔熻兘鎸夐挳
+        ///// </summary>
+        //Button btnChangeScene;
+        ///// <summary>
+        ///// 鍒囨崲鏄剧ず鍦虹粍鎺ф寜閽�
+        ///// </summary>
+        //Button btnChangeGroupControl;
         /// <summary>
         /// 鍔熻兘鏄剧ず鍖哄煙
         /// </summary>
@@ -116,11 +117,11 @@
 #endregion
 
 #region 鎶ヨ淇℃伅
-        Button btnMsgBg;
-        Button btnMsgTime;
-        Button btnMsg;
+        //Button btnMsgBg;
+        //Button btnMsgTime;
+        //Button btnMsg;
         Button btnMsgIcon;
-#endregion
+        #endregion
 
         public HomePage()
         {
@@ -164,14 +165,14 @@
                 };
                 topView = new FrameLayout()
                 {
-                    Height = Application.GetRealHeight(216),
+                    Height = Application.GetRealHeight(113),//216),
                     BackgroundImagePath = DB_ResidenceData.Instance.residenceImage,
                 };
                 bodyView.AddChidren(topView);
 #else
                 VerticalRefreshLayout refreshLayout = new VerticalRefreshLayout()
                 {
-                    Height = Application.GetRealHeight(216),
+                    Height = Application.GetRealHeight(113),//216),
                     BackgroundImagePath = DB_ResidenceData.Instance.residenceImage,
                 };
                 bodyView.AddChidren(refreshLayout);
@@ -184,7 +185,7 @@
                 };
                 topView = new FrameLayout()
                 {
-                    Height = Application.GetRealHeight(216),
+                    Height = Application.GetRealHeight(113),//216),
                 };
                 refreshLayout.AddChidren(topView);
 #endif
@@ -508,57 +509,57 @@
 
 
 #region msg
-                FrameLayout msgView;
-                msgView = new FrameLayout()
-                {
-                    Y = Application.GetRealHeight(164),
-                    Gravity = Gravity.CenterHorizontal,
-                    Width = Application.GetRealWidth(343),
-                    Height = Application.GetRealHeight(28),
-                };
-                topView.AddChidren(msgView);
+                //FrameLayout msgView;
+                //msgView = new FrameLayout()
+                //{
+                //    Y = Application.GetRealHeight(164),
+                //    Gravity = Gravity.CenterHorizontal,
+                //    Width = Application.GetRealWidth(343),
+                //    Height = Application.GetRealHeight(28),
+                //};
+                //topView.AddChidren(msgView);
 
-                btnMsgBg = new Button()
-                {
-                    BackgroundColor = CSS_Color.MainColor,//0x3F4484F4,
-                    Alpha = 0.4f,
-                };
-                msgView.AddChidren(btnMsgBg);
+                //btnMsgBg = new Button()
+                //{
+                //    BackgroundColor = CSS_Color.MainColor,//0x3F4484F4,
+                //    Alpha = 0.4f,
+                //};
+                //msgView.AddChidren(btnMsgBg);
 
 
                 btnMsgIcon = new Button()
                 {
-                    X = Application.GetRealWidth(12),
-                    Gravity = Gravity.CenterVertical,
+                    X = Application.GetRealWidth(290),
+                    Y = Application.GetRealHeight(35),
                     Width = Application.GetMinRealAverage(24),
                     Height = Application.GetMinRealAverage(24),
                     UnSelectedImagePath = "Collection/MsgIcon.png",
                     SelectedImagePath = "Collection/MsgIconTip.png",
                 };
-                msgView.AddChidren(btnMsgIcon);
+                topView.AddChidren(btnMsgIcon);
 
 
-                btnMsg = new Button()
-                {
-                    X = Application.GetRealWidth(10) + btnMsgIcon.Right,
-                    Width = Application.GetRealWidth(240),
-                    Text = "...",
-                    TextColor = CSS_Color.MainBackgroundColor,
-                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                    TextAlignment = TextAlignment.CenterLeft,
-                };
-                msgView.AddChidren(btnMsg);
+                //btnMsg = new Button()
+                //{
+                //    X = Application.GetRealWidth(10) + btnMsgIcon.Right,
+                //    Width = Application.GetRealWidth(240),
+                //    Text = "...",
+                //    TextColor = CSS_Color.MainBackgroundColor,
+                //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                //    TextAlignment = TextAlignment.CenterLeft,
+                //};
+                //msgView.AddChidren(btnMsg);
 
 
-                btnMsgTime = new Button()
-                {
-                    X = Application.GetRealWidth(299),
-                    Width = Application.GetRealWidth(44),
-                    Text = "00:00",
-                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                    TextAlignment = TextAlignment.CenterLeft,
-                };
-                msgView.AddChidren(btnMsgTime);
+                //btnMsgTime = new Button()
+                //{
+                //    X = Application.GetRealWidth(299),
+                //    Width = Application.GetRealWidth(44),
+                //    Text = "00:00",
+                //    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                //    TextAlignment = TextAlignment.CenterLeft,
+                //};
+                //msgView.AddChidren(btnMsgTime);
 
                 LoadEvent_GotoMessageCenterPage();
 
@@ -570,134 +571,12 @@
 
                 bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0x00000000 });
 
-                if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
-                {
-                    changeView = new FrameLayout()
-                    {
-                        //Y = Application.GetRealHeight(20) + topView.Bottom,
-                        Gravity = Gravity.CenterHorizontal,
-                        Width = Application.GetRealWidth(334),
-                        Height = Application.GetRealHeight(62),
-                        BackgroundImagePath = "Collection/ChangeViewbg.png",
-                    };
-                    bodyView.AddChidren(changeView);
+                loadNavView();
 
-                    btnChangeFunction = new Button()
-                    {
-                        X = Application.GetRealWidth(10),
-                        Width = Application.GetRealWidth(114 - 10),
-                        TextID = StringId.Functions,
-                        SelectedTextColor = CSS_Color.MainColor,
-                        TextColor = CSS_Color.PromptingColor1,
-                        TextSize = CSS_FontSize.HeadlineFontSize,
-                        TextAlignment = TextAlignment.Center,
-                        IsSelected = true,
-                        IsBold = true,
-                    };
-                    changeView.AddChidren(btnChangeFunction);
-
-                    Button btnLine = new Button()
-                    {
-                        X = btnChangeFunction.Right,
-                        Gravity = Gravity.CenterVertical,
-                        Width = Application.GetRealWidth(1),
-                        Height = Application.GetRealHeight(14),
-                        BackgroundColor = CSS_Color.PromptingColor1,
-                    };
-                    changeView.AddChidren(btnLine);
-
-                    btnChangeScene = new Button()
-                    {
-                        X = btnLine.Right,
-                        Width = Application.GetRealWidth(114 - 10),
-                        TextID = StringId.Scenes,
-                        SelectedTextColor = CSS_Color.MainColor,
-                        TextColor = CSS_Color.PromptingColor1,
-                        TextSize = CSS_FontSize.TextFontSize,
-                        TextAlignment = TextAlignment.Center,
-                    };
-                    changeView.AddChidren(btnChangeScene);
-
-                    Button btnLine2 = new Button()
-                    {
-                        X = btnChangeScene.Right,
-                        Gravity = Gravity.CenterVertical,
-                        Width = Application.GetRealWidth(1),
-                        Height = Application.GetRealHeight(14),
-                        BackgroundColor = CSS_Color.PromptingColor1,
-                    };
-                    changeView.AddChidren(btnLine2);
-
-                    btnChangeGroupControl = new Button()
-                    {
-                        X = btnLine2.Right,
-                        Width = Application.GetRealWidth(114 - 10),
-                        TextID = StringId.GroupControl,
-                        SelectedTextColor = CSS_Color.MainColor,
-                        TextColor = CSS_Color.PromptingColor1,
-                        TextSize = CSS_FontSize.TextFontSize,
-                        TextAlignment = TextAlignment.Center,
-                    };
-                    changeView.AddChidren(btnChangeGroupControl);
-                }
-                else
-                {
-                    changeView = new FrameLayout()
-                    {
-                        //Y = Application.GetRealHeight(20) + topView.Bottom,
-                        Gravity = Gravity.CenterHorizontal,
-                        Width = Application.GetRealWidth(230),
-                        Height = Application.GetRealHeight(62),
-                        BackgroundImagePath = "Collection/ChangeViewbg.png",
-                    };
-                    bodyView.AddChidren(changeView);
-
-                    btnChangeFunction = new Button()
-                    {
-                        X = Application.GetRealWidth(10),
-                        Width = Application.GetRealWidth(114 - 10),
-                        TextID = StringId.Functions,
-                        SelectedTextColor = CSS_Color.MainColor,
-                        TextColor = CSS_Color.PromptingColor1,
-                        TextSize = CSS_FontSize.HeadlineFontSize,
-                        TextAlignment = TextAlignment.Center,
-                        IsSelected = true,
-                        IsBold = true,
-                    };
-                    changeView.AddChidren(btnChangeFunction);
-
-                    Button btnLine = new Button()
-                    {
-                        X = btnChangeFunction.Right,
-                        Gravity = Gravity.CenterVertical,
-                        Width = Application.GetRealWidth(1),
-                        Height = Application.GetRealHeight(14),
-                        BackgroundColor = CSS_Color.PromptingColor1,
-                    };
-                    changeView.AddChidren(btnLine);
-
-                    btnChangeScene = new Button()
-                    {
-                        X = btnLine.Right,
-                        Width = Application.GetRealWidth(114 - 10),
-                        TextID = StringId.Scenes,
-                        SelectedTextColor = CSS_Color.MainColor,
-                        TextColor = CSS_Color.PromptingColor1,
-                        TextSize = CSS_FontSize.TextFontSize,
-                        TextAlignment = TextAlignment.Center,
-                    };
-                    changeView.AddChidren(btnChangeScene);
-                }
                 #endregion
 
                 #region ContextView
-                contentView = new PageLayout()
-                {
-                    //Y = changeView.Bottom,
-                    Height = Application.GetRealHeight(310 + 30 + 10), //20涓鸿秴鍑洪儴鍒�
-                    IsShowPoint = false,
-                };
-                bodyView.AddChidren(contentView);
+
 
                 functionViews = new List<FrameLayout>();
 
@@ -712,6 +591,295 @@
 
 
         }
+
+        void loadNavView()
+        {
+            if(changeBaseView == null)
+            {
+                changeBaseView = new FrameLayout()
+                {
+                    Gravity = Gravity.CenterHorizontal,
+                    Height = Application.GetRealHeight(62),
+                };
+                bodyView.AddChidren(changeBaseView);
+            }
+            else
+            {
+                changeBaseView.RemoveAll();
+            }
+
+            if (contentView == null)
+            {
+                contentView = new PageLayout()
+                {
+                    Height = Application.GetRealHeight(310 + 30 + 10 + 100), //20涓鸿秴鍑洪儴鍒�
+                    IsShowPoint = false,
+                };
+                bodyView.AddChidren(contentView);
+            }
+
+            if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl && FunctionList.List.groupControls.Count > 0)
+            {
+                var changeView = new FrameLayout()
+                {
+                    //Y = Application.GetRealHeight(20) + topView.Bottom,
+                    Gravity = Gravity.CenterHorizontal,
+                    Width = Application.GetRealWidth(334),
+                    Height = Application.GetRealHeight(62),
+                    BackgroundImagePath = "Collection/ChangeViewbg.png",
+                };
+                changeBaseView.AddChidren(changeView);
+
+                var btnChangeFunction = new Button()
+                {
+                    X = Application.GetRealWidth(10),
+                    Width = Application.GetRealWidth(114 - 10),
+                    TextID = StringId.Functions,
+                    SelectedTextColor = CSS_Color.MainColor,
+                    TextColor = CSS_Color.PromptingColor1,
+                    TextSize = CSS_FontSize.HeadlineFontSize,
+                    TextAlignment = TextAlignment.Center,
+                    IsSelected = true,
+                    IsBold = true,
+                };
+                changeView.AddChidren(btnChangeFunction);
+
+                Button btnLine = new Button()
+                {
+                    X = btnChangeFunction.Right,
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetRealWidth(1),
+                    Height = Application.GetRealHeight(14),
+                    BackgroundColor = CSS_Color.PromptingColor1,
+                };
+                changeView.AddChidren(btnLine);
+
+                var btnChangeScene = new Button()
+                {
+                    X = btnLine.Right,
+                    Width = Application.GetRealWidth(114 - 10),
+                    TextID = StringId.Scenes,
+                    SelectedTextColor = CSS_Color.MainColor,
+                    TextColor = CSS_Color.PromptingColor1,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    TextAlignment = TextAlignment.Center,
+                };
+                changeView.AddChidren(btnChangeScene);
+
+                Button btnLine2 = new Button()
+                {
+                    X = btnChangeScene.Right,
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetRealWidth(1),
+                    Height = Application.GetRealHeight(14),
+                    BackgroundColor = CSS_Color.PromptingColor1,
+                };
+                changeView.AddChidren(btnLine2);
+
+                var btnChangeGroupControl = new Button()
+                {
+                    X = btnLine2.Right,
+                    Width = Application.GetRealWidth(114 - 10),
+                    TextID = StringId.GroupControl,
+                    SelectedTextColor = CSS_Color.MainColor,
+                    TextColor = CSS_Color.PromptingColor1,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    TextAlignment = TextAlignment.Center,
+                };
+                changeView.AddChidren(btnChangeGroupControl);
+
+
+
+                btnChangeGroupControl.MouseUpEventHandler = (sender, e) => {
+                    btnChangeFunction.IsSelected = false;
+                    btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
+                    btnChangeFunction.IsBold = false;
+                    btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
+                    btnChangeScene.IsSelected = false;
+                    btnChangeScene.IsBold = false;
+                    btnChangeGroupControl.IsSelected = true;
+                    btnChangeGroupControl.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                    btnChangeGroupControl.IsBold = true;
+                    CurShowTypeContent = 2;
+                    contentView.PageIndex = 2;
+                };
+
+                btnChangeFunction.MouseUpEventHandler = (sender, e) => {
+                    btnChangeFunction.IsSelected = true;
+                    btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                    btnChangeFunction.IsBold = true;
+                    btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
+                    btnChangeScene.IsSelected = false;
+                    btnChangeScene.IsBold = false;
+                    CurShowTypeContent = 0;
+                    contentView.PageIndex = 0;
+
+                    btnChangeGroupControl.IsSelected = false;
+                    btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize;
+                    btnChangeGroupControl.IsBold = false;
+                };
+                btnChangeScene.MouseUpEventHandler = (sender, e) => {
+                    btnChangeScene.IsSelected = true;
+                    btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                    btnChangeScene.IsBold = true;
+                    btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
+                    btnChangeFunction.IsSelected = false;
+                    btnChangeFunction.IsBold = false;
+                    CurShowTypeContent = 1;
+                    contentView.PageIndex = 1;
+
+                    btnChangeGroupControl.IsSelected = false;
+                    btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize;
+                    btnChangeGroupControl.IsBold = false;
+                };
+
+                contentView.PageChange = (sender, e) =>
+                {
+                    if (contentView.PageIndex == 0)
+                    {
+                        btnChangeFunction.IsSelected = true;
+                        btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                        btnChangeFunction.IsBold = true;
+                        btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
+                        btnChangeScene.IsSelected = false;
+                        btnChangeScene.IsBold = false;
+                        btnChangeGroupControl.IsSelected = false;
+                        btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize;
+                        btnChangeGroupControl.IsBold = false;
+                    }
+                    else if (contentView.PageIndex == 1)
+                    {
+                        btnChangeScene.IsSelected = true;
+                        btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                        btnChangeScene.IsBold = true;
+                        btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
+                        btnChangeFunction.IsSelected = false;
+                        btnChangeFunction.IsBold = false;
+                        btnChangeGroupControl.IsSelected = false;
+                        btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize;
+                        btnChangeGroupControl.IsBold = false;
+                    }
+                    else if (contentView.PageIndex == 2)
+                    {
+                        btnChangeFunction.IsSelected = false;
+                        btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
+                        btnChangeFunction.IsBold = false;
+                        btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
+                        btnChangeScene.IsSelected = false;
+                        btnChangeScene.IsBold = false;
+                        btnChangeGroupControl.IsSelected = true;
+                        btnChangeGroupControl.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                        btnChangeGroupControl.IsBold = true;
+                    }
+                };
+
+
+            }
+            else
+            {
+                var changeView = new FrameLayout()
+                {
+                    //Y = Application.GetRealHeight(20) + topView.Bottom,
+                    Gravity = Gravity.CenterHorizontal,
+                    Width = Application.GetRealWidth(230),
+                    Height = Application.GetRealHeight(62),
+                    BackgroundImagePath = "Collection/ChangeViewbg.png",
+                };
+                changeBaseView.AddChidren(changeView);
+
+                var btnChangeFunction = new Button()
+                {
+                    X = Application.GetRealWidth(10),
+                    Width = Application.GetRealWidth(114 - 10),
+                    TextID = StringId.Functions,
+                    SelectedTextColor = CSS_Color.MainColor,
+                    TextColor = CSS_Color.PromptingColor1,
+                    TextSize = CSS_FontSize.HeadlineFontSize,
+                    TextAlignment = TextAlignment.Center,
+                    IsSelected = true,
+                    IsBold = true,
+                };
+                changeView.AddChidren(btnChangeFunction);
+
+                Button btnLine = new Button()
+                {
+                    X = btnChangeFunction.Right,
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetRealWidth(1),
+                    Height = Application.GetRealHeight(14),
+                    BackgroundColor = CSS_Color.PromptingColor1,
+                };
+                changeView.AddChidren(btnLine);
+
+                var btnChangeScene = new Button()
+                {
+                    X = btnLine.Right,
+                    Width = Application.GetRealWidth(114 - 10),
+                    TextID = StringId.Scenes,
+                    SelectedTextColor = CSS_Color.MainColor,
+                    TextColor = CSS_Color.PromptingColor1,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    TextAlignment = TextAlignment.Center,
+                };
+                changeView.AddChidren(btnChangeScene);
+
+
+                btnChangeFunction.MouseUpEventHandler = (sender, e) =>
+                {
+
+                    btnChangeFunction.IsSelected = true;
+                    btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                    btnChangeFunction.IsBold = true;
+                    btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
+                    btnChangeScene.IsSelected = false;
+                    btnChangeScene.IsBold = false;
+                    CurShowTypeContent = 0;
+                    contentView.PageIndex = 0;
+                };
+
+                btnChangeScene.MouseUpEventHandler = (sender, e) =>
+                {
+                    btnChangeScene.IsSelected = true;
+                    btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                    btnChangeScene.IsBold = true;
+                    btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
+                    btnChangeFunction.IsSelected = false;
+                    btnChangeFunction.IsBold = false;
+                    CurShowTypeContent = 1;
+                    contentView.PageIndex = 1;
+                };
+
+                contentView.PageChange = (sender, e) =>
+                {
+                    if (contentView.PageIndex == 0)
+                    {
+                        btnChangeFunction.IsSelected = true;
+                        btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                        btnChangeFunction.IsBold = true;
+                        btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
+                        btnChangeScene.IsSelected = false;
+                        btnChangeScene.IsBold = false;
+                    }
+                    else if (contentView.PageIndex == 1)
+                    {
+                        btnChangeScene.IsSelected = true;
+                        btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
+                        btnChangeScene.IsBold = true;
+                        btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
+                        btnChangeFunction.IsSelected = false;
+                        btnChangeFunction.IsBold = false;
+                    }
+                };
+
+
+
+            }
+
+
+            contentView.PageIndex = CurShowTypeContent;
+
+        }
+
         /// <summary>
         /// 鍔犺浇鍐呭鍖哄煙
         /// </summary>
@@ -736,8 +904,10 @@
                         {
                             if (contentView == null)
                             {
+                                waitPage.Hide();
                                 return;
                             }
+                            loadNavView();
                             contentView.RemoveAll();
                             deviceFunctionView = new VerticalScrolViewLayout();
                             contentView.AddChidren(deviceFunctionView);
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
index 7fc68a1..5b646a5 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -238,6 +238,19 @@
         }
 
         /// <summary>
+        /// 鏇存柊鍔熻兘缁勬帶涓婚〉
+        /// </summary>
+        public static void RefreshGroupControlView()
+        {
+            if (bodyView != null)
+            {
+                bodyView.LoadGroupControlFunctionControlZone();
+            }
+        }
+
+
+
+        /// <summary>
         /// 鏇存柊杩炴帴鐘舵�佸浘鏍�
         /// </summary>
         void CheckLinkStatus()
@@ -325,137 +338,9 @@
         /// </summary>
         void LoadEvent_ChangeShowedFunctionType()
         {
-            btnChangeFunction.MouseUpEventHandler = (sender, e) =>
+           
+            if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl && FunctionList.List.groupControls.Count>0)
             {
-                
-                btnChangeFunction.IsSelected = true;
-                btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                btnChangeFunction.IsBold = true;
-                btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
-                btnChangeScene.IsSelected = false;
-                btnChangeScene.IsBold = false;
-                CurShowTypeContent = 0;
-                contentView.PageIndex = 0;
-            };
-
-            btnChangeScene.MouseUpEventHandler = (sender, e) =>
-            {
-                btnChangeScene.IsSelected = true;
-                btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                btnChangeScene.IsBold = true;
-                btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
-                btnChangeFunction.IsSelected = false;
-                btnChangeFunction.IsBold = false;
-                CurShowTypeContent = 1;
-                contentView.PageIndex = 1;
-            };
-
-            contentView.PageChange = (sender, e) =>
-            {
-                if (contentView.PageIndex == 0)
-                {
-                    btnChangeFunction.IsSelected = true;
-                    btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                    btnChangeFunction.IsBold = true;
-                    btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
-                    btnChangeScene.IsSelected = false;
-                    btnChangeScene.IsBold = false;
-                }
-                else if (contentView.PageIndex == 1)
-                {
-                    btnChangeScene.IsSelected = true;
-                    btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                    btnChangeScene.IsBold = true;
-                    btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
-                    btnChangeFunction.IsSelected = false;
-                    btnChangeFunction.IsBold = false;
-                }
-            };
-
-            if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
-            {
-                btnChangeGroupControl.MouseUpEventHandler = (sender, e) => {
-                    btnChangeFunction.IsSelected = false;
-                    btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
-                    btnChangeFunction.IsBold = false;
-                    btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
-                    btnChangeScene.IsSelected = false;
-                    btnChangeScene.IsBold = false;
-                    btnChangeGroupControl.IsSelected = true;
-                    btnChangeGroupControl.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                    btnChangeGroupControl.IsBold = true;
-                    CurShowTypeContent = 2;
-                    contentView.PageIndex = 2;
-                };
-
-                btnChangeFunction.MouseUpEventHandler = (sender, e) => {
-                    btnChangeFunction.IsSelected = true;
-                    btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                    btnChangeFunction.IsBold = true;
-                    btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
-                    btnChangeScene.IsSelected = false;
-                    btnChangeScene.IsBold = false;
-                    CurShowTypeContent = 0;
-                    contentView.PageIndex = 0;
-
-                    btnChangeGroupControl.IsSelected = false;
-                    btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize;
-                    btnChangeGroupControl.IsBold = false;
-                };
-                btnChangeScene.MouseUpEventHandler = (sender, e) => {
-                    btnChangeScene.IsSelected = true;
-                    btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                    btnChangeScene.IsBold = true;
-                    btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
-                    btnChangeFunction.IsSelected = false;
-                    btnChangeFunction.IsBold = false;
-                    CurShowTypeContent = 1;
-                    contentView.PageIndex = 1;
-
-                    btnChangeGroupControl.IsSelected = false;
-                    btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize;
-                    btnChangeGroupControl.IsBold = false;
-                };
-
-                contentView.PageChange = (sender, e) =>
-                {
-                    if (contentView.PageIndex == 0)
-                    {
-                        btnChangeFunction.IsSelected = true;
-                        btnChangeFunction.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                        btnChangeFunction.IsBold = true;
-                        btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
-                        btnChangeScene.IsSelected = false;
-                        btnChangeScene.IsBold = false;
-                        btnChangeGroupControl.IsSelected = false;
-                        btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize;
-                        btnChangeGroupControl.IsBold = false;
-                    }
-                    else if (contentView.PageIndex == 1)
-                    {
-                        btnChangeScene.IsSelected = true;
-                        btnChangeScene.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                        btnChangeScene.IsBold = true;
-                        btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
-                        btnChangeFunction.IsSelected = false;
-                        btnChangeFunction.IsBold = false;
-                        btnChangeGroupControl.IsSelected = false;
-                        btnChangeGroupControl.TextSize = CSS.CSS_FontSize.TextFontSize;
-                        btnChangeGroupControl.IsBold = false;
-                    }
-                    else if (contentView.PageIndex == 2)
-                    {
-                        btnChangeFunction.IsSelected = false;
-                        btnChangeFunction.TextSize = CSS.CSS_FontSize.TextFontSize;
-                        btnChangeFunction.IsBold = false;
-                        btnChangeScene.TextSize = CSS.CSS_FontSize.TextFontSize;
-                        btnChangeScene.IsSelected = false;
-                        btnChangeScene.IsBold = false;
-                        btnChangeGroupControl.IsSelected = true;
-                        btnChangeGroupControl.TextSize = CSS.CSS_FontSize.HeadlineFontSize;
-                        btnChangeGroupControl.IsBold = true;
-                    }
-                };
 
             }
         }
@@ -888,9 +773,9 @@
                 skipPage.LoadPage(backAction);
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
-            btnMsgBg.MouseUpEventHandler = eventHandler;
-            btnMsgTime.MouseUpEventHandler = eventHandler;
-            btnMsg.MouseUpEventHandler = eventHandler;
+            //btnMsgBg.MouseUpEventHandler = eventHandler;
+            //btnMsgTime.MouseUpEventHandler = eventHandler;
+            //btnMsg.MouseUpEventHandler = eventHandler;
             btnMsgIcon.MouseUpEventHandler = eventHandler;
         }
 
@@ -975,8 +860,8 @@
         void ShowMesBtnState(PushMessageInfo pushMessageInfo, bool allRead)
         {
             if (bodyView == null) return;
-            btnMsg.Text = pushMessageInfo.messageTitle + ": " + pushMessageInfo.messageContent;
-            btnMsgTime.Text = GetUnixToDateTime(pushMessageInfo.createTime);
+            //btnMsg.Text = pushMessageInfo.messageTitle + ": " + pushMessageInfo.messageContent;
+            //btnMsgTime.Text = GetUnixToDateTime(pushMessageInfo.createTime);
             btnMsgIcon.IsSelected = !allRead;
         }
 
@@ -986,8 +871,8 @@
         void ResetMesBtnRead()
         {
             if (bodyView == null) return;
-            btnMsg.Text = "...";
-            btnMsgTime.Text = "00:00";
+            //btnMsg.Text = "...";
+            //btnMsgTime.Text = "00:00";
             btnMsgIcon.IsSelected = false;
         }
 
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index dae33b1..83e733f 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -876,6 +876,12 @@
                     case ShowFunction.Series:
                         btnName.TextID = StringId.HorseRaceLamp;
                         functionPageTitleId = StringId.HorseRaceLamp;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var page2 = new UI2.Classification.SeriesFunctionListPage();
+                            MainPage.BasePageView.AddChidren(page2);
+                            page2.LoadPage();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
                         break;
                     case ShowFunction.Light:
                         #region Light
@@ -1196,8 +1202,9 @@
                     && item != ShowFunction.SecurityMonitoring
                     && item != ShowFunction.DoorLock
                     && ShowFunction.EnergyMonitoring != item
-                    && ShowFunction.VideoIntercom != item &&
-                    ShowFunction.SecurityCenter != item
+                    && ShowFunction.VideoIntercom != item
+                    && ShowFunction.SecurityCenter != item
+                    && ShowFunction.Series != item
                     && ShowFunction.Acst != item)
                 {
                     btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
diff --git a/HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs b/HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs
new file mode 100644
index 0000000..aec513e
--- /dev/null
+++ b/HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs
@@ -0,0 +1,170 @@
+锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
+using Shared;
+namespace HDL_ON.UI.UI2.Classification
+{
+    public class SeriesFunctionListPage : FrameLayout
+    {
+        FrameLayout bodyView;
+        public SeriesFunctionListPage()
+        {
+            bodyView = this;
+        }
+
+        public void LoadPage()
+        {
+            new TopViewDiv(bodyView, Language.StringByID(StringId.HorseRaceLamp)).LoadTopView();
+            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
+
+            var functionListView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(64),
+                Height = Application.GetRealHeight(603 - 12),
+            };
+            bodyView.AddChidren(functionListView);
+
+            var waitPage = new Loading();
+            bodyView.AddChidren(waitPage);
+            waitPage.Hide();
+
+            Dictionary<string, List<Button>> dicGroupButtons = new Dictionary<string, List<Button>>();
+
+            foreach(var rgb in FunctionList.List.GetLightList())
+            {
+                if(rgb.spk == SPK.LightRGB)
+                {
+                    if (rgb.GetAttribute(FunctionAttributeKey.Colorful) == null)
+                    {
+                        continue;
+                    }
+                    List<Button> groupButtons = new List<Button>();
+                    var list = new List<Function>();
+                    list.Add(rgb);
+                    var oid = rgb.sid.Substring(0, 16);
+                    var seriesList = FunctionList.List.GetSeries().FindAll((obj) => obj.sid.StartsWith(oid));
+                    list.AddRange(seriesList);
+                    var groupView = new VerticalScrolViewLayout()
+                    {
+                        Height = Application.GetRealHeight(44 + 51 * list.Count),
+                        BackgroundColor = CSS_Color.MainBackgroundColor,
+                        ScrollEnabled = false,
+                    };
+                    functionListView.AddChidren(groupView);
+
+                    #region title
+                    var titleView = new FrameLayout()
+                    {
+                        Height = Application.GetRealHeight(44),
+                    };
+                    groupView.AddChidren(titleView);
+
+                    var btnTitle = new Button()
+                    {
+                        X = Application.GetRealWidth(16),
+                        TextSize = CSS_FontSize.SubheadingFontSize,
+                        TextAlignment = TextAlignment.CenterLeft,
+                        TextColor = CSS_Color.MainColor,
+                        Text = rgb.name,
+                    };
+                    titleView.AddChidren(btnTitle);
+
+                    #endregion
+
+                    foreach (var series in list)
+                    {
+                        groupView.AddChidren(new Button
+                        {
+                            Height = 1,
+                            BackgroundColor = CSS_Color.DividingLineColor,
+                        });
+
+                        var rgbColorfulView = new FrameLayout()
+                        {
+                            Height = Application.GetRealHeight(50),
+                        };
+                        groupView.AddChidren(rgbColorfulView);
+
+                        var btnRgbColorfulTitle = new Button()
+                        {
+                            X = Application.GetRealWidth(16),
+                            TextAlignment = TextAlignment.CenterLeft,
+                            TextSize = CSS_FontSize.TextFontSize,
+                            TextColor = CSS_Color.FirstLevelTitleColor,
+                            Text = series.name == rgb.name ? Language.StringByID(StringId.AutomaticColoring) : series.name,
+                        };
+                        rgbColorfulView.AddChidren(btnRgbColorfulTitle);
+
+                        var btnColorfulSwitch = new Button()
+                        {
+                            X = Application.GetRealWidth(320),
+                            Gravity = Gravity.CenterVertical,
+                            Width = Application.GetMinRealAverage(48),
+                            Height = Application.GetMinRealAverage(36),
+                            UnSelectedImagePath = "Public/Switch.png",
+                            SelectedImagePath = "Public/SwitchOn.png",
+                            Tag = series.sid,
+                        };
+                        rgbColorfulView.AddChidren(btnColorfulSwitch);
+
+                        groupButtons.Add(btnColorfulSwitch);
+
+                        btnColorfulSwitch.MouseUpEventHandler = (sener, e) => {
+                            btnColorfulSwitch.IsSelected = !btnColorfulSwitch.IsSelected;
+                            var state = btnColorfulSwitch.IsSelected ? "on" : "off";
+                            waitPage.Start("");
+                            new System.Threading.Thread(() =>
+                            {
+                                try
+                                {
+                                    var d = new Dictionary<string, string>();
+                                    d.Add("on_off", state);
+                                    DriverLayer.Control.Ins.SendWriteCommand(series, d);
+                                    if (state == "on")
+                                    {
+                                        Application.RunOnMainThread(() =>
+                                        {
+                                            List<Button> updataList = new List<Button>();
+                                            dicGroupButtons.TryGetValue(((Button)sener).Tag.ToString().Substring(0, 16), out updataList);
+                                            foreach (var updataTemp in updataList)
+                                            {
+                                                updataTemp.IsSelected = false;
+                                            }
+                                            btnColorfulSwitch.IsSelected = true;
+                                        });
+                                    }
+                                }
+                                catch (Exception ex)
+                                {
+                                    MainPage.Log($"搴忓垪鎺у埗寮傚父锛歿ex.Message}");
+                                }
+                                finally
+                                {
+                                    Application.RunOnMainThread(() => {
+                                        waitPage.Hide();
+                                    });
+                                }
+                            })
+                            { IsBackground = true }.Start();
+                        };
+
+
+                    }
+                    Console.WriteLine("oid: " + oid);
+                    dicGroupButtons.TryAdd(oid, groupButtons);
+
+                    functionListView.AddChidren(new Button
+                    {
+                        Height = Application.GetRealHeight(8),
+                        BackgroundColor = CSS_Color.DividingLineColor,
+                    });
+
+                }
+            }
+
+        }
+
+
+    }
+}
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
index 86821a9..5f184b0 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -1112,7 +1112,8 @@
                                         string on_off = GetKeyValue("on_off", dicList);
                                         string brightness = GetKeyValue("brightness", dicList);
                                         string cct = GetKeyValue(FunctionAttributeKey.CCT, dicList);
-                                        string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList);
+                                        //鑷姩鍖栫粍鎺� 鐐僵鍔熻兘
+                                        //string colorful = GetKeyValue(FunctionAttributeKey.Colorful, dicList);
                                         string rgb = GetKeyValue("rgb", dicList);
 
 
@@ -1138,19 +1139,18 @@
                                             stateStr += "," + Language.StringByID(StringId.ColorTemperature) + cct + "k";
                                         }
 
-                                        if (!string.IsNullOrEmpty(colorful))
-                                        {
-                                            stateStr += "," + Language.StringByID(StringId.ColorfulFunction);
-                                            if (colorful == "on")
-                                            {
-                                                stateStr += Language.StringByID(StringId.onLogic);
-                                            }
-                                            else if (colorful == "off")
-                                            {
-                                                stateStr += Language.StringByID(StringId.offLogic);
-                                            }
-
-                                        }
+                                        //if (!string.IsNullOrEmpty(colorful))
+                                        //{
+                                        //    stateStr += "," + Language.StringByID(StringId.ColorfulFunction);
+                                        //    if (colorful == "on")
+                                        //    {
+                                        //        stateStr += Language.StringByID(StringId.onLogic);
+                                        //    }
+                                        //    else if (colorful == "off")
+                                        //    {
+                                        //        stateStr += Language.StringByID(StringId.offLogic);
+                                        //    }
+                                        //}
 
                                         if (!string.IsNullOrEmpty(rgb) && rgb.Length > 6)
                                         {
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
index 9bc1eb7..a161414 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs
@@ -548,10 +548,21 @@
             var perColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
             if(perColorful != null)
             {
-                if(perColorful.value == "on")
+                if (perColorful.value == "on")
+                {
                     sceneFunctionInfo += " " + Language.StringByID(StringId.HorseRaceLamp);
+                }
                 else
-                    sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp);
+                {
+                    if (sceneFunction.localFunction.spk == SPK.GroupControl)
+                    {
+                        sceneFunctionInfo += " " + Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp);
+                    }
+                    else
+                    {
+                        sceneFunctionInfo = Language.StringByID(StringId.Close) + " " + Language.StringByID(StringId.HorseRaceLamp);
+                    }
+                }
             }
 
             return sceneFunctionInfo;
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
index 60f9806..08bfede 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -1905,13 +1905,13 @@
 
             if (sceneFunction.localFunction.spk == SPK.LightRGB || sceneFunction.localFunction.spk == SPK.GroupControl)
             {
-                var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
-                if (colorfulStatus != null)
-                {
-                    isColorful = true;
-                    LoadColorfulRow(colorfulStatus);
-                    isColorful = colorfulStatus.value == "on";
-                }
+                //var colorfulStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful);
+                //if (colorfulStatus != null)
+                //{
+                //    isColorful = true;
+                //    LoadColorfulRow(colorfulStatus);
+                //    isColorful = colorfulStatus.value == "on";
+                //}
             }
             foreach (var attr in sceneFunction.status)
             {
@@ -1982,7 +1982,18 @@
 
             btnConfrim.MouseUpEventHandler = (sender, e) =>
             {
-                if (sceneFunction.localFunction.spk == SPK.GroupControl) { }
+                if (sceneFunction.localFunction.spk == SPK.GroupControl) {
+                    var colorBegin = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.ColorfulBegin);
+                    if (colorBegin != null)
+                    {
+                        sceneFunction.status.Remove(colorBegin);
+                    }
+                    var colorEnd = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.ColorfulEnd);
+                    if (colorEnd != null)
+                    {
+                        sceneFunction.status.Remove(colorEnd);
+                    }
+                }
                 else
                 {
                     if (isOnStatus)
@@ -3189,7 +3200,33 @@
         /// <param name="btn"></param>
         void LoadEditDialog_CCT(SceneFunctionStatus trait, Button btn)
         {
+            if (trait.min == 0)
+            {
+                switch (trait.key)
+                {
+                    case FunctionAttributeKey.SetTemp:
+                        trait.min = 16;
+                        break;
+                    case FunctionAttributeKey.CCT:
+                        trait.min = 2700;
+                        break;
+                }
+            }
+            if (trait.max == 0)
+            {
+                switch (trait.key)
+                {
+                    case FunctionAttributeKey.SetTemp:
+                        trait.max = 30;
+                        break;
+                    case FunctionAttributeKey.CCT:
+                        trait.max = 6500;
+                        break;
+                }
+            }
+
             double temp = trait.min;
+          
             double.TryParse(trait.value, out temp);
             trait.value = temp.ToString();
 
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs
index 3d6cb2f..b398d83 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs
@@ -115,7 +115,7 @@
                                         {
                                             if (pack.Code == StateCode.SUCCESS)
                                             {
-                                                FunctionList.List.groupControls.Remove(groupControl);
+                                                FunctionList.List.groupControls.Remove(groupControl);//var delTemp = FunctionList.List.groupControls.Find((obj) => groupControl.sid == obj.sid);
                                                 //list.Remove(groupControl);
                                                 this.RemoveFromParent();
                                                 delAction?.Invoke();
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
index 60d72bc..a7cd03f 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -629,7 +629,7 @@
                         {
                             Y = btnResidenceManageIcon.Bottom,
                             Height = Application.GetRealHeight(29),
-                            TextID = StringId.CombinedDimming,
+                            TextID = StringId.GroupControl,
                             TextAlignment = TextAlignment.Center,
                             TextColor = CSS_Color.FirstLevelTitleColor,
                             TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
index 86ce901..c5cee61 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulInfoPage.cs
@@ -61,7 +61,7 @@
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.SubheadingFontSize,
-                TextID = StringId.ColorfulSwitch,
+                TextID = StringId.CulorfulTest,
             };
             viewSwitch.AddChidren(btnSwitchText);
 
@@ -271,6 +271,13 @@
             };
             workHoursView.AddChidren(btnWorkHours);
 
+            var time = Convert.ToInt32( function.GetAttrState(FunctionAttributeKey.ColorfulTime));
+
+
+            btnWorkHours.Text = time/ 360 + Language.StringByID(StringId.h);
+            btnWorkHours.Text += time / 60 + Language.StringByID(StringId.m);
+            btnWorkHours.Text += time % 60 + Language.StringByID(StringId.s);
+
             var waitPage = new Loading();
             this.AddChidren(waitPage);
 
@@ -289,7 +296,8 @@
                                 btnWorkHours.Text += minute + "鍒�";
                                 btnWorkHours.Text += second + "绉�";
                                 new System.Threading.Thread(() => {
-                                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+                                    var d = new Dictionary<string, string>();
+                                    function.SetAttrState(FunctionAttributeKey.ColorfulTime, (hour * 360 + minute * 60 + second).ToString());
                                     d.Add(FunctionAttributeKey.ColorfulTime, (hour * 360 + minute * 60 + second).ToString());
                                     Control.Ins.SendWriteCommand(function, d);
                                 }) { IsBackground = true }.Start();
@@ -309,8 +317,6 @@
             btnWorkHours.MouseUpEventHandler = eventHandler;
             workHoursView.MouseUpEventHandler = eventHandler;
             btnWorkHoursRight.MouseUpEventHandler = eventHandler;
-
-
             #endregion
 
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
index 5ecba87..b71e0c6 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs
@@ -1,5 +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 Shared;
@@ -93,7 +95,7 @@
 
 
             //鍥為��鍒锋柊淇℃伅浜嬩欢
-            new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView_SettingIcon( () => {
+            new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl)).LoadTopView_SettingIcon( () => {
                 var page = new AddGroupControlPage(function,
                         (newGC) => {
                             try
@@ -116,7 +118,7 @@
                             try
                             {
                                 this.RemoveFromParent();
-                                UI.HomePage.RefreshFunctionView();
+                                UI.HomePage.RefreshGroupControlView();
                                 UI.RoomPage.bodyView?.ReLoadPage();
                                 UI.FunctionPage.bodyView?.ReLoadPage();
                             }
@@ -157,10 +159,12 @@
                         }
                     }
                     hadRGB = true;
+                    hadDimming = true;
                 }
                 else if (temp.spk == SPK.LightCCT)
                 {
                     hadCCT = true;
+                    hadDimming = true;
                 }
                 else if (temp.spk == SPK.LightDimming)
                 {
@@ -187,25 +191,7 @@
             controlView.AddChidren(attrView);
             attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) });
 
-
-            if (hadRGB)
-            {
-                hadCCT = true;
-                LoadRgbAttrView(hadCCT,hadColorful);
-            }
-            else if (hadCCT)
-            {
-                LoadCctAttrView(attrView);
-            }
-            else if (hadDimming)
-            {
-                LoadDimmingAttrView(attrView);
-            }
-            
-
-
-
-            var btnSwitch = new Button()
+            btnSwitch = new Button()
             {
                 Gravity = Gravity.CenterHorizontal,
                 Y = Application.GetRealHeight(466),
@@ -233,7 +219,61 @@
             };
 
 
+
+            if (hadRGB)
+            {
+                LoadRgbAttrView(hadCCT,hadColorful);
+            }
+            else if (hadCCT)
+            {
+                LoadCctAttrView(attrView);
+            }
+            else if (hadDimming)
+            {
+                LoadDimmingAttrView(attrView);
+            }
+            else
+            {
+                attrView.AddChidren(new Button() { Height = Application.GetRealHeight(30) });
+                var btnSwitchIcon = new Button()
+                {
+                    Gravity = Gravity.CenterHorizontal,
+                    Y = Application.GetRealHeight(102),
+                    Width = Application.GetRealWidth(168),
+                    Height = Application.GetRealWidth(288),
+                    UnSelectedImagePath = "FunctionIcon/Light/RelayBg.png",
+                    SelectedImagePath = "FunctionIcon/Light/RelayOnBg.png",
+                    IsSelected = function.trait_on_off.curValue.ToString() == "on"
+                };
+                attrView.AddChidren(btnSwitchIcon);
+
+                btnSwitchIcon.MouseUpEventHandler = (sender, e) => {
+                    if (btnSwitchIcon.IsSelected)
+                    {
+                        btnSwitchIcon.IsSelected = btnSwitch.IsSelected = false;
+                        var d = new Dictionary<string, string>();
+                        d.Add(FunctionAttributeKey.OnOff, "off");
+                        function.Control(d);
+                    }
+                    else
+                    {
+                        btnSwitchIcon.IsSelected = btnSwitch.IsSelected = true;
+                        var d = new Dictionary<string, string>();
+                        d.Add(FunctionAttributeKey.OnOff, "on");
+                        function.Control(d);
+                    }
+                };
+                btnSwitch.MouseUpEventHandler += (sender, e) => {
+                    btnSwitchIcon.IsSelected = btnSwitch.IsSelected;
+                };
+            }
+
+
+
+
+
         }
+        Button btnSwitch;
 
         /// <summary>
         /// 鍔犺浇璋冨厜灞炴�ц缃帶浠�
@@ -241,88 +281,98 @@
         /// <param name="attrView"></param>
         void LoadDimmingAttrView(VerticalScrolViewLayout attrView)
         {
-            var dimmingView = new FrameLayout()
-            {
-                Height = Application.GetRealHeight(54 + 11)
-            };
-            attrView.AddChidren(dimmingView);
 
-            #region 浜害璋冭妭
+
+
+            attrView.AddChidren(new Button
+            {
+                Height = Application.GetRealHeight(50),
+            });
+
+            var dimmerView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(280)
+            };
+            attrView.AddChidren(dimmerView);
+
+            var dimmerBar = new WaveSeekBarOn()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(168 - 40),
+                Height = Application.GetRealHeight(288 - 16 - 16),
+                BorderColor = 0x00000000,
+                CornerRadius = Application.GetRealWidth(30),
+                BorderWidth = 0,
+                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
+                IsProgressTextShow = false,
+            };
+            dimmerView.AddChidren(dimmerBar);
+
             var btnBrightnessText = new Button()
             {
-                X = Application.GetRealWidth(35),
-                Y = Application.GetRealHeight(1),
-                Width = Application.GetRealWidth(224),
-                Height = Application.GetRealHeight(25),
-                TextAlignment = TextAlignment.CenterLeft,
+                Gravity = Gravity.CenterHorizontal,
+                Y = ((100 - Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100),
+                Width = Application.GetRealWidth(56),
+                Height = Application.GetRealWidth(46),
+                UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png",
                 TextColor = CSS_Color.FirstLevelTitleColor,
-                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                TextID = StringId.Brightness,
+                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
+                Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%",
             };
-            btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + function.GetAttrState(FunctionAttributeKey.Brightness) + "%";
-            dimmingView.AddChidren(btnBrightnessText);
+            dimmerView.AddChidren(btnBrightnessText);
 
-
-            var btnMinValuesText = new Button()
-            {
-                X = Application.GetRealWidth(35),
-                Y = btnBrightnessText.Bottom,
-                Width = Application.GetRealWidth(40),
-                Height = Application.GetRealHeight(21),
-                Text = "0%",
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = CSS_Color.PromptingColor1,
-                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-            };
-            dimmingView.AddChidren(btnMinValuesText);
-
-            var dimmerBar = new DiyImageSeekBar()
-            {
-                X = Application.GetRealWidth(45 + 10),
-                Y = Application.GetRealHeight(11),
-                Width = Application.GetRealWidth(220),
-                Height = Application.GetRealHeight(54),
-                SeekBarViewHeight = Application.GetRealHeight(8),
-                ThumbImagePath = "Public/ThumbImage.png",
-                ThumbImageHeight = Application.GetRealHeight(54),
-                ProgressTextColor = CSS_Color.FirstLevelTitleColor,
-                ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                ProgressBarColor = CSS_Color.AuxiliaryColor1,
-                MaxValue = 100,
-                SeekBarPadding = Application.GetRealWidth(20),
-                IsProgressTextShow = false,
-                ProgressChangeDelayTime = 0,
-            };
-            dimmingView.AddChidren(dimmerBar);
             dimmerBar.OnProgressChangedEvent = (sender, e) =>
             {
-                btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%";
-            };
-            dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
-            {
-                btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%";
-
-                var d = new Dictionary<string, string>();
-                d.Add(FunctionAttributeKey.Brightness, e.ToString());
-                function.Control(d);
-            };
+                if (e == 0 && lastBrightness != 0)
+                {
+                    btnSwitch.IsSelected = false;
+                    lastBrightness = 0;
+                }
+                else
+                {
+                    if (lastBrightness == 0)
+                        lastBrightness = e;
+                    btnSwitch.IsSelected = true;
+                }
+                if (e == 0 || e == 100)
+                {
+                    var d = new Dictionary<string, string>();
+                    d.Add(FunctionAttributeKey.Brightness, e.ToString());
+                    function.Control(d);
+                }
+                else
+                {
+                    if (350 < (DateTime.Now - function.refreshTime).TotalMilliseconds)
+                    {
+                        function.refreshTime = DateTime.Now;
+                        new System.Threading.Thread(() =>
+                        {
+                            var d = new Dictionary<string, string>();
+                            d.Add(FunctionAttributeKey.Brightness, e.ToString());
+                            function.Control(d);
+                        })
+                        { IsBackground = true }.Start();
+                    }
+                }
 
 
-            var btnMaxValuesText = new Button()
-            {
-                X = dimmerBar.Right,
-                Y = btnBrightnessText.Bottom,
-                Width = Application.GetRealWidth(55),
-                Height = Application.GetRealHeight(21),
-                Text = "100%",
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = CSS_Color.PromptingColor1,
-                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
             };
-            dimmingView.AddChidren(btnMaxValuesText);
-            #endregion
+
+            btnSwitch.MouseUpEventHandler += (sender, e) => {
+                if (btnSwitch.IsSelected)
+                {
+                    dimmerBar.Progress = 100;
+                }
+                else
+                {
+                    dimmerBar.Progress = 0;
+                }
+            };
 
         }
+        int lastBrightness = 0;
 
         /// <summary>
         /// 鍔犺浇cct灞炴�ц缃帶浠�
@@ -330,6 +380,96 @@
         /// <param name="attrView"></param>
         void LoadCctAttrView(VerticalScrolViewLayout attrView)
         {
+            attrView.AddChidren(new Button
+            {
+                Height = Application.GetRealHeight(20),
+            });
+
+            var dimmerView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(280)
+            };
+            attrView.AddChidren(dimmerView);
+
+            var dimmerBar = new WaveSeekBarOn()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(168 - 40),
+                Height = Application.GetRealHeight(288 - 16 - 16),
+                BorderColor = 0x00000000,
+                CornerRadius = Application.GetRealWidth(30),
+                BorderWidth = 0,
+                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
+                IsProgressTextShow = false,
+            };
+            dimmerView.AddChidren(dimmerBar);
+
+            var btnBrightnessText = new Button()
+            {
+                Gravity = Gravity.CenterHorizontal,
+                Y = ((100 - Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100),
+                Width = Application.GetRealWidth(56),
+                Height = Application.GetRealWidth(46),
+                UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png",
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
+                Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%",
+            };
+            dimmerView.AddChidren(btnBrightnessText);
+
+            dimmerBar.OnProgressChangedEvent = (sender, e) =>
+            {
+                if (e == 0 && lastBrightness != 0)
+                {
+                    btnSwitch.IsSelected = false;
+                    lastBrightness = 0;
+                }
+                else
+                {
+                    if (lastBrightness == 0)
+                        lastBrightness = e;
+                    btnSwitch.IsSelected = true;
+                }
+
+                if (e == 0 || e == 100)
+                {
+                    var d = new Dictionary<string, string>();
+                    d.Add(FunctionAttributeKey.Brightness, e.ToString());
+                    function.Control(d);
+                }
+                else
+                {
+                    if (350 < (DateTime.Now - function.refreshTime).TotalMilliseconds)
+                    {
+                        function.refreshTime = DateTime.Now;
+                        new System.Threading.Thread(() =>
+                        {
+                            var d = new Dictionary<string, string>();
+                            d.Add(FunctionAttributeKey.Brightness, e.ToString());
+                            function.Control(d);
+                        })
+                        { IsBackground = true }.Start();
+                    }
+                }
+
+
+                btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100);
+                btnBrightnessText.Text = dimmerBar.Progress + "%";
+            };
+
+            btnSwitch.MouseUpEventHandler += (sender, e) => {
+                if (btnSwitch.IsSelected)
+                {
+                    dimmerBar.Progress = 100;
+                }
+                else
+                {
+                    dimmerBar.Progress = 0;
+                }
+            };
+
+            //attrView.AddChidren(new Button() { Height = Application.GetRealHeight(10) });
+
             #region 鑹叉俯
             var cctView = new FrameLayout()
             {
@@ -385,6 +525,7 @@
                 Y = Application.GetRealHeight(11),
                 Width = Application.GetRealWidth(220),
                 Height = Application.GetRealHeight(54),
+                Progress = 38,
             };
             barColorTemplatrue.MinValue = 27;
             barColorTemplatrue.MaxValue = 65;
@@ -489,6 +630,52 @@
             };
             btnWhiteRound.Visible = false;
             framePickerBack.AddChidren(btnWhiteRound);
+
+
+            //褰撳墠鐐瑰嚮鐨勩�愮偣銆戞槸鍚︽纭�
+            bool pointIsRight = false;
+            //鍦嗙殑鍗婂緞(鑰冭檻杈圭晫,闇�瑕佽缃畠鐨勫崐寰勬瘮杈冨皬涓�鐐�)
+            int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12);
+            string rgbString = "255,255,255";
+            var rgbTemp = new Light();
+            colorPicker.MouseUpEventHandler = (sender2, e2) =>
+            {
+                var d = new Dictionary<string, string>();
+                d.Add(FunctionAttributeKey.RGB, rgbString);
+                function.Control(d);
+            };
+            colorPicker.ColorChaged += (sender2, e2) =>
+            {
+                rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString();
+                btnCurColor.BackgroundColor = (uint)(0xFF000000 + rgbTemp.GetRGBcolor(rgbString));
+                var d = new Dictionary<string, string>();
+                d.Add(FunctionAttributeKey.RGB, rgbString);
+                function.Control(d);
+            };
+            colorPicker.MouseDownEventHandler += (sender, e) =>
+            {
+                pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y);
+                if (pointIsRight == false)
+                {
+                    //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
+                    return;
+                }
+                //鏄剧ず鐧界偣
+                btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2;
+                btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2;
+                if (btnWhiteRound.Visible == false)
+                {
+                    btnWhiteRound.Visible = true;
+                }
+            };
+
+            colorPicker.MouseMoveEventHandler += (sender, e) =>
+            {
+                //褰撻紶鏍囩偣涓嬩簨浠跺鐞�
+                colorPicker.MouseDownEventHandler(sender, e);
+            };
+
+
 
             #region 浜害璋冭妭
             var btnBrightnessText = new Button()
@@ -668,16 +855,17 @@
                 };
                 controlView.AddChidren(btnGradualChangeText);
 
-                var btnGradualChangeMinValuesText = new Button()
+                var btnColorfulEdit = new Button()
                 {
                     X = Application.GetRealWidth(35),
                     Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10),
                     Width = Application.GetRealWidth(22),
                     Height = Application.GetRealHeight(21),
                     UnSelectedImagePath = "Public/Edit.png",
+                    Visible = false,
                 };
-                controlView.AddChidren(btnGradualChangeMinValuesText);
-                btnGradualChangeMinValuesText.MouseUpEventHandler = (sender, e) => {
+                controlView.AddChidren(btnColorfulEdit);
+                btnColorfulEdit.MouseUpEventHandler = (sender, e) => {
                     var rgbView = new ColorfulInfoPage(function);
                     MainPage.BasePageView.AddChidren(rgbView);
                     rgbView.LoadPage();
@@ -686,7 +874,7 @@
 
                 var barColorful = new FrameLayout()
                 {
-                    X = btnGradualChangeMinValuesText.Right + Application.GetRealWidth(15+5),
+                    X = btnColorfulEdit.Right + Application.GetRealWidth(15+5),
                     Y = Application.GetRealHeight(412 + heightMore - magriHeight),
                     Width = Application.GetRealWidth(170),
                     Height = Application.GetRealHeight(8),
@@ -694,21 +882,45 @@
                 };
                 controlView.AddChidren(barColorful);
 
-                var btnGradualChangeMaxValuesText = new Button()
+                var btnColorfulSwitch = new Button()
                 {
                     X = barColorful.Right + Application.GetRealWidth(8),
                     Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10),
                     Width = Application.GetRealWidth(38),
                     Height = Application.GetRealHeight(24),
-                    UnSelectedImagePath = "Public/Switch.png"
+                    UnSelectedImagePath = "Public/Switch.png",
+                    SelectedImagePath = "Public/SwitchOn.png"
                 };
-                controlView.AddChidren(btnGradualChangeMaxValuesText);
+                controlView.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);
+                      
+                            Control.Ins.SendWriteCommand(function, d);
+                        }
+                        catch (Exception ex)
+                        {
+                            MainPage.Log($"鎺у埗鐐僵寮�鍏冲紓甯�:{ex.Message}");
+                        }
+                    })
+                    { IsBackground = true }.Start();
+                };
+
                 #endregion
 
 
             }
 
-         
+
 
         }
 
@@ -742,5 +954,9 @@
             return false;
         }
 
+
+
+
+
     }
 }

--
Gitblit v1.8.0