using System;
|
using System.Collections.Generic;
|
using System.Text;
|
using Shared;
|
|
namespace Shared.SimpleControl.Phone.Music
|
{
|
class A31ListMusic:FrameLayout
|
{
|
FrameLayout TTopFrameLayout = new FrameLayout();
|
FrameLayout middleFrameLayout = new FrameLayout();
|
|
public void Musiclist(MusicModel musicModel, List<KeyAndValue> playListmusic )
|
{
|
|
TTopFrameLayout.Width = LayoutParams.MatchParent;//MusicModel musicModelList
|
TTopFrameLayout.Height = Application.GetRealHeight(130);
|
TTopFrameLayout.BackgroundColor = SkinStyle.Current.MainColor;
|
this.AddChidren(TTopFrameLayout);
|
|
Button back = new Button
|
{
|
Width = Application.GetRealWidth(72),
|
Height = Application.GetRealHeight(89),
|
X = Application.GetRealWidth(40),
|
Gravity = Gravity.CenterVertical,//Y轴居中
|
UnSelectedImagePath = "MusicIcon/PlayBack.png",
|
};
|
|
|
TTopFrameLayout.AddChidren(back);
|
back.MouseDownEventHandler += Back_MouseDownEventHandler;
|
|
Button button = new Button
|
{
|
Width = Application.GetRealWidth(200),
|
Height = Application.GetRealHeight(200),
|
Gravity = Gravity.CenterVertical,
|
X = Application.GetRealWidth(200),
|
Text = "本地音乐",
|
TextSize = 18,
|
|
};
|
TTopFrameLayout.AddChidren(button);
|
|
VerticalScrolViewLayout verticalScrolViewLayout = new VerticalScrolViewLayout
|
{
|
Width = LayoutParams.MatchParent,
|
Height = Application.GetRealHeight(1006 - 100),
|
Y = Application.GetRealHeight(130),
|
BackgroundColor = 0xff2F2F2F,
|
};
|
this.AddChidren(verticalScrolViewLayout);
|
|
//string typeAndListNumber = musicModel.listMusicListName[i].number;
|
//songlist.Show(musicModel.listMusicSongName.FindAll((song) => { return song.number.StartsWith(typeAndListNumber); }), musicModel);
|
for (int i = 0; i < playListmusic.Count; i++)
|
{
|
var rowsong = new RowLayout
|
{
|
Width = LayoutParams.MatchParent,
|
Height = Application.GetRealHeight(100),
|
};
|
verticalScrolViewLayout.AddChidren(rowsong);
|
|
var song = new Button
|
{
|
Width = Application.GetRealWidth(320),
|
Height = LayoutParams.MatchParent,
|
Text = playListmusic[i].name,
|
TextAlignment = TextAlignment.CenterLeft,
|
X = Application.GetRealWidth(20),
|
Tag = playListmusic[i].number,
|
};
|
rowsong.AddChidren(song);
|
song.MouseDownEventHandler += (sender, e) =>
|
{
|
//rowsong.BackgroundColor=0xffFE5E00;
|
Control.ControlBytesSend(Command.ControlMusicModel2, musicModel.SubnetID, musicModel.DeviceID, MusicModel.MusiceBytes("*Z011SONG" + song.Tag + "2"));
|
this.RemoveFromParent();
|
//PlayMusic playMusic = new PlayMusic
|
//{
|
// Width = LayoutParams.MatchParent,
|
// Height = LayoutParams.MatchParent,
|
//};
|
//MainPage.MainFrameLayout.AddChidren(playMusic);
|
//playMusic.Show(musicModel, playList);
|
};
|
|
var del = new Button
|
{
|
Text = "删除",
|
BackgroundColor = 0xFFFF0000,
|
Tag = playListmusic[i].number,
|
};
|
rowsong.AddRightView(del);
|
|
del.MouseDownEventHandler += (sender, e) =>
|
{
|
for (int j = 0; j < musicModel.SDCardSongList.Count; j++)
|
{
|
if (musicModel.SDCardSongList[j].number == del.Tag.ToString())
|
{
|
musicModel.SDCardSongList.RemoveAt(j);
|
break;
|
}
|
}
|
rowsong.RemoveFromParent();
|
};
|
}
|
|
middleFrameLayout.Width = LayoutParams.MatchParent;
|
middleFrameLayout.Height = Application.GetRealHeight(106);
|
middleFrameLayout.Y = verticalScrolViewLayout.Bottom;
|
middleFrameLayout.BackgroundColor = SkinStyle.Current.MainColor;
|
this.AddChidren(middleFrameLayout);
|
|
FrameLayout frameLayout = new FrameLayout
|
{
|
Width = LayoutParams.MatchParent,
|
Height = Application.GetRealHeight(100),
|
Y = Application.GetRealHeight(1040 - 1036),
|
};
|
middleFrameLayout.AddChidren(frameLayout);
|
|
Button artists = new Button
|
{
|
Width = Application.GetRealWidth(200),
|
Height = Application.GetRealHeight(200),
|
X = Application.GetRealWidth(-25),
|
Gravity = Gravity.CenterVertical,
|
Text = "artists",
|
TextSize = 18,
|
};
|
frameLayout.AddChidren(artists);
|
|
Button albums = new Button
|
{
|
Width = Application.GetRealWidth(200),
|
Height = Application.GetRealHeight(200),
|
X = Application.GetRealWidth(142),
|
Gravity = Gravity.CenterVertical,
|
Text = "albums",
|
TextSize = 18,
|
};
|
|
frameLayout.AddChidren(albums);
|
|
Button songs = new Button
|
{
|
Width = Application.GetRealWidth(200),
|
Height = Application.GetRealHeight(200),
|
X = Application.GetRealWidth(309),
|
Gravity = Gravity.CenterVertical,
|
Text = "songs",
|
TextSize = 18,
|
};
|
|
frameLayout.AddChidren(songs);
|
|
Button genres = new Button
|
{
|
Width = Application.GetRealWidth(200),
|
Height = Application.GetRealHeight(200),
|
X = Application.GetRealWidth(466),
|
Gravity = Gravity.CenterVertical,
|
Text = "genres",
|
TextSize = 18,
|
};
|
|
frameLayout.AddChidren(genres);
|
|
|
}
|
|
private void Back_MouseDownEventHandler(object sender, MouseEventArgs e)
|
{
|
this.RemoveFromParent();
|
}
|
}
|
}
|