黄学彪
2020-12-16 0d9f64668fd7350d6a21fd157e32009a96d98134
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.GatewayAdd
{
    /// <summary>
    /// 无线网关UPD模式的说明指示界面
    /// </summary>
    public class WirelessUdpDirectionForm : EditorCommonForm
    {
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        public void ShowForm()
        {
            //设置头部信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddWirelessGateway));
 
            //初始化中部信息
            this.InitMiddleFrame();
        }
 
        /// <summary>
        /// 初始化中部信息
        /// </summary>
        private void InitMiddleFrame()
        {
            //清空bodyFrame
            this.ClearBodyFrame();
 
            //图片
            var framePic = new FrameLayout();
            framePic.Width = this.GetPictrueRealSize(852);
            framePic.Height = this.GetPictrueRealSize(478);
            framePic.Gravity = Gravity.CenterHorizontal;
            framePic.Y = Application.GetRealHeight(251);
            framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png";
            bodyFrameLayout.AddChidren(framePic);
 
            //请先去设置手机连接到路由器{0}然后长按网关HID/WCFG按键大概20秒{0}直到系统指示灯快闪{0}网关进入UDP模式WIFI配网
            string[] strMsg = Language.StringByID(R.MyInternationalizationString.uAddUdpWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
            int YY = framePic.Bottom + Application.GetRealHeight(128);
            for (int i = 0; i < strMsg.Length; i++)
            {
                var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
                btnMsg1.Y = YY;
                btnMsg1.Text = strMsg[i];
                btnMsg1.TextAlignment = TextAlignment.Center;
                btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor3;
                bodyFrameLayout.AddChidren(btnMsg1);
                YY = btnMsg1.Bottom;
            }
 
            //去设置
            var btnSettion = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
            btnSettion.Y = YY + Application.GetRealHeight(12);
            btnSettion.TextSize = 12;
            btnSettion.TextAlignment = TextAlignment.Center;
            btnSettion.TextColor = 0xff0075ff;
            btnSettion.Text = Language.StringByID(R.MyInternationalizationString.uGotoSettion);
            btnSettion.ButtonClickEvent += (sender, e) =>
            {
                HdlWifiLogic.Current.OpenAppWifiSettion();
            };
            bodyFrameLayout.AddChidren(btnSettion);
            //底线
            int lineWidth = btnSettion.GetRealWidthByText();
            var btnLine1 = new NormalViewControl(lineWidth, HdlControlResourse.BottomLineHeight, false);
            btnLine1.BackgroundColor = 0xff0075ff;
            btnLine1.Gravity = Gravity.CenterHorizontal;
            btnLine1.Y = btnSettion.Bottom - Application.GetRealHeight(8);
            bodyFrameLayout.AddChidren(btnLine1);
 
            //查看帮助
            var btnHelp = this.AddHelpControl();
            btnHelp.ButtonClickEvent += (sender, e) =>
            {
                var form = new AddGatewayHelpForm();
                form.AddForm("Udp");
            };
 
            //下一步
            var btnNext = new BottomClickButton();
            btnNext.TextID = R.MyInternationalizationString.uNextway;
            bodyFrameLayout.AddChidren(btnNext);
            btnNext.ButtonClickEvent += (sender, e) =>
            {
                var form = new WirelessUdpSelectNetworkForm();
                this.AddFormAndCloseNowForm(form);
            };
        }
 
        #endregion
    }
}