From 2bec9c838d2d688025698de8ec1de401ffd7dd1f Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 11 八月 2020 14:13:55 +0800 Subject: [PATCH] 20200811 --- HDL_ON/UI/UI2/FuntionControlView/Music/View/SongView.cs | 123 ++++++++--------------------------------- 1 files changed, 24 insertions(+), 99 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/View/SongView.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/View/SongView.cs index e242d49..8be5b91 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/View/SongView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/View/SongView.cs @@ -7,10 +7,11 @@ /// <summary> /// 鐖舵帶浠� /// </summary> - public FrameLayout musicViewFl = new FrameLayout + public RowLayout musicViewFl = new RowLayout { Width = Application.GetRealWidth(375), Height = Application.GetRealHeight(44), + LineColor= MusicColor.WhiteColor, }; /// <summary> @@ -34,24 +35,22 @@ { X = Application.GetRealWidth(16), Y = Application.GetRealHeight(11), - Width = Application.GetRealWidth(100), + // Width = wText + Application.GetRealWidth(5), Height = Application.GetRealHeight(22), - TextColor = Color.MusicTxet14Color, + TextColor = MusicColor.MusicTxet14Color, TextSize = TextSize.Text16, TextAlignment = TextAlignment.CenterLeft, Name = "song", }; - - - /// <summary> /// 姝屾墜鎺т欢 /// </summary> public Button singerBtn = new Button { Y = Application.GetRealHeight(11), + //Width = Application.GetRealWidth(220) - wText,//姝屽悕闀垮害灏忎簬220鎵嶅彲浠ユ樉绀烘瓕鎵嬪嚭鏉� Height = Application.GetRealHeight(22), - TextColor = Color.MusicNoTxetColor, + TextColor = MusicColor.MusicNoTxetColor, TextSize = TextSize.Text12, TextAlignment = TextAlignment.CenterLeft, //Text =("-" +songs.Artist).Trim(), @@ -80,14 +79,14 @@ Y = Application.GetRealHeight(8), Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), - UnSelectedImagePath = "MusicIcon/addMusic.png", + UnSelectedImagePath = "MusicIcon/addMusic1.png", }; /// <summary> /// 鐐瑰嚮鎺т欢 /// </summary> public Button clickBtn = new Button { - Width = Application.GetRealWidth(280), + Width = Application.GetRealWidth(250), Height = Application.GetRealHeight(44), }; @@ -95,113 +94,39 @@ /// 甯冨眬姝屾洸淇℃伅鐨刅iew /// </summary> /// <returns></returns> - public FrameLayout SongFrameLayout() + public void SongFrameLayout(VerticalRefreshLayout refreshLayout, MusicInfo songs) { musicViewFl.AddChidren(playIconBtn); musicViewFl.AddChidren(songBtn); - singerBtn.X = songBtn.Right; musicViewFl.AddChidren(singerBtn); musicViewFl.AddChidren(clickBtn); musicViewFl.AddChidren(loveIcon); musicViewFl.AddChidren(addIcon); - return musicViewFl; - /* - View.SongView songView = new View.SongView(); - middViewLayout.AddChidren(songView.SongFrameLayout()); - songView.songBtn.Tag = songs.URL; - if (string.IsNullOrEmpty(songs.Title)) - { - //闃叉姝屾洸鍚嶅瓧涓虹┖鎶涘紓甯� - songs.Title = " "; - } - songView.songBtn.Text = songs.Title.Trim(); - var wText = songView.songBtn.GetTextWidth();//鑾峰彇鏂囨湰瀹藉害 - ///(姝屾洸+姝屾墜)瀹藉害鏈�澶у�兼椂280 - if (wText > 280) - { + refreshLayout.AddChidren(musicViewFl); - songView.songBtn.Width = Application.GetRealWidth(280); - } - else + playIconBtn.Tag = songs.URL; + songBtn.Tag = songs.URL; + singerBtn.Tag = songs.URL; + clickBtn.Tag = songs;//鏍囪鎾斁鍝竴棣栨瓕鏇� + songBtn.Text = string.IsNullOrEmpty(songs.Title) ? "Unkonw" : songs.Title.Trim(); + var wText = songBtn.GetTextWidth() + Application.GetRealWidth(15); + if (wText > Application.GetRealWidth(220)) { - songView.songBtn.Width = wText + 5; + wText = Application.GetRealWidth(220);//(姝屾洸+姝屾墜)瀹藉害鏈�澶у�兼椂220 } - songView.singerBtn.X = songView.songBtn.Right; - if (string.IsNullOrEmpty(songs.Artist)) - { - //闃叉姝屾墜鍚嶅瓧涓虹┖鎶涘紓甯� - songs.Artist = " "; - } - songView.singerBtn.Text = "-" + songs.Artist.Trim(); - - songView.singerBtn.Width = Application.GetRealWidth(280 - songView.songBtn.Width); - if (wText > 280) - { - ///姝屽悕闀垮害灏忎簬280鎵嶅彲浠ユ樉绀烘瓕鎵嬪嚭鏉� - songView.singerBtn.Width = Application.GetRealWidth(0); - } - - songView.loveIcon.MouseUpEventHandler += (sender, e) => - { - songView.loveIcon.IsSelected = !songView.loveIcon.IsSelected; - if (songView.loveIcon.IsSelected) - { - ///鏌ユ壘闊充箰鏄惁瀛樺湪鍦ㄥ垪琛� - var music1 = A31MusicModel.Current.LoveMusicInfoList.Find((m) => m.URL == songs.URL); - if (music1 == null) - { - ///娌℃湁瀛樺湪灏辨坊鍔� - A31MusicModel.Current.LoveMusicInfoList.Add(songs); - } - } - else - { - ///鏌ユ壘闊充箰鏄惁瀛樺湪鍦ㄥ垪琛� - var music1 = A31MusicModel.Current.LoveMusicInfoList.Find((m) => m.URL == songs.URL); - if (music1 != null) - { - ///瀛樺湪灏卞垹闄� - A31MusicModel.Current.LoveMusicInfoList.Remove(songs); - } - - } - // A31MusicModel.Save(); - }; + 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) { - songView.loveIcon.IsSelected = true; + loveIcon.IsSelected = true; } else { - songView.loveIcon.IsSelected = false; + loveIcon.IsSelected = false; } - songView.clickBtn.Tag = number;//鏍囪鎾斁鍝竴棣栨瓕鏇� - songView.clickBtn.MouseUpEventHandler += (sender, e) => - { - - System.Threading.Tasks.Task.Run(() => - { - System.Threading.Thread.Sleep(50); - Application.RunOnMainThread(() => - { - //绉婚櫎鐣岄潰 - A31MusicModel.Current.A31PlayStatus.Title = songView.songBtn.Text; - MainPage.BasePageView.RemoveViewByTag("Music"); - //A31PlayMusicPage a31PlayMusicPage = new A31PlayMusicPage(); - //MainPage.BasePageView.AddChidren(a31PlayMusicPage); - //a31PlayMusicPage.Show(); - //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - System.Threading.Tasks.Task.Run(() => - { - PlayStrinfg(songView.clickBtn.Tag); - }); - }); - }); - - }; - */ - } -- Gitblit v1.8.0