From 0c1b0cdf903114c4214f6b9298ecd440972a42b5 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 14 一月 2022 13:13:56 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/wjc' into wxr0114 --- HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 115 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs new file mode 100644 index 0000000..2982d04 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicFileList.cs @@ -0,0 +1,115 @@ +锘縰sing System; +using System.Collections.Generic; +using Shared; +namespace HDL_ON.UI.Music +{ + public class A31MusicFileList : FrameLayout + { + public A31MusicFileList() + { + Tag = "Music"; + } + VerticalRefreshLayout middViewLayout; + public void Show() + { + #region 鐣岄潰甯冨眬------ + + this.BackgroundColor = MusicColor.ViewColor; + var topView = new TopView(); + this.AddChidren(topView.TopFLayoutView()); + topView.topNameBtn.TextID = StringId.localMusic; + topView.clickBackBtn.MouseUpEventHandler += (sender, e) => + { + this.RemoveFromParent(); + }; + middViewLayout = new VerticalRefreshLayout + { + BackgroundColor = MusicColor.WhiteColor, + Y = topView.fLayout.Bottom, + Height = Application.GetRealHeight(H_W.H - H_W.T_Height), + }; + this.AddChidren(middViewLayout); + #endregion + + middViewLayout.BeginHeaderRefreshingAction += () => + { + System.Threading.Tasks.Task.Run(() => + { + try + { + SendMethod.mMethod.GetPalyList(A31MusicModel.Current.functionMusic); + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + this.FileView(); + middViewLayout.EndHeaderRefreshing(); + }); + } + }); + + }; + + } + /// <summary> + /// 鍔犺浇鏂囦欢澶筕iew鐨勬柟娉� + /// </summary> + public void FileView() + { + middViewLayout.RemoveAll(); + for (int i = 0; i < A31MusicModel.Current.palyLists.Count; i++) + { + var list = A31MusicModel.Current.palyLists[i]; + RowLayout addFlieRow = new RowLayout + { + Height = Application.GetRealHeight(104), + LineColor = MusicColor.WhiteColor, + SubViewWidth = Application.GetRealWidth(90),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛� + }; + middViewLayout.AddChidren(addFlieRow); + //鏂囦欢鍥炬爣 + Button fileIconBtn = new Button + { + X = Application.GetRealWidth(16), + Y = Application.GetRealHeight(8), + Width = Application.GetRealWidth(88), + Height = Application.GetRealWidth(88), + UnSelectedImagePath = "MusicIcon/fileList.png", + }; + addFlieRow.AddChidren(fileIconBtn); + + //鏂囦欢鍚嶆帶浠� + Button fileNameBtn = new Button + { + X = fileIconBtn.Right + Application.GetRealWidth(16), + Y = Application.GetRealHeight(42), + Width = Application.GetRealWidth(217), + Height = Application.GetRealHeight(20), + TextColor = MusicColor.TextColor, + TextSize = TextSize.Text14, + TextAlignment = TextAlignment.CenterLeft, + Text = list.group, + }; + addFlieRow.AddChidren(fileNameBtn); + + Button clickBtn = new Button + { + X = fileIconBtn.Right + Application.GetRealWidth(16), + Width = Application.GetRealWidth(375 - 138), + Height = Application.GetRealHeight(104), + }; + addFlieRow.AddChidren(clickBtn); + clickBtn.MouseUpEventHandler += (sender, e) => + { + A31SongPlay a31Song = new A31SongPlay(); + MainPage.BasePageView.AddChidren(a31Song); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + a31Song.Show(list.songs, list.group); + }; + + } + } + } +} -- Gitblit v1.8.0