From e4f7080639ee8cbc71172e5202f953924cedc074 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 12 十月 2023 16:37:40 +0800
Subject: [PATCH] 2023年10月12日16:37:10

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs |   72 ++++++++++++++++++++++++++++++-----
 1 files changed, 61 insertions(+), 11 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs
index ececc69..e5bb27a 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs
@@ -12,6 +12,15 @@
     /// </summary>
     public class AksCommonMethod
     {
+        /// <summary>
+        /// 閫変腑棰滆壊
+        /// </summary>
+        public const uint seleBackgroundColor = 0xFFF2F3F7;
+        /// <summary>
+        /// 涓嶆敮鎸佹寜閿鑹�
+        /// </summary>
+        public const uint unBackgroundColor = 0xFFA3AAB7;
+
         private static AksCommonMethod commonMethod = null;
         /// <summary>
         /// 鑾峰彇瀵硅薄
@@ -33,7 +42,8 @@
         /// <summary>
         /// 娓呯┖鎵�鏈夌紦瀛樻暟鎹�
         /// </summary>
-        public void ClearData() {
+        public void ClearData()
+        {
             movieLibraryInfoEntities.Clear();
             CollectList.Clear();
         }
@@ -138,7 +148,7 @@
             {
                 return false;
             }
-            if ( string.IsNullOrEmpty(movieLibrary.movieId))
+            if (string.IsNullOrEmpty(movieLibrary.movieId))
             {
                 return false;
             }
@@ -156,7 +166,7 @@
         }
 
 
-      
+
 
         /// <summary>
         /// 鑾峰彇褰遍煶涓帶灞忓垪琛�
@@ -177,7 +187,7 @@
         /// 鑾峰彇銆愰煶涔愩�戦仴鎺у櫒鎸夐敭鍒楄〃
         /// </summary>
         /// <returns></returns>
-        public List<KeypadEntity> GetMusicKeypadList()
+        public List<KeypadEntity> GetMusicKeypadList(RemoteControlEntity remoteControlEntity)
         {
             List<KeypadEntity> keypads = new List<KeypadEntity>();
             string aksIcon = "AksIcon/";
@@ -203,13 +213,14 @@
             //keypads.Add(new KeypadEntity { keypad = "key_left", name = "宸�", localIconAddress = $"{aksIcon}zuo.png" });
             //keypads.Add(new KeypadEntity { keypad = "key_right", name = "鍙�", localIconAddress = $"{aksIcon}you.png" });
             //keypads.Add(new KeypadEntity { keypad = "key_ok", name = "纭", localIconAddress = $"{aksIcon}ok.png" });
+            this.CheckKeyIsClick(remoteControlEntity, keypads);
             return keypads;
         }
         /// <summary>
         /// 鑾峰彇銆愬姛鏀俱�戦仴鎺у櫒鎸夐敭鍒楄〃
         /// </summary>
         /// <returns></returns>
-        public List<KeypadEntity> GetGFKeypadList()
+        public List<KeypadEntity> GetGFKeypadList(RemoteControlEntity remoteControlEntity)
         {
             List<KeypadEntity> keypads = new List<KeypadEntity>();
             string aksIcon = "AksIcon/";
@@ -225,6 +236,7 @@
             keypads.Add(new KeypadEntity { keypad = "custom_2", name = "鑷畾涔夋寜閿�2", localIconAddress = $"{aksIcon}zdyanjian.png" });
             keypads.Add(new KeypadEntity { keypad = "custom_3", name = "鑷畾涔夋寜閿�3", localIconAddress = $"{aksIcon}zdyanjian.png" });
             keypads.Add(new KeypadEntity { keypad = "custom_4", name = "鑷畾涔夋寜閿�4", localIconAddress = $"{aksIcon}zdyanjian.png" });
+            this.CheckKeyIsClick(remoteControlEntity, keypads);
             return keypads;
         }
 
@@ -232,7 +244,7 @@
         /// 鑾峰彇銆愭姇褰变华銆戦仴鎺у櫒鎸夐敭鍒楄〃
         /// </summary>
         /// <returns></returns>
-        public List<KeypadEntity> GetTYYKeypadList()
+        public List<KeypadEntity> GetTYYKeypadList(RemoteControlEntity remoteControlEntity)
         {
             List<KeypadEntity> keypads = new List<KeypadEntity>();
             string aksIcon = "AksIcon/";
@@ -253,6 +265,7 @@
             keypads.Add(new KeypadEntity { keypad = "custom_2", name = "鑷畾涔夋寜閿�2", localIconAddress = $"{aksIcon}zdyanjian.png" });
             keypads.Add(new KeypadEntity { keypad = "custom_3", name = "鑷畾涔夋寜閿�3", localIconAddress = $"{aksIcon}zdyanjian.png" });
             keypads.Add(new KeypadEntity { keypad = "custom_4", name = "鑷畾涔夋寜閿�4", localIconAddress = $"{aksIcon}zdyanjian.png" });
+            this.CheckKeyIsClick(remoteControlEntity, keypads);
             return keypads;
         }
 
@@ -261,7 +274,7 @@
         /// 鑾峰彇銆愮數瑙嗐�戦仴鎺у櫒鎸夐敭鍒楄〃
         /// </summary>
         /// <returns></returns>
-        public List<KeypadEntity> GetTvKeypadList()
+        public List<KeypadEntity> GetTvKeypadList(RemoteControlEntity remoteControlEntity)
         {
             List<KeypadEntity> keypads = new List<KeypadEntity>();
             string aksIcon = "AksIcon/";
@@ -279,8 +292,9 @@
             keypads.Add(new KeypadEntity { keypad = "custom_2", name = "鑷畾涔夋寜閿�2", localIconAddress = $"{aksIcon}zdyanjian.png" });
             keypads.Add(new KeypadEntity { keypad = "custom_3", name = "鑷畾涔夋寜閿�3", localIconAddress = $"{aksIcon}zdyanjian.png" });
             keypads.Add(new KeypadEntity { keypad = "custom_4", name = "鑷畾涔夋寜閿�4", localIconAddress = $"{aksIcon}zdyanjian.png" });
+            this.CheckKeyIsClick(remoteControlEntity, keypads);
             return keypads;
-      
+
         }
 
 
@@ -288,7 +302,7 @@
         /// 鑾峰彇銆愭満椤剁洅銆戦仴鎺у櫒鎸夐敭鍒楄〃
         /// </summary>
         /// <returns></returns>
-        public List<KeypadEntity> GetJdhKeypadList()
+        public List<KeypadEntity> GetJdhKeypadList(RemoteControlEntity remoteControlEntity)
         {
             List<KeypadEntity> keypads = new List<KeypadEntity>();
             string aksIcon = "AksIcon/";
@@ -306,6 +320,7 @@
             keypads.Add(new KeypadEntity { keypad = "custom_2", name = "鑷畾涔夋寜閿�2", localIconAddress = $"{aksIcon}zdyanjian.png" });
             keypads.Add(new KeypadEntity { keypad = "custom_3", name = "鑷畾涔夋寜閿�3", localIconAddress = $"{aksIcon}zdyanjian.png" });
             keypads.Add(new KeypadEntity { keypad = "custom_4", name = "鑷畾涔夋寜閿�4", localIconAddress = $"{aksIcon}zdyanjian.png" });
+            this.CheckKeyIsClick(remoteControlEntity, keypads);
             return keypads;
 
         }
@@ -315,7 +330,7 @@
         /// 鑾峰彇銆愭暟瀛椼�戞寜閿垪琛�
         /// </summary>
         /// <returns></returns>
-        public List<KeypadEntity> GetNumberKeypadList()
+        public List<KeypadEntity> GetNumberKeypadList(RemoteControlEntity remoteControlEntity)
         {
             List<KeypadEntity> keypads = new List<KeypadEntity>();
             keypads.Add(new KeypadEntity { keypad = "number_1", name = "1" });
@@ -332,6 +347,7 @@
             keypads.Add(new KeypadEntity { keypad = "number_continuous", name = "-/--" });
             keypads.Add(new KeypadEntity { keypad = "none", name = "" });//杩欎釜鏄负浜嗗崰浣嶇疆
             keypads.Add(new KeypadEntity { keypad = "number_0", name = "0" });
+            this.CheckKeyIsClick(remoteControlEntity, keypads);
             return keypads;
         }
 
@@ -339,7 +355,7 @@
         /// 鑾峰彇銆愯彍鍗曘�戞寜閿垪琛�
         /// </summary>
         /// <returns></returns>
-        public List<KeypadEntity> GetMenuKeypadList()
+        public List<KeypadEntity> GetMenuKeypadList(RemoteControlEntity remoteControlEntity)
         {
             List<KeypadEntity> keypads = new List<KeypadEntity>();
             string aksIcon = "AksIcon/";
@@ -348,8 +364,42 @@
             keypads.Add(new KeypadEntity { keypad = "key_left", name = "宸�", localIconAddress = $"{aksIcon}zuo.png" });
             keypads.Add(new KeypadEntity { keypad = "key_right", name = "鍙�", localIconAddress = $"{aksIcon}you.png" });
             keypads.Add(new KeypadEntity { keypad = "key_ok", name = "纭", localIconAddress = $"{aksIcon}ok.png" });
+            this.CheckKeyIsClick(remoteControlEntity, keypads);
             return keypads;
         }
 
+        /// <summary>
+        /// 妫�鏌ユ槸鍚︽敮鎸佹寜閿偣鍑�
+        /// </summary>
+        /// <param name="remoteControlEntity">閬ユ帶鍣ㄨ澶�</param>
+        /// <param name="keypads">鑷畾涔夋寜閿垪琛�</param>
+        private void CheckKeyIsClick(RemoteControlEntity remoteControlEntity, List<KeypadEntity> keypads)
+        {
+            if (remoteControlEntity == null)
+            {
+                return;
+            }
+
+            for (int i = 0; i < keypads.Count; i++)
+            {
+                var keypad = keypads[i];
+                if (keypad.keypad == "none")
+                {
+                    //鐗规畩鐨�
+                    continue;
+                }
+                var findkeypad = remoteControlEntity.keypads.Find((o) => o.keypad == keypad.keypad);
+                if (findkeypad == null)
+                {
+                    keypad.isClicked = false;
+                }
+                else
+                {
+                    keypad.isClicked = true;
+                }
+            }
+
+        }
+
     }
 }

--
Gitblit v1.8.0