using System.Text;
|
using Shared;
|
using Shared.SimpleControl.Phone;
|
using Shared.SimpleControl;
|
using Shared.SimpleControl.R;
|
using System.Xml;
|
using SmartHome.UI.SimpleControl.Phone;
|
using System.Security;
|
using SmartHome;
|
using System.Net;
|
using System.Security.Cryptography;
|
using System;
|
|
namespace Shared.SimpleControl.Phone
|
{
|
public class SonosMusicSource:FrameLayout
|
{
|
public void Show (SonosMusic sonosMusic)
|
{
|
AddChidren (new Button {
|
Height = Application.GetRealHeight (36),
|
BackgroundColor = SkinStyle.Current.MusicTopFrameLayout,
|
});
|
|
var topFrameLayout = new FrameLayout {
|
Height = Application.GetRealHeight (90),
|
Y = Application.GetRealHeight (36),
|
BackgroundColor = SkinStyle.Current.MusicTopFrameLayout,
|
};
|
AddChidren (topFrameLayout);
|
|
var btnTitle = new Button {
|
TextID = MyInternationalizationString.MusicSource,
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//TextSize = 20,
|
};
|
topFrameLayout.AddChidren (btnTitle);
|
|
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 hdl = new Button {
|
Width = Application.GetRealWidth (154),
|
Height = Application.GetRealHeight (90),
|
X = Application.GetRealWidth (486),
|
Gravity = Gravity.CenterVertical,
|
UnSelectedImagePath = MainPage.LogoString,
|
};
|
topFrameLayout.AddChidren (hdl);
|
|
var tempFrameLayout = new FrameLayout {
|
Y = topFrameLayout.Bottom,
|
Height = Application.GetRealHeight (Application.DesignHeight - 126),
|
//BackgroundImagePath = "MusicIcon/HomepageBackgroun.png",
|
BackgroundColor = SkinStyle.Current.MusicVerticalScrolViewLayout,
|
};
|
AddChidren (tempFrameLayout);
|
|
VerticalScrolViewLayout middle = new VerticalScrolViewLayout ();
|
tempFrameLayout.AddChidren (middle);
|
|
|
|
#region 我的最爱
|
|
var likelayout = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (likelayout);
|
|
var likehoto = new Button {
|
Width = Application.GetRealWidth (61),
|
Height = Application.GetRealHeight (81),
|
UnSelectedImagePath = "MusicIcon/like.png",
|
SelectedImagePath = "MusicIcon/likeSelected.png",
|
TextAlignment = TextAlignment.CenterLeft,
|
X = Application.GetRealWidth (30),
|
Gravity = Gravity.CenterVertical,
|
};
|
likelayout.AddChidren (likehoto);
|
|
var loveList = new Button {
|
Height = Application.GetRealHeight (100),
|
TextID = MyInternationalizationString.Musiclike,
|
TextAlignment = TextAlignment.CenterLeft,
|
X = Application.GetRealWidth (130),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
};
|
likelayout.AddChidren (loveList);
|
|
var lovenext = new Button {
|
Width = Application.GetRealWidth (87),
|
Height = Application.GetRealHeight (100),
|
UnSelectedImagePath = "MusicIcon/Next.png",
|
SelectedImagePath = "MusicIcon/NextSelecte.png",
|
X = Application.GetRealWidth (550),
|
};
|
likelayout.AddChidren (lovenext);
|
EventHandler<MouseEventArgs> lovea31Source = (sender, e) => {
|
|
MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load));
|
System.Threading.Tasks.Task.Run (() => {
|
Application.RunOnMainThread (() => {
|
MainPage.Loading.Hide ();
|
var sonosLikeList = new SonosLikeList { };
|
MainPage.MainFrameLayout.AddChidren (sonosLikeList);
|
sonosLikeList.Show (sonosMusic);
|
});
|
});
|
};
|
loveList.MouseUpEventHandler += lovea31Source;
|
lovenext.MouseUpEventHandler += lovea31Source;
|
likehoto.MouseUpEventHandler += lovea31Source;
|
|
#endregion
|
|
#region 我的列表
|
var rowaddlist = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (rowaddlist);
|
|
var listhoto = new Button {
|
Width = Application.GetRealWidth (61),
|
Height = Application.GetRealHeight (81),
|
UnSelectedImagePath = "MusicIcon/mylist.png",
|
TextAlignment = TextAlignment.CenterLeft,
|
X = Application.GetRealWidth (30),
|
Gravity = Gravity.CenterVertical,
|
};
|
rowaddlist.AddChidren (listhoto);
|
|
var addlistname = new Button {
|
Height = Application.GetRealHeight (100),
|
TextID = MyInternationalizationString.Musiclist,
|
TextAlignment = TextAlignment.CenterLeft,
|
X = Application.GetRealWidth (130),
|
Gravity = Gravity.CenterVertical,
|
TextColor = SkinStyle.Current.MusicTextColor,
|
};
|
rowaddlist.AddChidren (addlistname);
|
|
var listback = new Button {
|
Width = Application.GetRealWidth (87),
|
Height = Application.GetRealHeight (100),
|
UnSelectedImagePath = "MusicIcon/Next.png",
|
SelectedImagePath = "MusicIcon/NextSelecte.png",
|
X = Application.GetRealWidth (550),
|
Gravity = Gravity.CenterVertical,
|
};
|
rowaddlist.AddChidren (listback);
|
|
EventHandler<MouseEventArgs> addlist = (sender, e) => {
|
MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load));
|
System.Threading.Tasks.Task.Run (() => {
|
Application.RunOnMainThread (() => {
|
MainPage.Loading.Hide ();
|
var sonosMyList = new SonosMyList ();
|
MainPage.MainFrameLayout.AddChidren (sonosMyList);
|
sonosMyList.Show (sonosMusic);
|
});
|
});
|
|
};
|
addlistname.MouseUpEventHandler += addlist;
|
listback.MouseUpEventHandler += addlist;
|
#endregion
|
|
#region 本地音乐
|
|
var LocalMusic = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (LocalMusic);
|
|
var musichoto = new Button {
|
Width = Application.GetRealWidth (61),
|
Height = Application.GetRealHeight (81),
|
UnSelectedImagePath = "MusicIcon/musicMusic.png",
|
SelectedImagePath = "MusicIcon/HomepageMusicSelected.png",
|
TextAlignment = TextAlignment.CenterLeft,
|
X = Application.GetRealWidth (30),
|
Gravity = Gravity.CenterVertical,
|
};
|
LocalMusic.AddChidren (musichoto);
|
|
var musicSD = new Button {
|
Height = Application.GetRealHeight (100),
|
TextID = MyInternationalizationString.Musicmusic,
|
TextAlignment = TextAlignment.CenterLeft,
|
X = Application.GetRealWidth (130),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
};
|
LocalMusic.AddChidren (musicSD);
|
|
var nextSD = new Button {
|
Width = Application.GetRealWidth (87),
|
Height = Application.GetRealHeight (100),
|
UnSelectedImagePath = "MusicIcon/Next.png",
|
SelectedImagePath = "MusicIcon/NextSelecte.png",
|
X = Application.GetRealWidth (550),
|
};
|
LocalMusic.AddChidren (nextSD);
|
|
EventHandler<MouseEventArgs> LocalMusicource = (sender, e) => {
|
MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load));
|
System.Threading.Tasks.Task.Run (() => {
|
Application.RunOnMainThread (() => {
|
MainPage.Loading.Hide ();
|
var sonosLocal = new SonosLocal { };
|
MainPage.MainFrameLayout.AddChidren (sonosLocal);
|
sonosLocal.Show (sonosMusic);
|
});
|
});
|
};
|
musicSD.MouseUpEventHandler += LocalMusicource;
|
nextSD.MouseUpEventHandler += LocalMusicource;
|
musichoto.MouseUpEventHandler += LocalMusicource;
|
#endregion
|
|
|
}
|
}
|
}
|