wxr
2020-07-06 23c075a9c27946773feccf05abc90489a6bf5203
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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();
 
        }
    }
}