From 9bef786592d10aaecc124fa7949519b2948df8be Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 14 六月 2023 16:27:29 +0800
Subject: [PATCH] 安卓linqhone闪退修复

---
 HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs |   88 +++++++++++++++++++++++++++++++++++++------
 1 files changed, 75 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
index 1a26758..d3b6c6a 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
@@ -53,11 +53,11 @@
 
         #region 鍖哄煙鍙橀噺
         Light lightTemp;
+        Function function;
         Button btnCollection_Out;
         Button btnFunctionName_Out;
         Button btnFromFloor_Out;
         bool onDimmerBar = false;
-        Function function;
 
         /// <summary>
         /// 鏈�鍚庢墦寮�鐨勯鑹�
@@ -84,6 +84,12 @@
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
             //new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(function,null);
             //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function);
+
+            int magriHeight = 0;
+            if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null && function.GetAttribute(FunctionAttributeKey.Colorful) != null)
+            {
+                magriHeight = 80;
+            }
 
             FrameLayout controlView = new FrameLayout()
             {
@@ -155,8 +161,8 @@
             var framePickerBack = new FrameLayout();
             framePickerBack.Gravity = Gravity.CenterHorizontal;
             framePickerBack.Y = btnFromFoorAndRoom.Bottom + Application.GetRealHeight(1);
-            framePickerBack.Width = Application.GetMinRealAverage(216);
-            framePickerBack.Height = Application.GetMinRealAverage(216);
+            framePickerBack.Width = Application.GetMinRealAverage(216-magriHeight);
+            framePickerBack.Height = Application.GetMinRealAverage(216 - magriHeight);
             //framePickerBack.BackgroundColor = 0xFFFF0000;
             controlView.AddChidren(framePickerBack);
 
@@ -196,7 +202,7 @@
             var btnBrightnessText = new Button()
             {
                 X = Application.GetRealWidth(35),
-                Y = Application.GetRealHeight(308),
+                Y = Application.GetRealHeight(308 - magriHeight),
                 Width = Application.GetRealWidth(224),
                 Height = Application.GetRealHeight(21),
                 TextAlignment = TextAlignment.CenterLeft,
@@ -222,7 +228,7 @@
             dimmerBar = new DiyImageSeekBar()
             {
                 X = Application.GetRealWidth(35 + 22),
-                Y = Application.GetRealHeight(312),
+                Y = Application.GetRealHeight(312 - magriHeight),
                 Width = Application.GetRealWidth(210),
                 Height = Application.GetRealHeight(54),
                 SeekBarViewHeight = Application.GetRealHeight(8),
@@ -251,21 +257,22 @@
             controlView.AddChidren(btnMaxValuesText);
             #endregion
 
+            int heightMore = 375 - magriHeight;
+
             if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null)
             {
                 #region 娓愬彉鏃堕棿璋冭妭
+
                 var btnGradualChangeText = new Button()
                 {
                     X = Application.GetRealWidth(35),
-                    Y = Application.GetRealHeight(375),
+                    Y = Application.GetRealHeight(heightMore),
                     Width = Application.GetRealWidth(224),
                     Height = Application.GetRealHeight(21),
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                     TextID = StringId.SpeedOfChange,
-                    Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-                    Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                 };
                 controlView.AddChidren(btnGradualChangeText);
 
@@ -279,15 +286,13 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = CSS_Color.PromptingColor1,
                     TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                    Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-                    Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                 };
                 controlView.AddChidren(btnGradualChangeMinValuesText);
 
                 barFadeTime = new DiyImageSeekBar()
                 {
                     X = btnGradualChangeMinValuesText.Right,
-                    Y = Application.GetRealHeight(412 - 21),
+                    Y = Application.GetRealHeight(412 - 21-magriHeight),
                     Width = Application.GetRealWidth(210),
                     Height = Application.GetRealHeight(54),
                     SeekBarViewHeight = Application.GetRealHeight(8),
@@ -301,8 +306,6 @@
                     MaxValue = 10,
                     Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)),
                     SeekBarPadding = Application.GetRealWidth(20),
-                    Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
-                    Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
                 };
                 controlView.AddChidren(barFadeTime);
                 barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
@@ -326,8 +329,67 @@
                 };
                 controlView.AddChidren(btnGradualChangeMaxValuesText);
                 #endregion
+                heightMore = 70;
 
             }
+
+            if (function.GetAttribute(FunctionAttributeKey.Colorful)!= null)
+            {
+                #region 鐐僵鍔熻兘
+
+                var btnGradualChangeText = new Button()
+                {
+                    X = Application.GetRealWidth(35),
+                    Y = Application.GetRealHeight(375+ heightMore- magriHeight),
+                    Width = Application.GetRealWidth(224),
+                    Height = Application.GetRealHeight(21),
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = CSS_Color.FirstLevelTitleColor,
+                    TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                    TextID = StringId.ColorfulFunction,
+                };
+                controlView.AddChidren(btnGradualChangeText);
+
+                var btnGradualChangeMinValuesText = new Button()
+                {
+                    X = Application.GetRealWidth(35),
+                    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10),
+                    Width = Application.GetRealWidth(22),
+                    Height = Application.GetRealHeight(21),
+                    UnSelectedImagePath = "Public/Edit.png",
+                };
+                controlView.AddChidren(btnGradualChangeMinValuesText);
+                btnGradualChangeMinValuesText.MouseUpEventHandler = (sender, e) => {
+                    var rgbView = new ColorfulInfoPage(function);
+                    MainPage.BasePageView.AddChidren(rgbView);
+                    rgbView.LoadPage();
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                };
+
+                var barColorful = new FrameLayout()
+                {
+                    X = btnGradualChangeMinValuesText.Right + Application.GetRealWidth(15),
+                    Y = Application.GetRealHeight(412 + heightMore-magriHeight),
+                    Width = Application.GetRealWidth(180),
+                    Height = Application.GetRealHeight(10),
+                    BackgroundImagePath = "FunctionIcon/Light/ColorWheel.png",
+                };
+                controlView.AddChidren(barColorful);
+
+                var btnGradualChangeMaxValuesText = new Button()
+                {
+                    X = barFadeTime.Right,
+                    Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10),
+                    Width = Application.GetRealWidth(35),
+                    Height = Application.GetRealHeight(21),
+                    UnSelectedImagePath = "Public/Switch.png"
+                };
+                controlView.AddChidren(btnGradualChangeMaxValuesText);
+                #endregion
+
+
+            }
+
             btnRestoredPoint = new Button()
             {
                 X = Application.GetRealWidth(116),

--
Gitblit v1.8.0