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/CommonView/BaseFramLayout.cs |  124 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 122 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
index 505a6ef..704b7d7 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
@@ -2,11 +2,50 @@
 using Shared;
 namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
 {
-    public class BaseFramLayout:FrameLayout
+    public class BaseFramLayout : FrameLayout
     {
         public BaseFramLayout()
         {
         }
+        /// <summary>
+        /// 鏄惁鍙互鐐瑰嚮
+        /// </summary>
+        private bool mIsClick = true;
+
+        /// <summary>
+        /// 璁剧疆鎺у埗鐐瑰嚮浜嬩欢
+        /// </summary>
+        /// <param name="isClick">false鐐瑰嚮鏃犳晥</param>
+        public void SetClick(bool isClick)
+        {
+            this.mIsClick = isClick;
+        }
+        /// <summary>
+        /// 璁剧疆鎺у埗鐐瑰嚮浜嬩欢
+        /// </summary>
+        /// <param name="isClick">false鐐瑰嚮鏃犳晥</param>
+        public bool GetClick()
+        {
+            return this.mIsClick;
+        }
+
+        /// <summary>
+        /// 寤舵椂鏃堕棿ms
+        /// </summary>
+        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>
         /// 璋冩暣鐪熷疄楂樺害
@@ -48,7 +87,88 @@
             }
             return bottomHeight;
         }
+        /// <summary>
+        /// 璁剧疆楂樹寒棰滆壊(grb)
+        /// </summary>
+        /// <param name="seleColor">閫変腑棰滆壊鍊�</param>
+        /// <param name="unColor">鏈�変腑棰滆壊鍊�</param>
+        /// <param name="view">缁勪欢</param>
+        public void SetHighlightColor(View view, uint seleColor =seleBackgroundColor, uint unColor = 0x00000000) 
+        {
+            if (view == null)
+            {
+                return;
+            }
+            //鎸変笅鍘绘敼鍙樿儗鏅鑹�
+            view.BackgroundColor = seleColor;
+            new System.Threading.Thread(() =>
+            {
+                System.Threading.Thread.Sleep(millisecondsTimeout);
+                Application.RunOnMainThread(() =>
+                {
+                    //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                    view.BackgroundColor = unColor;
+                });
+            })
+            { IsBackground = true }.Start();
+
+        }
+
+        /// <summary>
+        /// 璁剧疆Button涓撶敤
+        /// </summary>
+        /// <param name="button">缁勪欢</param>
+        public void SetButtonIsSelected(Button button)
+        {
+            if (button == null)
+            {
+                return;
+            }
+            //鎸変笅鍘绘敼鍙樿儗鏅鑹�
+            button.IsSelected = true;
+            new System.Threading.Thread(() =>
+            {
+                System.Threading.Thread.Sleep(millisecondsTimeout);
+                Application.RunOnMainThread(() =>
+                {
+                    //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                    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();
+
+        }
+
+
+
     }
 
- 
+
 }

--
Gitblit v1.8.0