1
wxr
2023-03-31 7e42cc13a14b7de31c9f5d5c61cdf24f3246335d
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
144
145
146
147
148
149
150
using System;
using Shared;
using Shared.SimpleControl;
using Shared.SimpleControl.Pad.Music;
using Shared.SimpleControl.R;
 
namespace SmartHome
{
    public class A31Wifimusic : FrameLayout
    {
        public void show (FrameLayout ControlBodyView, FrameLayout bordorView,FrameLayout  PalyMusicPage, FrameLayout MusicSourcePage)
        {
            var topFrameLayout = new FrameLayout {
                Height = Application.GetRealHeight (100),
                BackgroundColor = SkinStyle.Current.MainColor,
            };
            AddChidren (topFrameLayout);
 
            var LocallistName = new Button {
                TextID = MyInternationalizationString.yourpassword,
            };
            topFrameLayout.AddChidren (LocallistName);
 
            var back = new Button {
                Width = Application.GetRealWidth (82),
                Height = Application.GetRealHeight (89),
                X = Application.GetRealWidth (10),
                Gravity = Gravity.CenterVertical,
                UnSelectedImagePath = "MusicIcon/HomepageBack.png",
            };
            topFrameLayout.AddChidren (back);
            back.MouseDownEventHandler += (sender, e) => {
                RemoveFromParent ();
            };
 
            var middle = new FrameLayout ();
            middle.Y = topFrameLayout.Bottom;
            middle.Height = Application.GetRealHeight (Application.DesignHeight - 100);
            middle.BackgroundColor = 0xff2F2F2F;
            AddChidren (middle);
 
            var wifitopo = new Button {
                Width = Application.GetMinRealAverage (211),
                Height = Application.GetMinRealAverage (211),
                UnSelectedImagePath = "MusicIcon/wifi.png",
                X = Application.GetRealWidth (215),
                Y = Application.GetRealHeight (20),
            };
            middle.AddChidren (wifitopo);
 
            var wifiname = new Button {
                Height = Application.GetRealHeight (80),
                Text = WiimuUPnP.SSID,
                X = Application.GetRealWidth (5),
                Y = Application.GetRealHeight (215),
                TextSize = 17,
            };
            middle.AddChidren (wifiname);
            if (WiimuUPnP.SSID == null) {
                //MainPage.AddTip (Language.StringByID(MyInternationalizationString.addsuccess), 2000);
            }
 
            var password = new EditText {
                Width = Application.GetRealWidth (580),
                Height = Application.GetRealHeight (80),
                X = Application.GetRealWidth (30),
                Y = Application.GetRealHeight (300),
                TextAlignment = TextAlignment.Center,
                BackgroundColor = 0xFF4D4D4D,
                UnSelectedImagePath = "Register/Register_Password_kuang.png",
                //PlaceholderText = Language.StringByID (MyInternationalizationString.PleaseEnterPassword),
                SecureTextEntry = true,
            };
            middle.AddChidren (password);
 
            var login = new Button {
                Width = Application.GetRealWidth (580),
                Height = Application.GetRealHeight (80),
                TextID = MyInternationalizationString.nextstep,
                TextSize = 20,
                X = Application.GetRealWidth (30),
                Y = Application.GetRealHeight (420),
                BackgroundColor = 0xff656565,
            };
            middle.AddChidren (login);
 
            login.MouseUpEventHandler += (sender, e) => {
                login.BackgroundColor = 0xff656565;
                if (password.Text.Trim () == "") {
                    //密码为空
                    return;
                }
                MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load) + "...");
                var tempPassword = password.Text.Trim ();
                System.Threading.Tasks.Task.Run (() => {
                    try {
                        WiimuUPnP.Start (tempPassword, (obj) => {
                            if (obj == "TimeOut") {
                                Application.RunOnMainThread (() => {
                                    MainPage.Loading.Hide ();
                                });
                                return;
                            }
 
                            System.Threading.Thread.Sleep (3000);
                            Application.RunOnMainThread (() => {
                                MainPage.Loading.Hide ();
                                if (this.Parent == null) {
                                    return;
                                }
                                MusicSourcePage.RemoveFromParent ();
                                PalyMusicPage.RemoveViewByType (typeof (A31PlayMusicPage));
                                bordorView.RemoveViewByType (typeof (PlayerPage));
                                this.RemoveFromParent ();
 
                                PlayerPage myMusic = new PlayerPage ();
                                bordorView.AddChidren (myMusic);
                                myMusic.Show (ControlBodyView, bordorView,true);
                            });
                        });
 
                    } catch { }
                });
            };
 
            login.MouseDownEventHandler += (sender, e) => {
                login.BackgroundColor = 0xffFE5E00;
            };
 
            var warn = new Button {
                Width = Application.GetRealWidth (41),
                Height = Application.GetRealHeight (41),
                UnSelectedImagePath = "MusicIcon/warn.png",
                X = Application.GetRealWidth (40),
                Y = Application.GetRealHeight (530),
            };
            //middle.AddChidren (warn);
 
            var txet = new Button {
                Width = Application.GetRealWidth (480),
                Height = Application.GetRealHeight (120),
                TextID = MyInternationalizationString.ssid,
                X = Application.GetRealWidth (90),
                Y = Application.GetRealHeight (520),
            };
            // middle.AddChidren (t        
        }
 
    }
}