using System;
|
using System.Collections.Generic;
|
using System.Text;
|
|
namespace Shared.Phone
|
{
|
/// <summary>
|
/// 数字表盘密码输入的弹窗界面
|
/// </summary>
|
public class NumberPswInputDialogForm : DialogCommonForm
|
{
|
#region ■ 变量声明___________________________
|
|
/// <summary>
|
/// 输入结束事件
|
/// </summary>
|
public Action<string> FinishInputEvent = null;
|
/// <summary>
|
/// 密码输入控件
|
/// </summary>
|
private PswNumberInputControl pswControl = null;
|
|
#endregion
|
|
#region ■ 初始化_____________________________
|
|
/// <summary>
|
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
/// </summary>
|
/// <param name="i_PasswordText">标题提示</param>
|
/// <param name="i_pswLenth">密码长度</param>
|
public void ShowForm(string i_PasswordText, int i_pswLenth)
|
{
|
//初始化中部信息
|
this.InitMiddleFrame(i_PasswordText, i_pswLenth);
|
}
|
|
/// <summary>
|
/// 初始化中部信息
|
/// </summary>
|
/// <param name="i_PasswordText">标题提示</param>
|
/// <param name="i_pswLenth">密码长度</param>
|
private void InitMiddleFrame(string i_PasswordText, int i_pswLenth)
|
{
|
var frameBack = new FrameLayout();
|
frameBack.Y = Application.GetRealHeight(160);
|
frameBack.Gravity = Gravity.CenterHorizontal;
|
frameBack.Width = Application.GetRealWidth(965);
|
frameBack.Height = Application.GetRealHeight(1584);
|
frameBack.BackgroundColor = UserCenterColor.Current.White;
|
frameBack.Radius = (uint)Application.GetRealHeight(17);
|
bodyFrameLayout.AddChidren(frameBack);
|
|
//密码输入控件
|
this.pswControl = new PswNumberInputControl(i_PasswordText, i_pswLenth);
|
pswControl.Gravity = Gravity.CenterHorizontal;
|
pswControl.Y = Application.GetRealHeight(81);
|
frameBack.AddChidren(pswControl);
|
pswControl.InitControl();
|
//改变删除按钮的坐标
|
pswControl.ChangedDeleteButtonPoint(-1, pswControl.Height, false);
|
//添加关闭按钮
|
var btnClose = pswControl.AddCloseButton();
|
btnClose.ButtonClickEvent += (sender, e) =>
|
{
|
this.CloseForm();
|
};
|
pswControl.FinishInputEvent += (strPsw) =>
|
{
|
this.FinishInputEvent?.Invoke(strPsw);
|
};
|
}
|
|
#endregion
|
|
#region ■ 一般方法___________________________
|
|
/// <summary>
|
/// 设置错误信息
|
/// </summary>
|
/// <param name="i_Msg"></param>
|
public void SetErrorMsg(string i_Msg)
|
{
|
this.pswControl?.SetErrorMsg(i_Msg);
|
}
|
|
#endregion
|
|
#region ■ 界面关闭___________________________
|
|
/// <summary>
|
/// 界面关闭
|
/// </summary>
|
public override void CloseFormBefore()
|
{
|
//取消事件
|
this.FinishInputEvent = null;
|
this.pswControl = null;
|
|
base.CloseFormBefore();
|
}
|
|
#endregion
|
}
|
}
|