using System;
using System.Collections.Generic;
using System.Text;
namespace Shared.Phone.UserCenter.UserMain
{
///
/// 个人二维码界面
///
public class QRCodeForm : DialogCommonForm
{
#region ■ 初始化_____________________________
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
public void ShowForm()
{
//初始化中部控件
this.InitMiddleFrame();
}
///
/// 初始化中部控件
///
private void InitMiddleFrame()
{
uint roundHeigth = (uint)this.GetRealSizeEx(17);
//背景框
var frameBack = new FrameLayout();
frameBack.Width = this.GetRealSizeEx(688);
frameBack.Height = this.GetRealSizeEx(968);
frameBack.Y = this.GetRealHeight(498);
frameBack.Gravity = Gravity.CenterHorizontal;
frameBack.Radius = roundHeigth;
bodyFrameLayout.AddChidren(frameBack);
//顶部圆角
var frameTop = new FrameLayout();
frameTop.Height = this.GetRealSizeEx(100);
frameTop.BackgroundColor = 0xff232323;
frameTop.Radius = roundHeigth;
frameBack.AddChidren(frameTop);
//底部圆角
var frameBottom = new FrameLayout();
frameBottom.Y = frameBack.Height - this.GetRealSizeEx(100);
frameBottom.Height = this.GetRealSizeEx(100);
frameBottom.BackgroundColor = UserCenterColor.Current.White;
frameBottom.Radius = roundHeigth;
frameBack.AddChidren(frameBottom);
//头部方形
var frameTitle = new FrameLayout();
frameTitle.Height = this.GetRealSizeEx(274) - frameTop.Height / 2;
frameTitle.Y = frameTop.Height / 2;
frameTitle.BackgroundColor = 0xff232323;
frameBack.AddChidren(frameTitle);
//明细方形
var frameDetail = new FrameLayout();
frameDetail.Height = this.GetRealSizeEx(694) - frameBottom.Height / 2;
frameDetail.Y = frameTitle.Bottom;
frameDetail.BackgroundColor = UserCenterColor.Current.White;
frameBack.AddChidren(frameDetail);
//用户头像
var btnIcon = new ImageView();
btnIcon.Height = this.GetRealSizeEx(294);
btnIcon.Width = this.GetRealSizeEx(294);
btnIcon.Radius = (uint)this.GetRealSizeEx(294) / 2;
btnIcon.Y = frameDetail.Y - this.GetRealSizeEx(294) / 2;
btnIcon.Gravity = Gravity.CenterHorizontal;
btnIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(HdlFileNameResourse.UserHeadIconFile);
frameBack.AddChidren(btnIcon);
//用户名
var btnUser = new NormalViewControl(frameBack.Width, this.GetRealHeight(50), false);
btnUser.IsBold = true;
btnUser.Y = btnIcon.Bottom + this.GetRealSizeEx(23);
btnUser.Text = HdlUserCenterResourse.UserInfo.NickName;
btnUser.TextAlignment = TextAlignment.Center;
btnUser.TextColor = UserCenterColor.Current.TextGrayColor2;
frameBack.AddChidren(btnUser);
//二维码
var btnQrCode = new PicViewControl(this.GetRealSizeEx(236), this.GetRealSizeEx(236), false);
btnQrCode.ImageBytes = QRCode.BytesFromText(HdlUserCenterResourse.UserInfo.Account, this.GetPictrueRealSize(236), this.GetPictrueRealSize(236));
btnQrCode.Gravity = Gravity.CenterHorizontal;
btnQrCode.Y = btnUser.Bottom + this.GetRealSizeEx(69);
frameBack.AddChidren(btnQrCode);
//扫一扫添加成员
var btnMsg = new NormalViewControl(frameBack.Width, this.GetRealHeight(60), false);
btnMsg.Y = btnQrCode.Bottom + this.GetRealSizeEx(35);
btnMsg.TextAlignment = TextAlignment.Center;
btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
btnMsg.TextID = R.MyInternationalizationString.uScanAndAddMember;
frameBack.AddChidren(btnMsg);
}
#endregion
}
}