| | |
| | | UnSelectedImagePath = "MusicIcon/fileList.png", |
| | | }; |
| | | addFlieRow.AddChidren(fileIconBtn); |
| | | //播放/暂停图标 |
| | | Button playIconBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(78), |
| | | Y = Application.GetRealHeight(70), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "MusicIcon/filePause.png", |
| | | SelectedImagePath = "MusicIcon/filePlay.png", |
| | | Tag= list, |
| | | }; |
| | | addFlieRow.AddChidren(playIconBtn); |
| | | |
| | | playIconBtn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | |
| | | |
| | | |
| | | ///查找当前播放音乐是否这个列表 |
| | | if (playIconBtn.IsSelected) |
| | | { |
| | | if (list.ListName == A31MusicModel.Current.A31PlayStatus.Artist && A31MusicModel.Current.A31PlayStatus.status == "play") |
| | | { |
| | | |
| | | SendMethod.Pause(A31MusicModel.Current); |
| | | A31MusicModel.Current.A31PlayStatus.status = "pause"; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (list.MusicInfoList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (list.ListName == A31MusicModel.Current.A31PlayStatus.Artist && A31MusicModel.Current.A31PlayStatus.status != "play") |
| | | { |
| | | SendMethod.Play(A31MusicModel.Current); |
| | | A31MusicModel.Current.A31PlayStatus.status = "play"; |
| | | } |
| | | else |
| | | { |
| | | ///取随机数; |
| | | var ra = new Random { }.Next(0, list.MusicInfoList.Count); |
| | | ///查找当前的音乐; |
| | | var songs = list.MusicInfoList[ra]; |
| | | //点击按钮随机播放音乐 |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | System.Threading.Thread.Sleep(50); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //移除界面 |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | SendMethod.PushList(songs, list.ListName, list.MusicInfoList,A31MusicModel.Current, "我的列表"); |
| | | }); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | }; |
| | | |
| | | //文件名控件 |
| | | Button fileNameBtn = new Button |
| | | { |
| | |
| | | var playBtn = (Button)view.GetChildren(1);//直接FrameLayout父控件找到该控件Button |
| | | var listIfon = playBtn.Tag as FileListInfo;//强制转换为FileListInfo类型; |
| | | ///查找当前播放音乐是否这个列表 |
| | | if (A31MusicModel.Current.A31PlayStatus.Artist == listIfon.ListName && A31MusicModel.Current.A31PlayStatus.status == "play") |
| | | { |
| | | playBtn.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | playBtn.IsSelected = false; |
| | | } |
| | | //if (A31MusicModel.Current.A31PlayStatus.Artist == listIfon.ListName && A31MusicModel.Current.A31PlayStatus.status == "play") |
| | | //{ |
| | | // playBtn.IsSelected = true; |
| | | //} |
| | | //else |
| | | //{ |
| | | // playBtn.IsSelected = false; |
| | | //} |
| | | } |
| | | } |
| | | catch { } |