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
|
}
|
|
}
|
}
|