From 642fcdaeb496d9a8f3154e17fd76005be3fcf197 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 03 十二月 2019 12:00:24 +0800
Subject: [PATCH] 2019.12.3
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs | 133 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 133 insertions(+), 0 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs
new file mode 100755
index 0000000..c9f3365
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ClickButtonControls/BottomLeftClickButton.cs
@@ -0,0 +1,133 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 浣嶄簬宸︿笅瑙掔殑鍗曞嚮鎺т欢
+ /// </summary>
+ public class BottomLeftClickButton : FrameLayoutControl
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+#if Android
+ /// <summary>
+ /// 鎸夐挳(娌″垵濮嬪寲涔嬪墠,瀹冧负null)
+ /// </summary>
+ private NormalViewControl btnButton = null;
+ /// <summary>
+ /// 椤堕儴鍦嗚
+ /// </summary>
+ private NormalViewControl btnTopTemp = null;
+ /// <summary>
+ /// 宸︿笅瑙掑渾瑙�
+ /// </summary>
+ private NormalViewControl btnBomTemp = null;
+#endif
+#if iOS
+ /// <summary>
+ /// 鎸夐挳(娌″垵濮嬪寲涔嬪墠,瀹冧负null)
+ /// </summary>
+ private NormalClickButton btnButton = null;
+#endif
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 浣嶄簬宸︿笅瑙掔殑鍗曞嚮鎺т欢
+ /// </summary>
+ /// <param name="i_width">瀹藉害,鐪熷疄鍊�</param>
+ /// <param name="i_height">楂樺害,鐪熷疄鍊�</param>
+ /// <param name="i_radius">鍦嗚搴�(鍙瀹夊崜鏈夋晥)</param>
+ public BottomLeftClickButton(int i_width, int i_height, uint i_radius = 8)
+ {
+ this.Height = i_height;
+ this.Width = i_width;
+ this.Gravity = Gravity.BottomLeft;
+
+#if Android
+ this.Radius = i_radius;
+#endif
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨帶浠�
+ /// </summary>
+ /// <param name="i_text">鏂囨湰淇℃伅</param>
+ public void InitControl(string i_text)
+ {
+ uint i_backColor = 0xfff5f6fa;
+#if Android
+ this.BackgroundColor = i_backColor;
+ //鎶婁笂鍦嗚瑕嗙洊涓烘柟瑙�
+ this.btnTopTemp = new NormalViewControl(this.Width, Application.GetRealHeight(40), false);
+ btnTopTemp.BackgroundColor = i_backColor;
+ this.AddChidren(btnTopTemp, ChidrenBindMode.BindEventOnly);
+ //鎶婂彸涓嬪渾瑙掕鐩栦负鏂硅
+ this.btnBomTemp = new NormalViewControl(this.Width / 2, Application.GetRealHeight(40), false);
+ btnBomTemp.BackgroundColor = i_backColor;
+ btnBomTemp.Gravity = Gravity.BottomRight;
+ this.AddChidren(btnBomTemp, ChidrenBindMode.BindEventOnly);
+ //鍙栨秷鎸夐挳
+ this.btnButton = new NormalViewControl(this.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
+ btnButton.Gravity = Gravity.Center;
+ btnButton.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnButton.Text = i_text;
+ btnButton.TextAlignment = TextAlignment.Center;
+ btnButton.BackgroundColor = i_backColor;
+ this.AddChidren(btnButton, ChidrenBindMode.BindEventOnly);
+
+ //閲嶅啓鎺т欢鐐瑰嚮鐘舵��
+ this.SelectStatuEvent += (statu) =>
+ {
+ if (statu == true)
+ {
+ this.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
+ btnTopTemp.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
+ btnBomTemp.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
+ btnButton.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
+ }
+ else
+ {
+ this.BackgroundColor = i_backColor;
+ btnTopTemp.BackgroundColor = i_backColor;
+ btnBomTemp.BackgroundColor = i_backColor;
+ btnButton.BackgroundColor = i_backColor;
+ }
+ };
+#endif
+#if iOS
+ //鍙栨秷鎸夐挳
+ this.btnButton = new NormalClickButton(this.Width, this.Height, false);
+ btnButton.Gravity = Gravity.BottomLeft;
+ btnButton.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnButton.Text = i_text;
+ btnButton.TextAlignment = TextAlignment.Center;
+ btnButton.BackgroundColor = i_backColor;
+ btnButton.oldBackgroundColor = i_backColor;
+ this.AddChidren(btnButton, ChidrenBindMode.BindEventOnly);
+#endif
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 璁剧疆鎸夐挳鐨勬枃鏈俊鎭�
+ /// </summary>
+ /// <param name="txtValue"></param>
+ public void SetButtonText(string txtValue)
+ {
+ if (this.btnButton != null)
+ {
+ this.btnButton.Text = txtValue;
+ }
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0