using System;
|
using HDL_ON.UI.CSS;
|
using Shared;
|
|
namespace HDL_ON.UI
|
{
|
/// <summary>
|
/// 增加子账号界面
|
/// </summary>
|
public partial class AddMemberScanPage : FrameLayout
|
{
|
FrameLayout bodyView;
|
|
Button btnAddMember;
|
Button btnScan;
|
EditText etMemberAccount;
|
|
Action backAction;
|
|
public AddMemberScanPage(Action action)
|
{
|
backAction = action;
|
bodyView = this;
|
}
|
|
|
public void LoadPage()
|
{
|
bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
|
new TopViewDiv(bodyView, Language.StringByID(StringId.AddMember)).LoadTopView();
|
|
var btnTitle = new Button()
|
{
|
Y = Application.GetRealHeight(70),
|
X = Application.GetRealWidth(16),
|
Height = Application.GetRealHeight(32),
|
TextColor = CSS_Color.FirstLevelTitleColor,
|
TextSize = CSS_FontSize.TextFontSize,
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = StringId.NewMemberAccount,
|
};
|
bodyView.AddChidren(btnTitle);
|
|
etMemberAccount = new EditText()
|
{
|
Y = btnTitle.Bottom,
|
X = Application.GetRealWidth(16),
|
Width = Application.GetRealWidth(356),
|
Height = Application.GetRealHeight(40),
|
TextColor = CSS_Color.TextualColor,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextAlignment = TextAlignment.CenterLeft,
|
PlaceholderText = Language.StringByID(StringId.PleaseEnterContent),
|
PlaceholderTextColor = CSS_Color.PromptingColor2
|
};
|
bodyView.AddChidren(etMemberAccount);
|
#if DEBUG
|
etMemberAccount.Text = "zyi@hdlchina.com.cn";
|
#endif
|
var btnLine = new Button()
|
{
|
Y = etMemberAccount.Bottom,
|
Gravity = Gravity.CenterHorizontal,
|
Width = Application.GetRealWidth(343),
|
Height = Application.GetRealHeight(1),
|
BackgroundColor = CSS_Color.DividingLineColor,
|
};
|
bodyView.AddChidren(btnLine);
|
|
btnAddMember = new Button()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = Application.GetRealHeight(244),
|
Width = Application.GetRealWidth(220),
|
Height = Application.GetRealHeight(44),
|
Radius = (uint)Application.GetRealWidth(22),
|
BorderWidth = 0,
|
BorderColor = 0x00000000,
|
BackgroundColor = CSS_Color.MainColor,
|
TextColor = CSS_Color.MainBackgroundColor,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
IsBold = true,
|
TextAlignment = TextAlignment.Center,
|
TextID = StringId.ConfirmInvitation,
|
};
|
bodyView.AddChidren(btnAddMember);
|
|
btnScan = new Button()
|
{
|
Y = btnAddMember.Bottom,
|
Height = Application.GetRealHeight(44),
|
TextAlignment = TextAlignment.Center,
|
TextColor = CSS_Color.MainColor,
|
TextSize = CSS_FontSize.TextFontSize,
|
TextID = StringId.ScanQRCoden,
|
};
|
bodyView.AddChidren(btnScan);
|
|
LoadEventList();
|
}
|
|
void TipDivMsg(string msg)
|
{
|
var tipBodyView = new FrameLayout();
|
bodyView.AddChidren(tipBodyView);
|
|
var msgView = new FrameLayout()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = Application.GetRealHeight(167),
|
Width = Application.GetRealWidth(210),
|
Height = Application.GetRealHeight(62),
|
Radius = (uint)Application.GetRealWidth(8),
|
BorderWidth = 0,
|
BorderColor = 0x00000000,
|
BackgroundColor = 0xFF333333,
|
};
|
tipBodyView.AddChidren(msgView);
|
|
var btnMsg = new Button()
|
{
|
Gravity = Gravity.Center,
|
Width = Application.GetRealWidth(186),
|
Height = Application.GetRealHeight(42),
|
TextColor = CSS_Color.MainBackgroundColor,
|
TextSize = CSS_FontSize.TextFontSize,
|
TextAlignment = TextAlignment.Center,
|
Text = msg,
|
IsMoreLines = true,
|
};
|
msgView.AddChidren(btnMsg);
|
|
new System.Threading.Thread(() => {
|
System.Threading.Thread.Sleep(1200);
|
Application.RunOnMainThread(() => {
|
tipBodyView.RemoveAll();
|
tipBodyView.RemoveFromParent();
|
});
|
}) { IsBackground = true }.Start();
|
|
}
|
}
|
}
|