From 9f4190da49187e9df86cec915f6ba82baf6058ac Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期四, 04 六月 2020 17:45:22 +0800 Subject: [PATCH] 2020-06-04-3 --- HDL_ON/UI/Music/MusicMain.cs | 21 ------ .vs/HDL_APP_Project/xs/sqlite3/storage.ide | 0 .vs/HDL_APP_Project/xs/UserPrefs.xml | 15 ++-- .vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal | 0 HDL_ON/UI/Music/View/DialogView.cs | 111 ++++++++++++++++++++++++++++++------ 5 files changed, 102 insertions(+), 45 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index f3ce516..ef106dc 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,11 +1,13 @@ 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/View/DialogView.cs"> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/A31LoveMusicList.cs"> <Files> <File FileName="HDL_ON/UI/Music/SendMethod.cs" Line="185" Column="1" /> <File FileName="../鏃х増鏈琈usic/MyMusic.cs" Line="1412" Column="1" /> - <File FileName="HDL_ON/UI/Music/A31MusicModel.cs" Line="153" Column="51" /> - <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="196" Column="52" /> - <File FileName="HDL_ON/UI/Music/View/DialogView.cs" Line="710" Column="26" /> + <File FileName="HDL_ON/UI/Music/A31MusicModel.cs" Line="154" Column="1" /> + <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="294" Column="84" /> + <File FileName="HDL_ON/UI/Music/View/DialogView.cs" Line="561" Column="42" /> + <File FileName="HDL_ON/UI/Music/A31PlayStatus.cs" Line="1" Column="1" /> + <File FileName="HDL_ON/UI/Music/A31LoveMusicList.cs" Line="23" Column="1" /> </Files> <Pads> <Pad Id="ProjectPad"> @@ -16,9 +18,8 @@ <Node name="Entity" expanded="True" /> <Node name="UI" expanded="True"> <Node name="Music" expanded="True"> - <Node name="View" expanded="True"> - <Node name="DialogView.cs" selected="True" /> - </Node> + <Node name="View" expanded="True" /> + <Node name="A31LoveMusicList.cs" selected="True" /> </Node> <Node name="UI0-Public" expanded="True" /> <Node name="UI2" expanded="True"> diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide index 6ef20f1..89f9ab6 100644 --- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide +++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide Binary files differ diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal index b5cba23..0df1b98 100644 --- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal +++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal Binary files differ diff --git a/HDL_ON/UI/Music/MusicMain.cs b/HDL_ON/UI/Music/MusicMain.cs index ec4a084..997df56 100644 --- a/HDL_ON/UI/Music/MusicMain.cs +++ b/HDL_ON/UI/Music/MusicMain.cs @@ -201,18 +201,8 @@ musicView.View(verticalRefresh); musicView.singerBtn.Text = a31player.A31PlayStatus.Artist; musicView.songNameBtn.Text = a31player.A31PlayStatus.Title; - //musicView.musicNameBtn.Text = a31player.Name; - if (a31player.ServerClientType == 1) - { - musicView.musicNameBtn.Text = a31player.MainPlayName; - } - else - { - musicView.musicNameBtn.Text = a31player.Name; - } + musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player); musicView.regionBtn.TextID = StringId.region; - - EventHandler<MouseEventArgs> clickMergence = (sender, e) => { @@ -292,14 +282,7 @@ { musicView.singerBtn.Text = a31player.A31PlayStatus.Artist; musicView.songNameBtn.Text = a31player.A31PlayStatus.Title; - if (a31player.ServerClientType == 1) - { - musicView.musicNameBtn.Text = a31player.MainPlayName; - } - else - { - musicView.musicNameBtn.Text = a31player.Name; - } + musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player); if (a31player.A31PlayStatus.status == "play") { musicView.playBtn.IsSelected = true; diff --git a/HDL_ON/UI/Music/View/DialogView.cs b/HDL_ON/UI/Music/View/DialogView.cs index e4654dd..44b0034 100644 --- a/HDL_ON/UI/Music/View/DialogView.cs +++ b/HDL_ON/UI/Music/View/DialogView.cs @@ -342,10 +342,9 @@ TextColor = Color.TextColor, TextSize = TextSize.Text14, TextAlignment = TextAlignment.CenterLeft, - Text = player.Name, + Text = NamePlayer(player), }; PlayRow.AddChidren(PlayNameBtn); - //閫変腑鍥炬爣鎺т欢 Button selectedIconBtn = new Button @@ -404,6 +403,20 @@ if (playList1.Count <= 1) { new PublicAssmebly().TipMsgAutoClose("鑷冲皯閫変腑涓や釜浠ヤ笂鎾斁鍣�", false); + return; + } + int number = 0; + foreach (var musin in playList1) + { + if (musin.ServerClientType == 1) + { + number++; + } + } + if (number >= 2) + { + new PublicAssmebly().TipMsgAutoClose("涓嶈兘閫変腑涓や釜鎴栦袱涓互涓婁富鎾斁鍣ㄨ繘琛岀粍鍚�", false); + //濡傛灉閮芥槸涓绘挱鏀炬垜灏变笉鑳界粍鍚�; return; } ///鏌ヨ鏄惁宸茬粡瀛樺湪涓绘挱鏀�; @@ -548,19 +561,66 @@ }; verticalScrolViewLayout.AddChidren(addFlieRow); - //鎾斁鍣ㄥ悕绉版帶浠� - Button PlayNameBtn = new Button + if (player.A31PlayStatus.status == "play") { - X = Application.GetRealWidth(20), - Y = Application.GetRealHeight(15), - Width = Application.GetRealWidth(150), - Height = Application.GetRealHeight(20), - TextColor = Color.TextColor, - TextSize = TextSize.Text14, - TextAlignment = TextAlignment.CenterLeft, - Text = player.Name, - }; - addFlieRow.AddChidren(PlayNameBtn); + Button songNameBtn = new Button + { + X = Application.GetRealWidth(20), + Y = Application.GetRealHeight(15), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(20), + TextColor = Color.TextColor, + TextSize = TextSize.Text14, + TextAlignment = TextAlignment.CenterLeft, + Text = player.A31PlayStatus.Title, + }; + addFlieRow.AddChidren(songNameBtn); + + var wText = songNameBtn.GetTextWidth();//鑾峰彇鏂囨湰瀹藉害 + if (wText > 280) + { + songNameBtn.Width = Application.GetRealWidth(280); + } + else + { + songNameBtn.Width = wText + 5; + } + //姝屾墜鎺т欢 + Button singerBtn = new Button + { + X = songNameBtn.Right, + Y = Application.GetRealHeight(15), + Width = Application.GetRealWidth(280 - songNameBtn.Width), + Height = Application.GetRealHeight(20), + TextColor = Color.MusicNoTxetColor, + TextSize = TextSize.Text12, + TextAlignment = TextAlignment.CenterLeft, + Text = "-" + player.A31PlayStatus.Artist.Trim(), + }; + addFlieRow.AddChidren(singerBtn); + if (wText > 280) + { + ///姝屽悕闀垮害灏忎簬250鎵嶅彲浠ユ樉绀烘瓕鎵嬪嚭鏉� + singerBtn.Width = Application.GetRealWidth(0); + } + } + else + { + //鎾斁鍣ㄥ悕绉版帶浠� + Button PlayNameBtn = new Button + { + X = Application.GetRealWidth(20), + Y = Application.GetRealHeight(15), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(20), + TextColor = Color.TextColor, + TextSize = TextSize.Text14, + TextAlignment = TextAlignment.CenterLeft, + Text = NamePlayer(player), + }; + addFlieRow.AddChidren(PlayNameBtn); + + } //閫変腑鍥炬爣鎺т欢 Button selectedIconBtn = new Button @@ -608,7 +668,7 @@ } dialogF.Close(); dialog.Close(); - + var serverMusic = selectedBtn.Tag as A31MusicModel; MergeThreading(serverMusic, musicList1); }; @@ -680,8 +740,8 @@ TextSize = TextSize.Text16, TextAlignment = TextAlignment.Center, //TextID = StringId.selectedMergence, + Text = "閫変腑瑙i櫎鎾斁鍣�", IsBold = true, - Text= a31player.Name, }; topFra.AddChidren(txetBtn); @@ -743,7 +803,7 @@ TextColor = Color.TextColor, TextSize = TextSize.Text14, TextAlignment = TextAlignment.CenterLeft, - Text = player.Name, + Text = NamePlayer(player), }; PlayRow.AddChidren(PlayNameBtn); @@ -772,7 +832,7 @@ { clickBtn.IsSelected = !clickBtn.IsSelected; selectedIconBtn.IsSelected = clickBtn.IsSelected; - var uuid = playList2.Find((obj) => obj.UniqueDeviceName== clickBtn.Tag.ToString()); + var uuid = playList2.Find((obj) => obj.UniqueDeviceName == clickBtn.Tag.ToString()); if (selectedIconBtn.IsSelected) { if (uuid == null) @@ -810,7 +870,7 @@ dialog.Close(); RemoveThreading(a31player, playList2); }; - } + } /// <summary> /// 鍙戦�佺粍鍚堝懡浠ら�昏緫澶勭悊鐨勬柟娉� /// </summary> @@ -1064,6 +1124,19 @@ }); } + + public string NamePlayer(A31MusicModel a31player) + { + if (a31player.ServerClientType == 1) + { + return a31player.MainPlayName; + } + else + { + return a31player.Name; + } + } + } [System.Serializable] public class A31Wifi鈥� { -- Gitblit v1.8.0