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 | 126 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 123 insertions(+), 3 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs index 1b0e233..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> /// 璋冩暣鐪熷疄楂樺害 @@ -34,7 +73,7 @@ /// 鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣 /// </summary> /// <returns></returns> - private int GetLocationMostLastViewBottom() + public int GetLocationMostLastViewBottom() { int bottomHeight = -1; @@ -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