From baca65d449433d73516660d849c112ed8f5d3dd3 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 19 十月 2023 10:35:32 +0800
Subject: [PATCH] 2023年10月19日10:34:19

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs                         |  171 ++++++----------------------
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs       |   58 ++++++++-
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs  |    4 
 HDL_ON/DAL/Server/HttpUtil.cs                                           |    4 
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs     |    6 
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs     |    2 
 HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs            |   51 ++------
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs |    5 
 HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs                         |    2 
 HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs                 |   13 --
 10 files changed, 109 insertions(+), 207 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index b659327..5235064 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,8 +18,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
         const string APP_KEY = "HDL-HOME-APP-TEST";
         const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs
index 200a28f..8fcd678 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs
@@ -12,18 +12,7 @@
     /// </summary>
     public class AksCommonMethod
     {
-        /// <summary>
-        /// 閫変腑棰滆壊
-        /// </summary>
-        public const uint seleBackgroundColor = 0xFFF2F3F7;
-        /// <summary>
-        /// 涓嶆敮鎸佹寜閿枃鏈鑹�
-        /// </summary>
-        public const uint unBackgroundColor = 0xFFA3AAB7;
-        /// <summary>
-        /// 涓嶆敮鎸佹暣涓鑹�
-        /// </summary>
-        public const uint unParentBackgroundColor = 0xFFF2F3F7;
+      
 
         private static AksCommonMethod commonMethod = null;
         /// <summary>
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs
index 3d0b7fc..05dee0c 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs
@@ -194,7 +194,7 @@
                 {
                     this.remoteControlList = SendMethod.Current.GetRemoteControlLits(this.device.deviceId);
                     this.sequencerList = SendMethod.Current.GetSequencerLits(this.device.deviceId);
-                    TestData(this.remoteControlList);
+                    //TestData(this.remoteControlList);
                 }
                 catch { }
                 finally
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
index c5eb0cc..704b7d7 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
@@ -26,13 +26,26 @@
         /// <param name="isClick">false鐐瑰嚮鏃犳晥</param>
         public bool GetClick()
         {
-           return this.mIsClick;
+            return this.mIsClick;
         }
 
         /// <summary>
         /// 寤舵椂鏃堕棿ms
         /// </summary>
-        private const int millisecondsTimeout = 100;
+        public const int millisecondsTimeout = 100;
+
+        /// <summary>
+        /// 閫変腑棰滆壊
+        /// </summary>
+        public const uint seleBackgroundColor = 0xFFF2F3F7;
+        /// <summary>
+        /// 涓嶆敮鎸佹寜閿枃鏈鑹�
+        /// </summary>
+        public const uint unBackgroundColor = 0xFFA3AAB7;
+        /// <summary>
+        /// 涓嶆敮鎸佹暣涓鑹�
+        /// </summary>
+        public const uint unParentBackgroundColor = 0xFFF2F3F7;
 
         /// <summary>
         /// 璋冩暣鐪熷疄楂樺害
@@ -75,24 +88,26 @@
             return bottomHeight;
         }
         /// <summary>
-        /// 璁剧疆楂樹寒棰滆壊
+        /// 璁剧疆楂樹寒棰滆壊(grb)
         /// </summary>
+        /// <param name="seleColor">閫変腑棰滆壊鍊�</param>
+        /// <param name="unColor">鏈�変腑棰滆壊鍊�</param>
         /// <param name="view">缁勪欢</param>
-        public void SetHighlightBackground(View view)
+        public void SetHighlightColor(View view, uint seleColor =seleBackgroundColor, uint unColor = 0x00000000) 
         {
             if (view == null)
             {
                 return;
             }
             //鎸変笅鍘绘敼鍙樿儗鏅鑹�
-            view.BackgroundColor = AksCommonMethod.seleBackgroundColor;
+            view.BackgroundColor = seleColor;
             new System.Threading.Thread(() =>
             {
                 System.Threading.Thread.Sleep(millisecondsTimeout);
                 Application.RunOnMainThread(() =>
                 {
                     //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
-                    view.BackgroundColor = 0x00000000;
+                    view.BackgroundColor = unColor;
                 });
             })
             { IsBackground = true }.Start();
@@ -110,23 +125,46 @@
                 return;
             }
             //鎸変笅鍘绘敼鍙樿儗鏅鑹�
-            button.IsSelected =true;
+            button.IsSelected = true;
             new System.Threading.Thread(() =>
             {
                 System.Threading.Thread.Sleep(millisecondsTimeout);
                 Application.RunOnMainThread(() =>
                 {
                     //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
-                    button.IsSelected=false;
+                    button.IsSelected = false;
                 });
             })
             { IsBackground = true }.Start();
 
         }
 
-     
+        /// <summary>
+        /// 璁剧疆楂樹寒鑳屾櫙鍥炬爣
+        /// </summary>
+        /// <param name="sele">閫変腑鍥剧墖璺緞</param>
+        /// <param name="unColor">鏈�変腑鍥剧墖璺緞<</param>
+        /// <param name="view">缁勪欢</param>
+        public void SetHighlightImagePath(FrameLayout frame, string seleImagePath, string unImagePath)
+        {
+            if (frame == null)
+            {
+                return;
+            }
+            //鎸変笅鍘绘敼鍙樿儗鏅鑹�
+            frame.BackgroundImagePath = seleImagePath;
+            new System.Threading.Thread(() =>
+            {
+                System.Threading.Thread.Sleep(millisecondsTimeout);
+                Application.RunOnMainThread(() =>
+                {
+                    //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                    frame.BackgroundImagePath = unImagePath;
+                });
+            })
+            { IsBackground = true }.Start();
 
-
+        }
 
 
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs
index a117fb3..36723ff 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs
@@ -156,7 +156,7 @@
                     return;
                 }
                 action?.Invoke(this, btnImage, btnName);
-                SetHighlightBackground(this);
+                SetHighlightColor(this);
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
                 //this.BackgroundColor = AksCommonMethod.seleBackgroundColor;
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
index ea95c39..6595c4d 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
@@ -130,7 +130,7 @@
                 if (!keypad.isClicked)
                 {
                     buttonFram.GetImageButton().Alpha = 0.5f;
-                    buttonFram.GetNameButton().TextColor = AksCommonMethod.unBackgroundColor;
+                    buttonFram.GetNameButton().TextColor =unBackgroundColor;
                     buttonFram.SetClick(false);
 
                 }
@@ -219,7 +219,7 @@
                 if (!keypad.isClicked)
                 {
                     buttonFram.GetImageButton().Alpha = 0.5f;
-                    buttonFram.GetNameButton().TextColor = AksCommonMethod.unBackgroundColor;
+                    buttonFram.GetNameButton().TextColor = unBackgroundColor;
                     buttonFram.SetClick(false);
                 }
                 buttonFram.SetClickListener((fl, btnIcon, btnName) =>
@@ -291,7 +291,7 @@
                 //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹�
                 if (!keypad.isClicked)
                 {
-                    button.TextColor = AksCommonMethod.unBackgroundColor;
+                    button.TextColor =unBackgroundColor;
 
                 }
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs
index e50215b..cd0e976 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs
@@ -18,8 +18,8 @@
         {
             this.mIsClick = isClick;
         }
-        private uint UpBackgroundColor = MusicColor.ViewColor;
-        private uint DownBackgroundColor = AksCommonMethod.seleBackgroundColor;
+        private uint UpBackgroundColor =BaseFramLayout.unParentBackgroundColor;
+        private uint DownBackgroundColor =BaseFramLayout.seleBackgroundColor;
 
         /// <summary>
         /// 澶氫釜绫诲瀷瀹瑰櫒
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs
index aa7ac69..bd98ba4 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs
@@ -10,6 +10,8 @@
         /// 鏄惁鍙互鐐瑰嚮
         /// </summary>
         private bool mIsClick = true;
+        private uint UpBackgroundColor = BaseFramLayout.unParentBackgroundColor;
+        private uint DownBackgroundColor = BaseFramLayout.seleBackgroundColor;
 
         /// <summary>
         /// 璁剧疆鎺у埗鐐瑰嚮浜嬩欢
@@ -19,8 +21,7 @@
         {
             this.mIsClick = isClick;
         }
-        private uint UpBackgroundColor = MusicColor.ViewColor;
-        private uint DownBackgroundColor = AksCommonMethod.seleBackgroundColor;
+       
         /// <summary>
         /// 鍗曚釜绫诲瀷瀹瑰櫒
         /// </summary>
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs
index 9baec70..e246608 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs
@@ -108,8 +108,8 @@
             //寮�鍏�
             switchBtn.MouseUpEventHandler += (senser, e) =>
             {
-                switchBtn.IsSelected = false;
                 KeyControl("on_off", "寮�/鍏�");
+                this.SetButtonIsSelected(switchBtn);
             };
             //淇℃伅
             xinxiFL.SetClickListener(() =>
@@ -239,15 +239,16 @@
             //宸�
             btnLeft.MouseUpEventHandler += (sender, e) =>
             {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
+               
                 KeyControl("key_left", "宸�");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_left_selected.png", "AksIcon/ykq_ok.png");
 
             };
             //涓�
             btnShang.MouseUpEventHandler += (sender, e) =>
             {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
                 KeyControl("key_up", "涓�");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_shang_selected.png", "AksIcon/ykq_ok.png");
 
             };
 
@@ -255,48 +256,50 @@
             btnRight.MouseDownEventHandler += (sender, e) =>
             {
 
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
+           
                 KeyControl("key_right", "鍙�");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_right_selected.png", "AksIcon/ykq_ok.png");
 
             };
 
             //涓�
             btnXia.MouseUpEventHandler += (sender, e) =>
             {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
+               
 
                 KeyControl("key_down", "涓�");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_xia_selected.png", "AksIcon/ykq_ok.png");
             };
             //OK
             btnOk.MouseDownEventHandler += (sender, e) =>
             {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
 
                 KeyControl("key_ok", "纭畾");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_ok_selected.png", "AksIcon/ykq_ok.png");
             };
             //闊抽噺+
             btnYingliangjia.MouseUpEventHandler += (sen, e) =>
             {
-                btnYingliangjia.IsSelected = false;
                 KeyControl("volume_up", "闊抽噺+");
+                this.SetButtonIsSelected(btnYingliangjia);
             };
             //闊抽噺-
             btnYingliangjian.MouseUpEventHandler += (sen, e) =>
             {
-                btnYingliangjian.IsSelected = false;
                 KeyControl("volume_down", "闊抽噺-");
+                this.SetButtonIsSelected(btnYingliangjian);
             };
             //棰戦亾+
             btnPindaojia.MouseUpEventHandler += (sen, e) =>
             {
-                btnPindaojia.IsSelected = false;
                 KeyControl("ch_up", "棰戦亾+");
+                this.SetButtonIsSelected(btnPindaojia);
             };
             //棰戦亾-
             btnPindaojian.MouseUpEventHandler += (sen, e) =>
             {
-                btnPindaojian.IsSelected = false;
                 KeyControl("ch_down", "棰戦亾-");
+                this.SetButtonIsSelected(btnPindaojian);
             };
 
             //鑿滃崟
@@ -776,15 +779,7 @@
                 SelectedImagePath = "AksIcon/ykq_yingliangjia_selected.png",
             };
             baseFl.AddChidren(btnYingliangjia);
-            btnYingliangjia.MouseDownEventHandler += (sen, e) =>
-            {
-                btnYingliangjia.IsSelected = true;
-            };
-            btnYingliangjia.MouseUpOutsideEventHandler += (sen, e) =>
-            {
-
-                btnYingliangjia.IsSelected = false;
-            };
+           
 
 
             btnYingliangjian = new Button
@@ -797,17 +792,7 @@
                 SelectedImagePath = "AksIcon/ykq_yingliangjian_selected.png",
             };
             baseFl.AddChidren(btnYingliangjian);
-            btnYingliangjian.MouseDownEventHandler += (sen, e) =>
-            {
-
-                btnYingliangjian.IsSelected = true;
-            };
-            btnYingliangjian.MouseUpOutsideEventHandler += (sen, e) =>
-            {
-
-                btnYingliangjian.IsSelected = false;
-            };
-
+            
 
 
             btnPindaojia = new Button
@@ -820,16 +805,7 @@
                 SelectedImagePath = "AksIcon/ykq_pindaojia_selected.png",
             };
             baseFl.AddChidren(btnPindaojia);
-            btnPindaojia.MouseDownEventHandler += (sen, e) =>
-            {
-
-                btnPindaojia.IsSelected = true;
-            };
-            btnPindaojia.MouseUpOutsideEventHandler += (sen, e) =>
-            {
-
-                btnPindaojia.IsSelected = false;
-            };
+           
 
 
             btnPindaojian = new Button
@@ -842,17 +818,7 @@
                 SelectedImagePath = "AksIcon/ykq_pindaojian_selected.png",
             };
             baseFl.AddChidren(btnPindaojian);
-            btnPindaojian.MouseDownEventHandler += (sen, e) =>
-            {
-
-                btnPindaojian.IsSelected = true;
-            };
-
-            btnPindaojian.MouseUpOutsideEventHandler += (sen, e) =>
-            {
-
-                btnPindaojian.IsSelected = false;
-            };
+           
 
 
 
@@ -914,67 +880,6 @@
                 Gravity = Gravity.Center,
             };
             okFl.AddChidren(btnOk);
-
-
-
-
-
-            btnLeft.MouseUpOutsideEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-            btnLeft.MouseDownEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_left_selected.png";
-
-            };
-            btnShang.MouseDownEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_shang_selected.png";
-
-
-            };
-            btnShang.MouseUpOutsideEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-            btnRight.MouseDownEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_right_selected.png";
-
-            };
-            btnRight.MouseUpOutsideEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-
-            btnXia.MouseDownEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_xia_selected.png";
-
-            };
-
-            btnXia.MouseUpOutsideEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-            btnOk.MouseDownEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok_selected.png";
-
-            };
-            btnOk.MouseUpOutsideEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-
-
-
 
             #endregion
 
@@ -1225,7 +1130,7 @@
     /// <summary>
     /// 鑷繁寮勪竴涓狥rameLayout
     /// </summary>
-    class CustomFrameLayout : FrameLayout
+    class CustomFrameLayout : BaseFramLayout
     {
         public const int widthFrameLayout = 36;
         public const int heightFrameLayout = 49 - 6;
@@ -1330,35 +1235,31 @@
         /// <param name="action">鍥炶皟(鐖剁被瀵硅薄)</param>
         public void SetClickListener(Action action)
         {
-            clickFl.MouseDownEventHandler += (sender, e) =>
+            clickFl.MouseUpEventHandler += (sender, e) =>
             {
-                //this.BackgroundColor = 0xff798394;
+                action?.Invoke();
+                //鎸変笅鍘绘敼鍙樿儗鏅鑹�
                 btnImage.IsSelected = true;
                 btnText.IsSelected = true;
                 btnNumber.IsSelected = true;
                 btn.IsSelected = true;
-
-
+                new System.Threading.Thread(() =>
+                {
+                    System.Threading.Thread.Sleep(millisecondsTimeout);
+                    Application.RunOnMainThread(() =>
+                    {
+                        //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                        btnImage.IsSelected = false;
+                        btnText.IsSelected = false;
+                        btnNumber.IsSelected = false;
+                        btn.IsSelected = false;
+                    });
+                })
+                { IsBackground = true }.Start();
+              
             };
 
-            clickFl.MouseUpEventHandler += (sender, e) =>
-            {
-                //this.BackgroundColor = 0x00000000;
-                btnImage.IsSelected = false;
-                btnText.IsSelected = false;
-                btnNumber.IsSelected = false;
-                btn.IsSelected = false;
-                action?.Invoke();
-            };
-
-            clickFl.MouseUpOutsideEventHandler += (sender, e) =>
-            {
-                //this.BackgroundColor = 0x00000000;
-                btnImage.IsSelected = false;
-                btnText.IsSelected = false;
-                btnNumber.IsSelected = false;
-                btn.IsSelected = false;
-            };
+            
 
         }
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
index 2fb6578..45d58cf 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
@@ -178,17 +178,17 @@
 
             });
             //闊抽噺+
-            btn_jia.MouseDownEventHandler += (sender, e) =>
+            btn_jia.MouseUpEventHandler += (sender, e) =>
             {
-                btn_jia.IsSelected = true;
                 ControlCommand(HisenseTVFunctionalAttributeConstant.volume_add, "");
+                this.SetButtonIsSelected(btn_jia);
 
             };
             //闊抽噺-
-            btn_jian.MouseDownEventHandler += (sender, e) =>
+            btn_jian.MouseUpEventHandler += (sender, e) =>
             {
-                btn_jian.IsSelected = true;
                 ControlCommand(HisenseTVFunctionalAttributeConstant.volume_subtract, "");
+                this.SetButtonIsSelected(btn_jian);
             };
             //鑿滃崟
             caidanBtn.SetClickListener((btn) =>
@@ -302,7 +302,7 @@
                     return;
                 }
 
-                if (!this.device.online&& key!= HisenseTVFunctionalAttributeConstant.wol)
+                if (!this.device.online && key != HisenseTVFunctionalAttributeConstant.wol)
                 {
                     //璁惧涓嶅湪绾挎帶鍒跺け璐�
                     Application.RunOnMainThread(() =>
@@ -499,16 +499,6 @@
 
             };
             yinliangFL.AddChidren(btn_jian);
-            btn_jia.MouseUpEventHandler += (sender, e) =>
-            {
-                btn_jia.IsSelected = false;
-
-            };
-            btn_jian.MouseUpEventHandler += (sender, e) =>
-            {
-
-                btn_jian.IsSelected = false;
-            };
 
             caidanBtn = new CustomButton();
             caidanBtn.TextID = StringId.caidan;
@@ -656,7 +646,7 @@
     /// <summary>
     /// 鑷畾涔夛紙棣栭〉锛屽叧鏈猴紝鑿滃崟锛夊鍣�
     /// </summary>
-    class CustomFrameLayout : FrameLayout
+    class CustomFrameLayout : BaseFramLayout
     {
         public const int widthFrameLayout = 68;
         public const int heightFrameLayout = 68 + 8 + 20;
@@ -714,21 +704,11 @@
         /// <param name="button2">娉ㄦ剰:鍦⊿etClickListener()鍓嶉潰璋冪敤AddImageView()鎵嶆湁鏁�</param>
         public void SetClickListener(Action<FrameLayout, Button, Button> action)
         {
-            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
-            {
-                btnImage.IsSelected = true;
-                //btnText.IsSelected = true;
-                action?.Invoke(this, btnImage, btnText);
-            };
-            this.MouseDownEventHandler += DownClick;
-            btnImage.MouseDownEventHandler += DownClick;
-            btnText.MouseDownEventHandler += DownClick;
-
 
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
              {
-                 btnImage.IsSelected = false;
-                 //btnText.IsSelected = false;
+                 action?.Invoke(this, btnImage, btnText);
+                 SetButtonIsSelected(btnImage);
              };
             this.MouseUpEventHandler += UpClick;
             btnImage.MouseUpEventHandler += UpClick;
@@ -766,19 +746,12 @@
         /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄</param>
         public void SetClickListener(Action<Button> action)
         {
-            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
-            {
-                //this.BackgroundColor = 0xFFF2F3F7;
-                this.IsSelected = true;
-                action?.Invoke(this);
-            };
-            this.MouseDownEventHandler += DownClick;
-
-
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
             {
-                //this.BackgroundColor = 0xffECEDEE;
-                this.IsSelected = false;
+                
+                action?.Invoke(this);
+                new BaseFramLayout().SetButtonIsSelected(this);
+
             };
             this.MouseUpEventHandler += UpClick;
 

--
Gitblit v1.8.0