From 3f6685c77beeb12baf840733fb890860f4c26e7c Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 25 七月 2024 17:25:59 +0800
Subject: [PATCH] 2024年07月25日17:24:45

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs |  195 +++++++++++++++++++++---------------------------
 1 files changed, 86 insertions(+), 109 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs
index 5e49151..e246608 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs
@@ -35,7 +35,7 @@
         /// <summary>
         /// 鍒囨崲璁惧瀹瑰櫒
         /// </summary>
-        TypeMultiFramLayout typeMultiFramLayout; 
+        TypeMultiFramLayout typeMultiFramLayout;
         TypeSingleFramLayout tyySingleFramLayout;
 
         Button switchBtn;
@@ -106,10 +106,10 @@
         private void EventListener()
         {
             //寮�鍏�
-            switchBtn.MouseDownEventHandler += (senser, e) =>
+            switchBtn.MouseUpEventHandler += (senser, e) =>
             {
-                switchBtn.IsSelected = true;
                 KeyControl("on_off", "寮�/鍏�");
+                this.SetButtonIsSelected(switchBtn);
             };
             //淇℃伅
             xinxiFL.SetClickListener(() =>
@@ -154,7 +154,7 @@
             //1
             number1FL.SetClickListener(() =>
             {
-                 KeyControl("number_1", "1");
+                KeyControl("number_1", "1");
             });
             //2
             number2FL.SetClickListener(() =>
@@ -237,59 +237,69 @@
 
             });
             //宸�
-            btnLeft.MouseDownEventHandler += (sender, e) =>
+            btnLeft.MouseUpEventHandler += (sender, e) =>
             {
-                okFl.BackgroundImagePath = "AksIcon/ykq_left_selected.png";
+               
                 KeyControl("key_left", "宸�");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_left_selected.png", "AksIcon/ykq_ok.png");
 
             };
             //涓�
-            btnShang.MouseDownEventHandler += (sender, e) => 
+            btnShang.MouseUpEventHandler += (sender, e) =>
             {
-                okFl.BackgroundImagePath = "AksIcon/ykq_shang_selected.png";
                 KeyControl("key_up", "涓�");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_shang_selected.png", "AksIcon/ykq_ok.png");
 
             };
 
             //鍙�
             btnRight.MouseDownEventHandler += (sender, e) =>
             {
-                okFl.BackgroundImagePath = "AksIcon/ykq_right_selected.png";
+
+           
                 KeyControl("key_right", "鍙�");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_right_selected.png", "AksIcon/ykq_ok.png");
 
             };
 
             //涓�
-            btnXia.MouseDownEventHandler += (sender, e) =>
+            btnXia.MouseUpEventHandler += (sender, e) =>
             {
-                okFl.BackgroundImagePath = "AksIcon/ykq_xia_selected.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_selected.png";
+
                 KeyControl("key_ok", "纭畾");
+                this.SetHighlightImagePath(okFl, "AksIcon/ykq_ok_selected.png", "AksIcon/ykq_ok.png");
             };
             //闊抽噺+
-            btnYingliangjia.MouseDownEventHandler += (sen, e) => {
-                btnYingliangjia.IsSelected = true;
+            btnYingliangjia.MouseUpEventHandler += (sen, e) =>
+            {
                 KeyControl("volume_up", "闊抽噺+");
+                this.SetButtonIsSelected(btnYingliangjia);
             };
             //闊抽噺-
-            btnYingliangjian.MouseDownEventHandler += (sen, e) => {
-                btnYingliangjian.IsSelected = true;
+            btnYingliangjian.MouseUpEventHandler += (sen, e) =>
+            {
                 KeyControl("volume_down", "闊抽噺-");
+                this.SetButtonIsSelected(btnYingliangjian);
             };
             //棰戦亾+
-            btnPindaojia.MouseDownEventHandler += (sen, e) => {
-                btnPindaojia.IsSelected = true;
+            btnPindaojia.MouseUpEventHandler += (sen, e) =>
+            {
                 KeyControl("ch_up", "棰戦亾+");
+                this.SetButtonIsSelected(btnPindaojia);
             };
             //棰戦亾-
-            btnPindaojian.MouseDownEventHandler += (sen, e) => {
-                btnPindaojian.IsSelected = true;
+            btnPindaojian.MouseUpEventHandler += (sen, e) =>
+            {
                 KeyControl("ch_down", "棰戦亾-");
+                this.SetButtonIsSelected(btnPindaojian);
             };
 
             //鑿滃崟
@@ -301,7 +311,7 @@
             //杩斿洖
             fanhuiFL.SetClickListener(() =>
             {
-                KeyControl("return", "杩斿洖");
+                KeyControl("cancel", "杩斿洖");
 
             });
             //涓婁竴閮�
@@ -372,8 +382,10 @@
                     action?.Invoke(IntType.Control);
                 });
             }
-            if (tyySingleFramLayout!=null) {
-                tyySingleFramLayout.SetClickListener((f) => {
+            if (tyySingleFramLayout != null)
+            {
+                tyySingleFramLayout.SetClickListener((f) =>
+                {
                     action?.Invoke(IntType.Control);
                 });
             }
@@ -394,7 +406,7 @@
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = MusicColor.TextColor,
                 TextSize = TextSize.Text16,
-                Text= this.remoteControl.name,
+                Text = this.remoteControl.name,
                 IsBold = true,
             };
             this.AddChidren(btnTitle);
@@ -404,7 +416,7 @@
             {
                 Y = btnTitle.Bottom + Application.GetRealHeight(16),
                 Width = Application.GetRealWidth(240),
-                Height = Application.GetRealHeight(1095-122),//閬ユ帶鍣ㄥ浐瀹氶珮搴�
+                Height = Application.GetRealHeight(1095 - 122 - 60),//閬ユ帶鍣ㄥ浐瀹氶珮搴�
                 Radius = (uint)Application.GetRealHeight(17),
                 BackgroundColor = 0xff798394,
                 Gravity = Gravity.CenterHorizontal,
@@ -417,7 +429,7 @@
                 Y = btnTitle.Bottom + Application.GetRealHeight(16),
                 //X = Application.GetRealWidth(71),
                 Width = Application.GetRealWidth(232),
-                Height = Application.GetRealHeight(1095-122),//閬ユ帶鍣ㄥ浐瀹氶珮搴�
+                Height = Application.GetRealHeight(1095 - 122 - 60),//閬ユ帶鍣ㄥ浐瀹氶珮搴�
                 Radius = (uint)Application.GetRealHeight(17),
                 BackgroundColor = 0xff19181E,
                 Gravity = Gravity.CenterHorizontal,
@@ -440,19 +452,23 @@
 
             switchBtn = new Button
             {
-                Height = Application.GetRealWidth(32),
-                Width = Application.GetRealWidth(32),
+                Height = Application.GetRealWidth(48),
+                Width = Application.GetRealWidth(48),
                 Gravity = Gravity.Center,
                 UnSelectedImagePath = "AksIcon/ykq_kai.png",
-                SelectedImagePath= "AksIcon/ykq_kaiguang_selected.png"
+                SelectedImagePath = "AksIcon/ykq_kaiguang_selected.png"
             };
             switchFl.AddChidren(switchBtn);
-            switchBtn.MouseUpEventHandler += (senser, e) =>
+            switchBtn.MouseDownEventHandler += (senser, e) =>
+            {
+                switchBtn.IsSelected = true;
+            };
+            switchBtn.MouseUpOutsideEventHandler += (senser, e) =>
             {
                 switchBtn.IsSelected = false;
             };
 
-            int h = 49-6;
+            int h = 49 - 6;
             int offset = 28;//x杞村亸绉婚噺
             int septal = 36;//闂撮殧
             #region
@@ -748,7 +764,7 @@
             var baseFl = new BaseFramLayout
             {
                 Y = line8Fl.Bottom,
-                Height = Application.GetRealHeight(207-32-12),
+                Height = Application.GetRealHeight(207 - 32 - 12),
             };
             layout.AddChidren(baseFl);
 
@@ -763,10 +779,7 @@
                 SelectedImagePath = "AksIcon/ykq_yingliangjia_selected.png",
             };
             baseFl.AddChidren(btnYingliangjia);
-            btnYingliangjia.MouseUpEventHandler += (sen,e) => {
-
-                btnYingliangjia.IsSelected = false;
-            };
+           
 
 
             btnYingliangjian = new Button
@@ -779,14 +792,10 @@
                 SelectedImagePath = "AksIcon/ykq_yingliangjian_selected.png",
             };
             baseFl.AddChidren(btnYingliangjian);
-            btnYingliangjian.MouseUpEventHandler += (sen, e) => {
-
-                btnYingliangjian.IsSelected = false;
-            };
+            
 
 
-
-            btnPindaojia = new Button 
+            btnPindaojia = new Button
             {
                 Y = Application.GetRealHeight(16),
                 X = Application.GetRealWidth(170),
@@ -796,10 +805,7 @@
                 SelectedImagePath = "AksIcon/ykq_pindaojia_selected.png",
             };
             baseFl.AddChidren(btnPindaojia);
-            btnPindaojia.MouseUpEventHandler += (sen, e) => {
-
-                btnPindaojia.IsSelected = false;
-            };
+           
 
 
             btnPindaojian = new Button
@@ -812,10 +818,7 @@
                 SelectedImagePath = "AksIcon/ykq_pindaojian_selected.png",
             };
             baseFl.AddChidren(btnPindaojian);
-            btnPindaojian.MouseUpEventHandler += (sen, e) => {
-
-                btnPindaojian.IsSelected = false;
-            };
+           
 
 
 
@@ -877,37 +880,6 @@
                 Gravity = Gravity.Center,
             };
             okFl.AddChidren(btnOk);
-
-
-
-            btnLeft.MouseUpEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-            btnShang.MouseUpEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-            btnRight.MouseUpEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-            btnXia.MouseUpEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-            btnOk.MouseUpEventHandler += (sender, e) =>
-            {
-                okFl.BackgroundImagePath = "AksIcon/ykq_ok.png";
-
-            };
-
-
-
 
             #endregion
 
@@ -1050,7 +1022,7 @@
             dengguanFL.AddTextButtonView();
             dengguanFL.GetImageButton().UnSelectedImagePath = "AksIcon/ykq_dengguan.png";
             dengguanFL.GetImageButton().SelectedImagePath = "AksIcon/ykq_dengguang_selected.png";
-            dengguanFL.GetTextButton().Text = "鐏叧";
+            dengguanFL.GetTextButton().Text = "鐏厜1";
             dengguanFL.AddClickView();
 
 
@@ -1073,7 +1045,7 @@
             dankongdengFL.AddTextButtonView();
             dankongdengFL.GetImageButton().UnSelectedImagePath = "AksIcon/ykq_dankongdeng.png";
             dankongdengFL.GetImageButton().SelectedImagePath = "AksIcon/ykq_dankongdeng_selected.png";
-            dankongdengFL.GetTextButton().Text = "鍗曟帶鐏�";
+            dankongdengFL.GetTextButton().Text = "鐏厜2";
             dankongdengFL.AddClickView();
 
             #endregion
@@ -1107,13 +1079,11 @@
                 tyySingleFramLayout.btnRightImage.Gravity = Gravity.CenterVertical;
                 tyySingleFramLayout.btnLeftImage.Visible = false;
 
-                if (tyySingleFramLayout.btnName.GetTextWidth() > Application.GetRealWidth(48))
-                {
-                    tyySingleFramLayout.singleFramLayout.Width = Application.GetRealWidth(101  - 48) + tyySingleFramLayout.btnName.GetTextWidth();
-                    tyySingleFramLayout.singleFramLayout.X = Application.GetRealWidth(226 + 48) - tyySingleFramLayout.btnName.GetTextWidth();
-                    tyySingleFramLayout.btnName.Width =tyySingleFramLayout.btnName.GetTextWidth();
-                    tyySingleFramLayout.btnRightImage.X = tyySingleFramLayout.btnName.Right + Application.GetRealWidth(8);
-                } 
+                tyySingleFramLayout.CustomCalculationWidth(TypeSingleFramLayout.Orientation.right,
+                  tyySingleFramLayout.singleFramLayout,
+                  tyySingleFramLayout.btnName,
+                   tyySingleFramLayout.btnRightImage,
+                   48, 200);
 
             }
             else
@@ -1122,7 +1092,7 @@
                 typeMultiFramLayout = new TypeMultiFramLayout();
                 typeMultiFramLayout.multiFramLayout.Y = Application.GetRealHeight(16);
                 typeMultiFramLayout.AddView(cornerBottomFram);
-                typeMultiFramLayout.btnBottonRightName.Text = this.remoteControl.name;
+                typeMultiFramLayout.btnRightName.Text = this.remoteControl.name;
             }
 
             this.AdjustRealHeight(16);
@@ -1133,14 +1103,15 @@
         /// </summary>
         /// <param name="keypad"><鎸夐敭鏍囪瘑/param>
         /// <param name="keyName"><鎸夐敭鍚嶇О(鎵撳嵃鐢ㄧ殑)/param>
-        private void KeyControl(string keypad, string keyName)
+
+        private void KeyControl(string keypad, string keyName, bool isSupport = true)
         {
             //CommonMethod.Current.Loading.Start();
             CommonMethod.Current.SunThread(() =>
             {
                 try
                 {
-                    SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName);
+                    SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName, isSupport);
                 }
                 catch { }
                 finally
@@ -1159,10 +1130,10 @@
     /// <summary>
     /// 鑷繁寮勪竴涓狥rameLayout
     /// </summary>
-    class CustomFrameLayout : FrameLayout
+    class CustomFrameLayout : BaseFramLayout
     {
         public const int widthFrameLayout = 36;
-        public const int heightFrameLayout = 49-6;
+        public const int heightFrameLayout = 49 - 6;
         public CustomFrameLayout(int width = widthFrameLayout, int height = heightFrameLayout)
         {
             this.Width = Application.GetRealWidth(width);
@@ -1184,7 +1155,7 @@
             SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
             TextAlignment = TextAlignment.Center,
             Gravity = Gravity.CenterHorizontal,
-            Padding=new Padding(0,0,0,0),
+            Padding = new Padding(0, 0, 0, 0),
         };
         Button btnNumber = new Button
         {
@@ -1203,7 +1174,7 @@
             Height = Application.GetRealWidth(12),
             Gravity = Gravity.Center,
             Radius = (uint)Application.GetRealWidth(6),
-            BackgroundColor=0x00000000,
+            BackgroundColor = 0x00000000,
             SelectedBackgroundColor = 0xFFF2F3F7,
         };
 
@@ -1264,25 +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;
-
-                action?.Invoke();
+                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;
-            };
+            
 
         }
 

--
Gitblit v1.8.0