| | |
| | | /// 布局歌曲信息的View |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public void SongFrameLayout(VerticalRefreshLayout refreshLayout, MusicInfo songs) |
| | | public void SongFrameLayout(VerticalRefreshLayout refreshLayout, SongInfo songs) |
| | | { |
| | | musicViewFl.AddChidren(playIconBtn); |
| | | musicViewFl.AddChidren(songBtn); |
| | | musicViewFl.AddChidren(singerBtn); |
| | | //musicViewFl.AddChidren(singerBtn); |
| | | musicViewFl.AddChidren(clickBtn); |
| | | musicViewFl.AddChidren(loveIcon); |
| | | musicViewFl.AddChidren(addIcon); |
| | | //musicViewFl.AddChidren(loveIcon); |
| | | //musicViewFl.AddChidren(addIcon); |
| | | refreshLayout.AddChidren(musicViewFl); |
| | | |
| | | playIconBtn.Tag = songs.URL; |
| | | songBtn.Tag = songs.URL; |
| | | singerBtn.Tag = songs.URL; |
| | | songBtn.Tag = songs.name; |
| | | singerBtn.Tag = songs.name; |
| | | clickBtn.Tag = songs;//标记播放哪一首歌曲 |
| | | songBtn.Text = string.IsNullOrEmpty(songs.Title) ? "Unkonw" : songs.Title.Trim(); |
| | | songBtn.Text = string.IsNullOrEmpty(songs.name) ? "Unkonw" : songs.name.Trim(); |
| | | var wText = songBtn.GetTextWidth() + Application.GetRealWidth(15); |
| | | if (wText > Application.GetRealWidth(220)) |
| | | if (wText > Application.GetRealWidth(250)) |
| | | { |
| | | wText = Application.GetRealWidth(220);//(歌曲+歌手)宽度最大值时220 |
| | | wText = Application.GetRealWidth(250);//(歌曲+歌手)宽度最大值时220 |
| | | } |
| | | songBtn.Width = wText; |
| | | singerBtn.X = songBtn.Right; |
| | | singerBtn.Width = Application.GetRealWidth(220) - wText;//歌名长度小于220才可以显示歌手出来 |
| | | singerBtn.Text = string.IsNullOrEmpty(songs.Artist) ? "-Unkonw" : "-" + songs.Artist.Trim(); |
| | | var music = A31MusicModel.Current.LoveMusicInfoList.Find((m) => m.URL == songs.URL); |
| | | if (music != null) |
| | | { |
| | | loveIcon.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | loveIcon.IsSelected = false; |
| | | } |
| | | singerBtn.Text = string.IsNullOrEmpty(songs.name) ? "-Unkonw" : "-" + songs.name.Trim(); |
| | | |
| | | } |
| | | |