From 05fd07b753b9cc043b48569d514af3d829bd039c Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 28 五月 2020 13:08:33 +0800
Subject: [PATCH] 2020-05-28-1
---
HDL_ON/UI/Music/A31LoveMusicList.cs | 53 ++++++++++++++---------------------------------------
1 files changed, 14 insertions(+), 39 deletions(-)
diff --git a/HDL_ON/UI/Music/A31LoveMusicList.cs b/HDL_ON/UI/Music/A31LoveMusicList.cs
index d055f26..9f97cd0 100644
--- a/HDL_ON/UI/Music/A31LoveMusicList.cs
+++ b/HDL_ON/UI/Music/A31LoveMusicList.cs
@@ -17,14 +17,14 @@
/// <summary>
/// 鍏堝姞杞界晫闈㈠嚭鏉�
/// </summary>
- public void Show(string listName, List<MusicInfo>loveList)
+ public void Show()
{
#region 鐣岄潰甯冨眬------
this.BackgroundColor = Color.ViewColor;
var topView = new TopView();
this.AddChidren(topView.TopFLayoutView());
- topView.topNameBtn.Text= listName;
+ topView.topNameBtn.TextID = StringId.a31Music;
topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
{
@@ -46,17 +46,17 @@
middViewLayout.EndHeaderRefreshing();
};
#endregion
- MusicView(listName, loveList);
+ MusicView(Language.StringByID(StringId.a31Music));
}
/// <summary>
/// 鍔犺浇鏁版嵁鐨勬柟娉�
/// </summary>
- public void MusicView(string listName, List<MusicInfo> loveList)
+ public void MusicView(string listName)
{
middViewLayout.RemoveAll();
- for (int i = 0; i < loveList.Count; i++)
+ for (int i = 0; i < A31MusicModel.Current.LoveMusicInfoList.Count; i++)
{
- var songs = loveList[i];
+ var songs = A31MusicModel.Current.LoveMusicInfoList[i];
if (string.IsNullOrEmpty(songs.Title))
{
//闃叉姝屾洸鍚嶅瓧涓虹┖鎶涘紓甯�
@@ -140,45 +140,20 @@
Y = Application.GetRealHeight(8),
Width = Application.GetMinRealAverage(28),
Height = Application.GetMinRealAverage(28),
- UnSelectedImagePath = "MusicIcon/love.png",
- SelectedImagePath = "MusicIcon/loveSelected.png",
+ UnSelectedImagePath = "MusicIcon/loveSelected.png",
};
musicViewFl.AddChidren(loveIcon);
loveIcon.MouseUpEventHandler += (sender, e) =>
{
- loveIcon.IsSelected = !loveIcon.IsSelected;
- if (loveIcon.IsSelected)
+ var music= A31MusicModel.Current.LoveMusicInfoList.Find((m) => m.URL == songs.URL);
+ if (music!= null)
{
- ///鏌ユ壘闊充箰鏄惁瀛樺湪鍦ㄥ垪琛�
- 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.Current.LoveMusicInfoList.Remove(music);
}
A31MusicModel.Save();
+ musicViewFl.RemoveFromParent();
};
- var music = A31MusicModel.Current.LoveMusicInfoList.Find((m) => m.URL == songs.URL);
- if (music != null)
- {
- loveIcon.IsSelected = true;
- }
- else
- {
- loveIcon.IsSelected = false;
- }
//娣诲姞鍒版垜鐨勫垪琛�
Button addIcon = new Button
@@ -217,7 +192,7 @@
MainPage.BasePageView.RemoveViewByTag("Music");
System.Threading.Tasks.Task.Run(() =>
{
- PushList(songs, listName, loveList);
+ PushList(songs, listName, A31MusicModel.Current.LoveMusicInfoList);
});
});
});
@@ -365,7 +340,7 @@
sb.AppendLine("&lt;dc:title&gt;" + tempMusicInfo.Title + "&lt;/dc:title&gt;");
sb.AppendLine("&lt;dc:creator&gt;DJ Sanny J&lt;/dc:creator&gt;");
- sb.AppendLine("&lt;upnp:artist&gt;" + tempMusicInfo.Artist + "&lt;/upnp:artist&gt;");
+ sb.AppendLine("&lt;upnp:artist&gt;" + listName + "&lt;/upnp:artist&gt;");
sb.AppendLine("&lt;upnp:album&gt;" + tempMusicInfo.Album + "&lt;/upnp:album&gt;");
sb.AppendLine("&lt;upnp:albumArtURI&gt;unknown&lt;/upnp:albumArtURI&gt;");
sb.AppendLine("&lt;/item&gt;");
--
Gitblit v1.8.0