黄学彪
2019-11-13 8b9ce384b26c414db32f98e94e088f5334869c2d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter.UserMain
{
    /// <summary>
    /// 个人二维码界面
    /// </summary>
    public class QRCodeForm : DialogCommonForm
    {
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        public void ShowForm()
        {
            //初始化中部控件
            this.InitMiddleFrame();
        }
 
        /// <summary>
        /// 初始化中部控件
        /// </summary>
        private void InitMiddleFrame()
        {
            uint roundHeigth = (uint)Application.GetMinRealAverage(6);
 
            //背景框
            var frameBack = new FrameLayout();
            frameBack.Width = Application.GetRealWidth(688);
            frameBack.Height = Application.GetRealHeight(968);
            frameBack.Y = Application.GetRealHeight(498);
            frameBack.Gravity = Gravity.CenterHorizontal;
            frameBack.Radius = roundHeigth;
            bodyFrameLayout.AddChidren(frameBack);
 
            //顶部圆角
            var frameTop = new FrameLayout();
            frameTop.Height = Application.GetRealHeight(100);
            frameTop.BackgroundColor = 0xff232323;
            frameTop.Radius = roundHeigth;
            frameBack.AddChidren(frameTop);
            //底部圆角
            var frameBottom = new FrameLayout();
            frameBottom.Y = frameBack.Height - Application.GetRealHeight(100);
            frameBottom.Height = Application.GetRealHeight(100);
            frameBottom.BackgroundColor = UserCenterColor.Current.White;
            frameBottom.Radius = roundHeigth;
            frameBack.AddChidren(frameBottom);
            //头部方形
            var frameTitle = new FrameLayout();
            frameTitle.Height = Application.GetRealHeight(274) - frameTop.Height / 2;
            frameTitle.Y = frameTop.Height / 2;
            frameTitle.BackgroundColor = 0xff232323;
            frameBack.AddChidren(frameTitle);
            //明细方形
            var frameDetail = new FrameLayout();
            frameDetail.Height = Application.GetRealHeight(694) - frameBottom.Height / 2;
            frameDetail.Y = frameTitle.Bottom;
            frameDetail.BackgroundColor = UserCenterColor.Current.White;
            frameBack.AddChidren(frameDetail);
 
            //用户头像
            var btnIcon = new ImageView();
            btnIcon.Height = Application.GetMinRealAverage(294);
            btnIcon.Width = Application.GetMinRealAverage(294);
            btnIcon.Radius = (uint)Application.GetMinRealAverage(294) / 2;
            btnIcon.Y = Application.GetRealHeight(121);
            btnIcon.Gravity = Gravity.CenterHorizontal;
            btnIcon.ImagePath = UserCenterResourse.UserInfo.UserIconFile;
            frameBack.AddChidren(btnIcon);
            //用户名
            var btnUser = new NormalViewControl(frameBack.Width, Application.GetRealHeight(46), false);
            btnUser.Y = Application.GetRealHeight(147);
            btnUser.Text = UserCenterResourse.UserInfo.UserName;
            btnUser.TextAlignment = TextAlignment.Center;
            btnUser.TextColor = UserCenterColor.Current.TextGrayColor2;
            frameDetail.AddChidren(btnUser);
            //二维码
            var btnQrCode = new PicViewControl(236, 236);
            btnQrCode.ImageBytes = QRCode.BytesFromText(UserCenterResourse.UserInfo.Account, Application.GetMinRealAverage(236), Application.GetMinRealAverage(236));
            btnQrCode.Gravity = Gravity.CenterHorizontal;
            btnQrCode.Y = Application.GetRealHeight(262);
            frameDetail.AddChidren(btnQrCode);
            //扫一扫添加成员
            var btnMsg = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false);
            btnMsg.Y = Application.GetRealHeight(533);
            btnMsg.TextAlignment = TextAlignment.Center;
            btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
            btnMsg.TextID = R.MyInternationalizationString.uScanAndAddMember;
            frameDetail.AddChidren(btnMsg);
        }
 
        #endregion
    }
}