using System;
|
using System.Collections.Generic;
|
using Shared;
|
namespace HDL_ON.UI.Music
|
{
|
public class A31LoveList : FrameLayout
|
{
|
public A31LoveList()
|
{
|
Tag = "Music";
|
}
|
|
VerticalScrolViewLayout middViewLayout;
|
public void Show()
|
{
|
#region 界面布局------
|
this.BackgroundColor = Color.ViewColor;
|
var topView = new TopView();
|
this.AddChidren(topView.TopFLayoutView());
|
topView.topNameBtn.TextID = StringId.myLove;
|
topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
|
{
|
//if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive)
|
//{
|
// updateSelectedMusicThread.Abort();
|
//}
|
this.RemoveFromParent();
|
};
|
|
|
middViewLayout = new VerticalScrolViewLayout
|
{
|
BackgroundColor = Color.WhiteColor,
|
Y = topView.fLayout.Bottom,
|
Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
|
};
|
this.AddChidren(middViewLayout);
|
FileView();
|
#endregion
|
}
|
|
void FileView()
|
{
|
for (int i = 0; i < 2; i++)
|
{
|
RowLayout addFlieRow = new RowLayout
|
{
|
Height = Application.GetRealHeight(104),
|
LineColor = Color.WhiteColor,
|
SubViewWidth = Application.GetRealWidth(90),//改变编辑控件宽度多少;
|
};
|
middViewLayout.AddChidren(addFlieRow);
|
//文件图标
|
Button fileIconBtn = new Button
|
{
|
X = Application.GetRealWidth(16),
|
Y = Application.GetRealHeight(8),
|
Width = Application.GetMinRealAverage(88),
|
Height = Application.GetMinRealAverage(88),
|
|
};
|
addFlieRow.AddChidren(fileIconBtn);
|
//播放/暂停图标
|
Button playIconBtn = new Button
|
{
|
X = Application.GetRealWidth(78),
|
Y = Application.GetRealHeight(70),
|
Width = Application.GetMinRealAverage(24),
|
Height = Application.GetMinRealAverage(24),
|
UnSelectedImagePath = "MusicIcon/filePause.png",
|
SelectedImagePath = "MusicIcon/filePlay.png",
|
};
|
addFlieRow.AddChidren(playIconBtn);
|
|
playIconBtn.MouseUpEventHandler += (sender, e) =>
|
{
|
//点击按钮随机播放音乐
|
};
|
//文件名控件
|
Button fileNameBtn = new Button
|
{
|
X = fileIconBtn.Right + Application.GetRealWidth(16),
|
Y = Application.GetRealHeight(42),
|
Width = Application.GetRealWidth(217),
|
Height = Application.GetRealHeight(20),
|
TextColor = Color.TextColor,
|
TextSize = TextSize.Text14,
|
TextAlignment = TextAlignment.CenterLeft,
|
};
|
addFlieRow.AddChidren(fileNameBtn);
|
if (i == 0)
|
{
|
fileIconBtn.UnSelectedImagePath = "MusicIcon/loveMusic.png";
|
fileNameBtn.TextID = StringId.a31Music;
|
}
|
else
|
{
|
fileIconBtn.UnSelectedImagePath = "MusicIcon/loveRadio.png";
|
fileNameBtn.TextID = StringId.radioLove;
|
}
|
|
Button clickBtn = new Button
|
{
|
X = fileIconBtn.Right + Application.GetRealWidth(16),
|
Width = Application.GetRealWidth(375 - 138),
|
Height = Application.GetRealHeight(104),
|
};
|
addFlieRow.AddChidren(clickBtn);
|
clickBtn.MouseUpEventHandler += (sender, e) =>
|
{
|
if (fileNameBtn.Text == Language.StringByID(StringId.a31Music))
|
{
|
///喜爱音乐列表
|
A31LoveMusicList a31LoveMusicList = new A31LoveMusicList();
|
MainPage.BasePageView.AddChidren(a31LoveMusicList);
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
a31LoveMusicList.Show();
|
a31LoveMusicList.UpdateSelectedMusic();
|
}
|
else
|
{
|
///喜爱电台列表
|
A31LoveRadioList a31LoveRadioList = new A31LoveRadioList();
|
MainPage.BasePageView.AddChidren(a31LoveRadioList);
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
a31LoveRadioList.Show();
|
a31LoveRadioList.UpdateSelectedMusic();
|
}
|
|
};
|
|
}
|
}
|
}
|
}
|