From e96e11d6f8b965ea522c983e040d41e3b9ef105a Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 18 五月 2020 21:33:19 +0800
Subject: [PATCH] 2020-05-18-4

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs |  243 ++++++++++++++++++++++--------------------------
 1 files changed, 111 insertions(+), 132 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs
index 6db3cd4..f81d8a3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Relay/RelayThreeLoadBackLightSettionForm.cs
@@ -38,27 +38,27 @@
 
         #region 鈻� 鍒濆鍖朹____________________________
 
-        /// <summary>
-        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
-        /// </summary>
-        public void ShowForm(string i_deviceMac)
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        public void ShowForm(string i_deviceMac)
         {
-            UserView.HomePage.Instance.ScrollEnabled = false;
+            this.ScrollEnabled = false;
 
-            this.deviceMac = i_deviceMac;
-            this.listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac);
-
-            //璁剧疆澶撮儴淇℃伅
-            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uBackLight));
-
-            //鍒濆鍖栦腑閮ㄤ俊鎭�
-            this.InitMiddleFrame();
-        }
-
-        /// <summary>
-        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
-        /// </summary>
-        private async void InitMiddleFrame()
+            this.deviceMac = i_deviceMac;
+            this.listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac);
+
+            //璁剧疆澶撮儴淇℃伅
+            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uBackLight));
+
+            //鍒濆鍖栦腑閮ㄤ俊鎭�
+            this.InitMiddleFrame();
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+        /// </summary>
+        private async void InitMiddleFrame()
         {
             //鑾峰彇璁惧鍒濆鏁版嵁
             var result = await this.GetDeviceDefultData();
@@ -67,22 +67,22 @@
                 return;
             }
             //娓呯┖bodyFrame
-            this.ClearBodyFrame();
-
-            //鐐瑰嚮鐘舵��
-            var btnClickStatu = new NormalViewControl(600, 49, true);
-            btnClickStatu.X = ControlCommonResourse.XXLeft;
-            btnClickStatu.Y = Application.GetRealHeight(207);
-            btnClickStatu.TextSize = 12;
-            btnClickStatu.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnClickStatu.TextID = R.MyInternationalizationString.uClickStatu;
-            bodyFrameLayout.AddChidren(btnClickStatu);
-
+            this.ClearBodyFrame();
+
+            //鐐瑰嚮鐘舵��
+            var btnClickStatu = new NormalViewControl(600, 49, true);
+            btnClickStatu.X = ControlCommonResourse.XXLeft;
+            btnClickStatu.Y = Application.GetRealHeight(207);
+            btnClickStatu.TextSize = 12;
+            btnClickStatu.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnClickStatu.TextID = R.MyInternationalizationString.uClickStatu;
+            bodyFrameLayout.AddChidren(btnClickStatu);
+
             //鍚勭鑳屽厜鐏殑瀹瑰櫒
-            var frameLinght = new FrameLayout();
-            frameLinght.Height = Application.GetRealHeight(818);
-            frameLinght.Y = Application.GetRealHeight(279);
-            frameLinght.BackgroundColor = UserCenterColor.Current.White;
+            var frameLinght = new FrameLayout();
+            frameLinght.Height = Application.GetRealHeight(818);
+            frameLinght.Y = Application.GetRealHeight(279);
+            frameLinght.BackgroundColor = UserCenterColor.Current.White;
             bodyFrameLayout.AddChidren(frameLinght);
 
             //娣诲姞1-6骞叉帴鐐圭殑鑳屽厜鐏繘搴︽潯
@@ -139,6 +139,10 @@
             frameBack.Height = Application.GetRealHeight(170);
             bodyFrameLayout.AddChidren(frameBack);
 
+            //褰撳墠浜害(鍏堝0鏄�,涓轰簡瀵瑰簲IOS鐨勬姌鍙犲悗,娌℃湁瀹屽叏閬尅鐨勯棶棰�)
+            var btnProgressView1 = new NormalViewControl(200, 49, true);
+            var btnProgress1 = new NormalViewControl(200, 49, true);
+
             //鑺傝兘妯″紡
             frameBack.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uEnergyConservationMode), 400);
             //寮�鍏虫帶浠�
@@ -154,12 +158,16 @@
                     frameBack.Height += value;
                     btnClickStatu.Y += value;
                     frameLinght.Y += value;
+                    btnProgressView1.Visible = true;
+                    btnProgress1.Visible = true;
                 }
                 else
                 {
                     frameBack.Height -= value;
                     btnClickStatu.Y -= value;
                     frameLinght.Y -= value;
+                    btnProgressView1.Visible = false;
+                    btnProgress1.Visible = false;
                 }
                 //鏁版嵁鍙樻洿
                 valueChanged = true;
@@ -170,56 +178,50 @@
             }
 
             //褰撳墠浜害
-            var btnProgressView1 = new NormalViewControl(200, 49, true);
-            btnProgressView1.X = ControlCommonResourse.XXLeft;
+            btnProgressView1.X = ControlCommonResourse.XXLeft;
             btnProgressView1.Y = Application.GetRealHeight(161);
-            btnProgressView1.TextSize = 12;
-            btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
+            btnProgressView1.TextSize = 12;
+            btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnProgressView1.TextID = R.MyInternationalizationString.uNowLuminance;
             frameBack.AddChidren(btnProgressView1);
-            var btnProgress1 = new NormalViewControl(200, 49, true);
-            btnProgress1.X = Application.GetRealWidth(222);
+            btnProgressView1.Visible = false;
+            btnProgress1.X = Application.GetRealWidth(222);
             btnProgress1.Y = Application.GetRealHeight(158);
-            btnProgress1.TextSize = 12;
-            btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnProgress1.Text = energyModeInfo.level + "%";
+            btnProgress1.TextSize = 12;
+            btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnProgress1.Text = energyModeInfo.level + "%";
             frameBack.AddChidren(btnProgress1);
+            btnProgress1.Visible = false;
 
             //杩涘害鏉�
-            var seekBar1 = new HorizontalSeekBar();
+            var seekBar1 = new SeekBarControl();
             seekBar1.Y = Application.GetRealHeight(253);
-            seekBar1.Gravity = Gravity.CenterHorizontal;
-            seekBar1.Width = Application.GetRealWidth(962);
-            seekBar1.Height = Application.GetRealHeight(81);
-            seekBar1.Max = 100;
-            seekBar1.BackgroundColor = 0xfff5f5f5;
-            seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
-            seekBar1.ProgressColor = 0xff3e99f4;
-            seekBar1.Progress = energyModeInfo.level;
+            seekBar1.ProgressBarColor = 0xff3e99f4;
             frameBack.AddChidren(seekBar1);
-            seekBar1.ProgressChanged += (sender, value) =>
+            seekBar1.ProgressChangedEvent += (div, value) =>
             {
                 btnProgress1.Text = value + "%";
                 //鏁版嵁鍙樻洿
                 energyModeInfo.level = value;
                 valueChanged = true;
             };
+            seekBar1.Progress = energyModeInfo.level;
 
             var btnTemp1 = new NormalViewControl(200, 49, true);
-            btnTemp1.X = ControlCommonResourse.XXLeft;
+            btnTemp1.X = ControlCommonResourse.XXLeft;
             btnTemp1.Y = Application.GetRealHeight(325);
-            btnTemp1.TextSize = 12;
-            btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnTemp1.Text = "0%";
+            btnTemp1.TextSize = 12;
+            btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnTemp1.Text = "0%";
             frameBack.AddChidren(btnTemp1);
 
             var btnTemp2 = new NormalViewControl(200, 49, true);
-            btnTemp2.X = frameLinght.Width - Application.GetRealWidth(200 + 49);
+            btnTemp2.X = frameLinght.Width - Application.GetRealWidth(200 + 49);
             btnTemp2.Y = Application.GetRealHeight(325);
             btnTemp2.TextAlignment = TextAlignment.CenterRight;
-            btnTemp2.TextSize = 12;
-            btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnTemp2.Text = "100%";
+            btnTemp2.TextSize = 12;
+            btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnTemp2.Text = "100%";
             frameBack.AddChidren(btnTemp2);
 
             if (energyModeInfo.enable == true)
@@ -229,6 +231,9 @@
                 frameBack.Height += value;
                 btnClickStatu.Y += value;
                 frameLinght.Y += value;
+
+                btnProgressView1.Visible = true;
+                btnProgress1.Visible = true;
             }
         }
 
@@ -243,62 +248,56 @@
         private void AddSixDryContactProgress(FrameLayout frameLinght)
         {
             var btnProgressView1 = new NormalViewControl(200, 49, true);
-            btnProgressView1.X = ControlCommonResourse.XXLeft;
+            btnProgressView1.X = ControlCommonResourse.XXLeft;
             btnProgressView1.Y = Application.GetRealHeight(29);
-            btnProgressView1.TextSize = 12;
-            btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnProgressView1.Text = "Dry1-6";
+            btnProgressView1.TextSize = 12;
+            btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnProgressView1.Text = "Dry1-6";
             frameLinght.AddChidren(btnProgressView1);
             var btnProgress1 = new NormalViewControl(200, 49, true);
-            btnProgress1.X = Application.GetRealWidth(204);
+            btnProgress1.X = Application.GetRealWidth(204);
             btnProgress1.Y = Application.GetRealHeight(29);
-            btnProgress1.TextSize = 12;
-            btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnProgress1.Text = linghtLevelInfo.panelDirectionsLevel + "%";
+            btnProgress1.TextSize = 12;
+            btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnProgress1.Text = linghtLevelInfo.panelBacklightLevel + "%";
             frameLinght.AddChidren(btnProgress1);
 
             //杩涘害鏉�
-            var seekBar1 = new HorizontalSeekBar();
+            var seekBar1 = new SeekBarControl();
             seekBar1.Y = Application.GetRealHeight(124);
-            seekBar1.Gravity = Gravity.CenterHorizontal;
-            seekBar1.Width = Application.GetRealWidth(962);
-            seekBar1.Height = Application.GetRealHeight(81);
-            seekBar1.Max = 100;
-            seekBar1.BackgroundColor = 0xfff5f5f5;
-            seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
-            seekBar1.ProgressColor = 0xfffdb500;
-            seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel;
+            seekBar1.ProgressBarColor = 0xfffdb500;
             frameLinght.AddChidren(seekBar1);
-            seekBar1.ProgressChanged += (sender, value) =>
+            seekBar1.ProgressChangedEvent += (div, value) =>
             {
                 btnProgress1.Text = value + "%";
                 //鏁版嵁鍙樻洿
-                linghtLevelInfo.panelDirectionsLevel = value;
+                linghtLevelInfo.panelBacklightLevel = value;
                 valueChanged = true;
             };
+            seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
 
             var btnTemp1 = new NormalViewControl(200, 49, true);
-            btnTemp1.X = ControlCommonResourse.XXLeft;
+            btnTemp1.X = ControlCommonResourse.XXLeft;
             btnTemp1.Y = Application.GetRealHeight(193);
-            btnTemp1.TextSize = 12;
-            btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnTemp1.Text = "0%";
+            btnTemp1.TextSize = 12;
+            btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnTemp1.Text = "0%";
             frameLinght.AddChidren(btnTemp1);
 
             var btnTemp2 = new NormalViewControl(200, 49, true);
-            btnTemp2.X = frameLinght.Width - Application.GetRealWidth(200 + 49);
+            btnTemp2.X = frameLinght.Width - Application.GetRealWidth(200 + 49);
             btnTemp2.Y = Application.GetRealHeight(193);
             btnTemp2.TextAlignment = TextAlignment.CenterRight;
-            btnTemp2.TextSize = 12;
-            btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnTemp2.Text = "100%";
+            btnTemp2.TextSize = 12;
+            btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnTemp2.Text = "100%";
             frameLinght.AddChidren(btnTemp2);
 
             //绾�
             var btnLine = new NormalViewControl(Application.GetRealWidth(965), ControlCommonResourse.BottomLineHeight, false);
             btnLine.Y = Application.GetRealHeight(311);
             btnLine.Gravity = Gravity.CenterHorizontal;
-            btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+            btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
             frameLinght.AddChidren(btnLine);
         }
 
@@ -313,62 +312,56 @@
         private void AddSevenDryContactProgress(FrameLayout frameLinght)
         {
             var btnProgressView1 = new NormalViewControl(200, 49, true);
-            btnProgressView1.X = ControlCommonResourse.XXLeft;
+            btnProgressView1.X = ControlCommonResourse.XXLeft;
             btnProgressView1.Y = Application.GetRealHeight(369);
-            btnProgressView1.TextSize = 12;
-            btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnProgressView1.Text = "Dry7";
+            btnProgressView1.TextSize = 12;
+            btnProgressView1.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnProgressView1.Text = "Dry7";
             frameLinght.AddChidren(btnProgressView1);
             var btnProgress1 = new NormalViewControl(200, 49, true);
-            btnProgress1.X = Application.GetRealWidth(161);
+            btnProgress1.X = Application.GetRealWidth(161);
             btnProgress1.Y = Application.GetRealHeight(369);
-            btnProgress1.TextSize = 12;
-            btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
-            btnProgress1.Text = linghtLevelInfo.panelBacklightLevel + "%";
+            btnProgress1.TextSize = 12;
+            btnProgress1.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnProgress1.Text = linghtLevelInfo.panelDirectionsLevel + "%";
             frameLinght.AddChidren(btnProgress1);
 
             //杩涘害鏉�
-            var seekBar1 = new HorizontalSeekBar();
+            var seekBar1 = new SeekBarControl();
             seekBar1.Y = Application.GetRealHeight(464);
-            seekBar1.Gravity = Gravity.CenterHorizontal;
-            seekBar1.Width = Application.GetRealWidth(962);
-            seekBar1.Height = Application.GetRealHeight(81);
-            seekBar1.Max = 100;
-            seekBar1.BackgroundColor = 0xfff5f5f5;
-            seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
-            seekBar1.ProgressColor = 0xfffdb500;
-            seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
+            seekBar1.ProgressBarColor = 0xfffdb500;
             frameLinght.AddChidren(seekBar1);
-            seekBar1.ProgressChanged += (sender, value) =>
+            seekBar1.ProgressChangedEvent += (div, value) =>
             {
                 btnProgress1.Text = value + "%";
                 //鏁版嵁鍙樻洿
-                linghtLevelInfo.panelBacklightLevel = value;
+                linghtLevelInfo.panelDirectionsLevel = value;
                 valueChanged = true;
             };
+            seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel;
 
             var btnTemp1 = new NormalViewControl(200, 49, true);
-            btnTemp1.X = ControlCommonResourse.XXLeft;
+            btnTemp1.X = ControlCommonResourse.XXLeft;
             btnTemp1.Y = Application.GetRealHeight(533);
-            btnTemp1.TextSize = 12;
-            btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnTemp1.Text = "0%";
+            btnTemp1.TextSize = 12;
+            btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnTemp1.Text = "0%";
             frameLinght.AddChidren(btnTemp1);
 
             var btnTemp2 = new NormalViewControl(200, 49, true);
-            btnTemp2.X = frameLinght.Width - Application.GetRealWidth(200 + 49);
+            btnTemp2.X = frameLinght.Width - Application.GetRealWidth(200 + 49);
             btnTemp2.Y = Application.GetRealHeight(533);
             btnTemp2.TextAlignment = TextAlignment.CenterRight;
-            btnTemp2.TextSize = 12;
-            btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
-            btnTemp2.Text = "100%";
+            btnTemp2.TextSize = 12;
+            btnTemp2.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnTemp2.Text = "100%";
             frameLinght.AddChidren(btnTemp2);
 
             //绾�
             var btnLine = new NormalViewControl(Application.GetRealWidth(965), ControlCommonResourse.BottomLineHeight, false);
             btnLine.Gravity = Gravity.CenterHorizontal;
             btnLine.Y = Application.GetRealHeight(651);
-            btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+            btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
             frameLinght.AddChidren(btnLine);
         }
 
@@ -404,20 +397,6 @@
             this.CloseProgressBar();
 
             return true;
-        }
-
-        #endregion
-
-        #region 鈻� 鐣岄潰鍏抽棴___________________________
-
-        /// <summary>
-        /// 鐣岄潰鍏抽棴
-        /// </summary>
-        public override void CloseForm()
-        {
-            UserView.HomePage.Instance.ScrollEnabled = true;
-
-            base.CloseForm();
         }
 
         #endregion

--
Gitblit v1.8.0