From dc6493db59dcb0893eac50b72122f94c24056b3f Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 12 十月 2020 14:35:39 +0800
Subject: [PATCH] 新版本
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/DialogInputControl.cs | 112 ++++++++++----------------------------------------------
1 files changed, 20 insertions(+), 92 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/DialogInputControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/DialogInputControl.cs
index ee36947..8f534b8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/DialogInputControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/DialogInputControl.cs
@@ -36,11 +36,11 @@
/// <summary>
/// 鍙栨秷鎸夐挳
/// </summary>
- private NormalViewControl btnCancel = null;
+ private BottomLeftClickButton btnCancel = null;
/// <summary>
/// 纭鎸夐挳
/// </summary>
- private NormalViewControl btnConfirm = null;
+ private BottomRightClickButton btnConfirm = null;
#endregion
@@ -50,7 +50,8 @@
/// <para>鍋氭垚涓�涓脊绐楀瀷锛屽乏涓嬭鏄�愬彇娑堟寜閽�戯紝鍙充笅瑙掓槸銆愮‘璁ゆ寜閽�戠殑寮圭獥鎺т欢</para>
/// <para>New鐨勬椂鍊�,灏卞凡缁忓姞鍏ュ埌浜嗙晫闈�</para>
/// </summary>
- public DialogInputControl()
+ /// <param name="i_MaxByte">鏂囨湰妗嗘渶澶ц緭鍏ョ殑byte鏁�(榛樿36涓猙yte)</param>
+ public DialogInputControl(int i_MaxByte = 36)
{
//娣诲姞鐣岄潰
var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
@@ -68,7 +69,7 @@
frameBack.BackgroundColor = UserCenterColor.Current.White;
frameBack.Y = Application.GetRealHeight(691);
frameBack.Gravity = Gravity.CenterHorizontal;
- frameBack.Radius = 8;
+ frameBack.Radius = (uint)Application.GetRealHeight(17);
this.AddChidren(frameBack);
//鏍囬淇℃伅
this.btnTitle = new NormalViewControl(frameBack.Width, Application.GetRealHeight(65), false);
@@ -86,88 +87,33 @@
frameText.Gravity = Gravity.CenterHorizontal;
frameText.BorderColor = 0xff676767;
frameText.BorderWidth = 1;
- frameText.Radius = 8;
+ frameText.Radius = (uint)Application.GetRealHeight(17);
frameBack.AddChidren(frameText);
//杈撳叆妗�
this.txtInput = new TextInputControl(frameText.Width - Application.GetRealWidth(20), frameText.Height, false);
txtInput.TextAlignment = TextAlignment.Center;
txtInput.Gravity = Gravity.CenterHorizontal;
frameText.AddChidren(txtInput);
+ if (i_MaxByte > 0)
+ {
+ this.txtInput.MaxByte = i_MaxByte;
+ }
//鍙栨秷
- var frameCancel = new FrameLayoutControl();
- frameCancel.Height = Application.GetRealHeight(127);
- frameCancel.Width = Application.GetRealWidth(396);
- frameCancel.Gravity = Gravity.BottomLeft;
- frameCancel.Radius = 8;
- frameCancel.BackgroundColor = 0xfff5f6fa;
- frameBack.AddChidren(frameCancel);
- //鎶婁笂鍦嗚瑕嗙洊涓烘柟瑙�
- var btnTopTemp1 = new NormalViewControl(frameCancel.Width, Application.GetRealHeight(40), false);
- btnTopTemp1.BackgroundColor = 0xfff5f6fa;
- frameCancel.AddChidren(btnTopTemp1, ChidrenBindMode.BindEventOnly);
- //鎶婂彸涓嬪渾瑙掕鐩栦负鏂硅
- var btnBomTemp1 = new NormalViewControl(frameCancel.Width / 2, Application.GetRealHeight(40), false);
- btnBomTemp1.BackgroundColor = 0xfff5f6fa;
- btnBomTemp1.Gravity = Gravity.BottomRight;
- frameCancel.AddChidren(btnBomTemp1, ChidrenBindMode.BindEventOnly);
- //鍙栨秷鎸夐挳
- this.btnCancel = new NormalViewControl(frameCancel.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
- btnCancel.Gravity = Gravity.Center;
- btnCancel.TextColor = UserCenterColor.Current.TextGrayColor1;
- btnCancel.TextID = R.MyInternationalizationString.uCancel;
- btnCancel.TextAlignment = TextAlignment.Center;
- btnCancel.BackgroundColor = 0xfff5f6fa;
- frameCancel.AddChidren(btnCancel, ChidrenBindMode.BindEventOnly);
- frameCancel.ButtonClickEvent += (sender, e) =>
+ this.btnCancel = new BottomLeftClickButton(Application.GetRealWidth(396), Application.GetRealHeight(127));
+ frameBack.AddChidren(btnCancel);
+ btnCancel.InitControl(Language.StringByID(R.MyInternationalizationString.uCancel));
+ btnCancel.ButtonClickEvent += (sender, e) =>
{
//绉婚櫎鐣岄潰
this.CloseDialog();
};
- //閲嶅啓鎺т欢鐐瑰嚮鐘舵��
- frameCancel.SelectStatuEvent += (statu) =>
- {
- if (statu == true)
- {
- frameCancel.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
- btnTopTemp1.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
- btnBomTemp1.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
- btnCancel.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
- }
- else
- {
- frameCancel.BackgroundColor = 0xfff5f6fa;
- btnTopTemp1.BackgroundColor = 0xfff5f6fa;
- btnBomTemp1.BackgroundColor = 0xfff5f6fa;
- btnCancel.BackgroundColor = 0xfff5f6fa;
- }
- };
//纭
- var frameConfirm = new FrameLayoutControl();
- frameConfirm.Height = Application.GetRealHeight(127);
- frameConfirm.Width = Application.GetRealWidth(396);
- frameConfirm.Gravity = Gravity.BottomRight;
- frameConfirm.Radius = 8;
- frameConfirm.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- frameBack.AddChidren(frameConfirm);
- //鎶婁笂鍦嗚瑕嗙洊涓烘柟瑙�
- var btnTopTemp2 = new NormalViewControl(frameConfirm.Width, Application.GetRealHeight(40), false);
- btnTopTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- frameConfirm.AddChidren(btnTopTemp2, ChidrenBindMode.BindEventOnly);
- //鎶婂乏涓嬪渾瑙掕鐩栦负鏂硅
- var btnBomTemp2 = new NormalViewControl(frameConfirm.Width / 2, Application.GetRealHeight(40), false);
- btnBomTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- btnBomTemp2.Gravity = Gravity.BottomLeft;
- frameConfirm.AddChidren(btnBomTemp2, ChidrenBindMode.BindEventOnly);
- //纭鎸夐挳
- this.btnConfirm = new NormalViewControl(frameConfirm.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
- btnConfirm.Gravity = Gravity.Center;
- btnConfirm.TextColor = UserCenterColor.Current.White;
- btnConfirm.TextID = R.MyInternationalizationString.OkMsg;
- btnConfirm.TextAlignment = TextAlignment.Center;
- frameConfirm.AddChidren(btnConfirm, ChidrenBindMode.BindEventOnly);
- frameConfirm.ButtonClickEvent += (sender, e) =>
+ this.btnConfirm = new BottomRightClickButton(frameBack.Width - btnCancel.Width, btnCancel.Height);
+ frameBack.AddChidren(btnConfirm);
+ btnConfirm.InitControl(Language.StringByID(R.MyInternationalizationString.OkMsg));
+ btnConfirm.ButtonClickEvent += (sender, e) =>
{
if (this.Text == string.Empty && string.IsNullOrEmpty(this.txtInput.PlaceholderText) == false)
{
@@ -177,24 +123,6 @@
}
//鍥炶皟鍑芥暟
this.ComfirmClickEvent?.Invoke(this.Text);
- };
- //閲嶅啓鎺т欢鐐瑰嚮鐘舵��
- frameConfirm.SelectStatuEvent += (statu) =>
- {
- if (statu == true)
- {
- frameConfirm.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
- btnTopTemp2.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
- btnBomTemp2.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
- btnConfirm.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
- }
- else
- {
- frameConfirm.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- btnTopTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- btnBomTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- btnConfirm.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
- }
};
}
@@ -229,7 +157,7 @@
/// <param name="txtValue"></param>
public void SetCancelButtonText(string txtValue)
{
- this.btnCancel.Text = txtValue;
+ this.btnCancel.SetButtonText(txtValue);
}
/// <summary>
@@ -238,7 +166,7 @@
/// <param name="txtValue"></param>
public void SetOkButtonText(string txtValue)
{
- this.btnConfirm.Text = txtValue;
+ this.btnConfirm.SetButtonText(txtValue);
}
/// <summary>
--
Gitblit v1.8.0