using System;
|
using System.Collections.Generic;
|
using System.Text;
|
|
namespace Shared.Phone.UserCenter.Safety
|
{
|
/// <summary>
|
/// 用户密码的列表界面
|
/// </summary>
|
public class UserPasswordListForm : EditorCommonForm
|
{
|
#region ■ 变量声明___________________________
|
|
#endregion
|
|
#region ■ 初始化_____________________________
|
|
/// <summary>
|
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
/// </summary>
|
public void ShowForm()
|
{
|
//设置头部信息
|
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uUserPasswordSettion));
|
|
//初始化中部信息
|
this.InitMiddleFrame();
|
}
|
|
/// <summary>
|
/// 初始化中部信息
|
/// </summary>
|
public async void InitMiddleFrame()
|
{
|
var listData = await HdlSafeguardLogic.Current.GetAllUserPassword();
|
List<int> listEsixt = new List<int>();
|
if (listData != null)
|
{
|
foreach (var data in listData)
|
{
|
listEsixt.Add(data.UserId);
|
}
|
}
|
|
Application.RunOnMainThread(() =>
|
{
|
//清空bodyFrame
|
this.ClearBodyFrame();
|
|
var listView = new VerticalListControl(29);
|
listView.Y = Application.GetRealHeight(-6);
|
listView.Height = Application.GetRealHeight(636 + 6);
|
listView.BackgroundColor = UserCenterColor.Current.White;
|
bodyFrameLayout.AddChidren(listView);
|
|
//4个用户密码
|
for (int i = 1; i <= 4; i++)
|
{
|
//添加行
|
this.AddPassworRow(listView, listEsixt, i);
|
}
|
});
|
}
|
|
#endregion
|
|
#region ■ 添加行_____________________________
|
|
/// <summary>
|
/// 添加行
|
/// </summary>
|
/// <param name="listView"></param>
|
/// <param name="listEsixt"></param>
|
/// <param name="pswNo"></param>
|
private void AddPassworRow(VerticalListControl listView, List<int> listEsixt, int pswNo)
|
{
|
string text = Language.StringByID(R.MyInternationalizationString.uUserPassword) + pswNo;
|
|
//添加【用户密码】行
|
var rowUserPsw = new FrameRowControl(listView.rowSpace / 2);
|
listView.AddChidren(rowUserPsw);
|
//图标
|
var btnUserPswIcon = rowUserPsw.AddLeftIcon(81);
|
btnUserPswIcon.UnSelectedImagePath = "Item/Point.png";
|
//用户密码
|
var btnUserPswText = rowUserPsw.AddLeftCaption(text, 700);
|
btnUserPswText.TextSize = 15;
|
//向右的图标
|
rowUserPsw.AddRightArrow();
|
if (pswNo != 4)
|
{
|
//底线
|
rowUserPsw.AddBottomLine();
|
}
|
//备注
|
string note = "我跟我家人都在用";
|
if (listEsixt.Contains(pswNo) == false)
|
{
|
//未设置
|
note = Language.StringByID(R.MyInternationalizationString.uNotHadSettion);
|
}
|
var btnNote = rowUserPsw.AddMostRightView(note, 400);
|
btnNote.TextColor = UserCenterColor.Current.TextGrayColor1;
|
|
rowUserPsw.ButtonClickEvent += (sender, e) =>
|
{
|
var form = new EdtiorUserPasswordForm();
|
form.AddForm(pswNo, text);
|
};
|
}
|
|
#endregion
|
}
|
}
|