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(122), 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(106), Height = Application.GetMinRealAverage(106), }; addFlieRow.AddChidren(fileIconBtn); //播放/暂停图标 Button playIconBtn = new Button { X = Application.GetRealWidth(94), Y = Application.GetRealHeight(86), 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(51), 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/loveList.png"; fileNameBtn.TextID = StringId.a31Music; } else { fileIconBtn.UnSelectedImagePath = "MusicIcon/radioList.png"; fileNameBtn.TextID = StringId.radioLove; } Button clickBtn = new Button { X = fileIconBtn.Right + Application.GetRealWidth(16), Width = Application.GetRealWidth(375 - 138), Height = Application.GetRealHeight(122), }; addFlieRow.AddChidren(clickBtn); clickBtn.MouseUpEventHandler += (sender, e) => { List loveList = new List(); loveList.Clear(); if (fileNameBtn.Text == Language.StringByID(StringId.a31Music)) { ///喜爱音乐列表 loveList.AddRange(A31MusicModel.Current.LoveMusicInfoList); } else { ///喜爱电台列表 loveList.AddRange(A31MusicModel.Current.LoveRadioInfoList); } A31LoveMusicList a31LoveMusicList = new A31LoveMusicList(); MainPage.BasePageView.AddChidren(a31LoveMusicList); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; a31LoveMusicList.Show(fileNameBtn.Text, loveList); a31LoveMusicList.UpdateSelectedMusic(); }; } } } }