From e29de9af8f507d288a61d9459fb3d1f72976876f Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 18 五月 2020 10:40:08 +0800
Subject: [PATCH] 2020-05-18-1
---
HDL-ON_Android/Assets/Phone/.DS_Store | 0
HDL-ON_Android/Assets/Language.ini | 3
HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconWhite.png | 0
HDL-ON_Android/Assets/Phone/MusicIcon/filePause.png | 0
HDL_ON/UI/Music/USBMusicList.cs | 2
HDL_ON/UI/Music/A31MusicSourcePage.cs | 8
HDL_ON/HDL_ON.projitems | 2
HDL_ON/UI/Music/View/TipView.cs | 10
HDL-ON_Android/HDL-ON_Android.csproj | 5
HDL_ON/UI/Music/A31MyList.cs | 186 ++++++++++++++++++++
/dev/null | 0
HDL_ON/UI/Music/A31MyListMusic.cs | 277 ++++++++++++++++++++++++++++++
HDL-ON_Android/Assets/Phone/MusicIcon/filePlay.png | 0
HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconBlack.png | 0
HDL_ON/.DS_Store | 0
HDL_ON/Common/R.cs | 1
HDL-ON_Android/Assets/Phone/MusicIcon/fileList.png | 0
HDL_ON/UI/Music/View/DialogView.cs | 26 ++
18 files changed, 507 insertions(+), 13 deletions(-)
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
deleted file mode 100644
index d32d15b..0000000
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
+++ /dev/null
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
deleted file mode 100644
index d74e81b..0000000
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
+++ /dev/null
Binary files differ
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index 9d5886b..0392f9c 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -180,4 +180,5 @@
5029=鎻愮ず
5030=鏄惁纭鍒犻櫎鏂囦欢澶�
5031=纭
-5032=鍚嶇О涓虹┖
\ No newline at end of file
+5032=鍚嶇О涓虹┖
+5033=宸叉坊鍔犲埌姝屽崟:
\ No newline at end of file
diff --git a/HDL-ON_Android/Assets/Phone/.DS_Store b/HDL-ON_Android/Assets/Phone/.DS_Store
index 0a85b33..3750292 100644
--- a/HDL-ON_Android/Assets/Phone/.DS_Store
+++ b/HDL-ON_Android/Assets/Phone/.DS_Store
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/MusicIcon/fileList.png b/HDL-ON_Android/Assets/Phone/MusicIcon/fileList.png
new file mode 100644
index 0000000..6df5dec
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/MusicIcon/fileList.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/MusicIcon/filePause.png b/HDL-ON_Android/Assets/Phone/MusicIcon/filePause.png
new file mode 100644
index 0000000..ffbddc7
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/MusicIcon/filePause.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/MusicIcon/filePlay.png b/HDL-ON_Android/Assets/Phone/MusicIcon/filePlay.png
new file mode 100644
index 0000000..d797e92
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/MusicIcon/filePlay.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconBlack.png b/HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconBlack.png
new file mode 100644
index 0000000..f090d46
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconBlack.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconWhite.png b/HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconWhite.png
new file mode 100644
index 0000000..302a23e
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/Public/MsgIcon/TipIconWhite.png
Binary files differ
diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj
index 288b9ce..71897bb 100644
--- a/HDL-ON_Android/HDL-ON_Android.csproj
+++ b/HDL-ON_Android/HDL-ON_Android.csproj
@@ -395,6 +395,11 @@
<AndroidAsset Include="Assets\Phone\MusicIcon\prev.png" />
<AndroidAsset Include="Assets\Phone\MusicIcon\prve1.png" />
<AndroidAsset Include="Assets\Phone\MusicIcon\clear.png" />
+ <AndroidAsset Include="Assets\Phone\Public\MsgIcon\TipIconWhite.png" />
+ <AndroidAsset Include="Assets\Phone\Public\MsgIcon\TipIconBlack.png" />
+ <AndroidAsset Include="Assets\Phone\MusicIcon\fileList.png" />
+ <AndroidAsset Include="Assets\Phone\MusicIcon\filePause.png" />
+ <AndroidAsset Include="Assets\Phone\MusicIcon\filePlay.png" />
</ItemGroup>
<Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
diff --git a/HDL_ON/.DS_Store b/HDL_ON/.DS_Store
index 8c95c54..89f7afd 100644
--- a/HDL_ON/.DS_Store
+++ b/HDL_ON/.DS_Store
Binary files differ
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 994f2de..c749c42 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -235,5 +235,6 @@
public readonly static int delMusicFile = 5030;
public readonly static int confirmMusic = 5031;
public readonly static int nameNull = 5032;
+ public readonly static int addMusicList = 5033;
}
}
\ No newline at end of file
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 8092bfc..c534b9b 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -135,6 +135,8 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\Music\View\MusicSourceView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\Music\View\SongView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\Music\View\DialogView.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\Music\A31MyList.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\Music\A31MyListMusic.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)UI\" />
diff --git a/HDL_ON/UI/Music/A31MusicSourcePage.cs b/HDL_ON/UI/Music/A31MusicSourcePage.cs
index f505d9f..86d9d12 100644
--- a/HDL_ON/UI/Music/A31MusicSourcePage.cs
+++ b/HDL_ON/UI/Music/A31MusicSourcePage.cs
@@ -192,8 +192,12 @@
};
///鎴戠殑鍒楄〃浜嬩欢
- myListView.clickBtn.MouseUpEventHandler += (sender, e) => {
-
+ myListView.clickBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ A31MyList a31MyList = new A31MyList();
+ MainPage.BasePageView.AddChidren(a31MyList);
+ a31MyList.Show();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
///鏈湴闊充箰浜嬩欢
localMusicSourceView.clickBtn.MouseUpEventHandler += (sender, e) => {
diff --git a/HDL_ON/UI/Music/A31MyList.cs b/HDL_ON/UI/Music/A31MyList.cs
new file mode 100644
index 0000000..597b9d9
--- /dev/null
+++ b/HDL_ON/UI/Music/A31MyList.cs
@@ -0,0 +1,186 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+namespace HDL_ON.UI.Music
+{
+ public class A31MyList : FrameLayout
+ {
+ public A31MyList()
+ {
+ Tag = "Music";
+ }
+ VerticalScrolViewLayout middViewLayout;
+ public void Show()
+ {
+ this.BackgroundColor = Color.ViewColor;
+ var topView = new TopView();
+ this.AddChidren(topView.TopFLayoutView());
+ topView.topNameBtn.TextID = StringId.myList;
+ topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ this.RemoveFromParent();
+ };
+
+ //鎾斁/鏆傚仠鍥炬爣
+ Button addIconBtn = new Button
+ {
+ X = Application.GetRealWidth(336),
+ Y = Application.GetRealHeight(30),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "MusicIcon/addMusic.png",
+ };
+ topView.TopFLayoutView().AddChidren(addIconBtn);
+ addIconBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ var fileNameList = new List<string>();
+ fileNameList.Clear();
+ foreach (var stringName in A31MusicModel.Current.FileLists)
+ {
+ fileNameList.Add(stringName.ListName);
+
+ }
+ new View.TipView().InputBox(StringId.addNewList, "", StringId.listNameNull, StringId.listNamesSame, fileNameList, (name) =>
+ {
+
+ A31MusicModel.Current.FileLists.Add(new FileListInfo { ListName = name, });
+ A31MusicModel.Save();
+ FileView();
+ });
+ };
+
+ middViewLayout = new VerticalScrolViewLayout
+ {
+ BackgroundColor = Color.WhiteColor,
+ Y = topView.fLayout.Bottom,
+ Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
+ };
+ this.AddChidren(middViewLayout);
+ FileView();
+
+
+
+ }
+
+ void FileView()
+ {
+ middViewLayout.RemoveAll();
+ for (int i = 0; i < A31MusicModel.Current.FileLists.Count; i++)
+ {
+ var list = A31MusicModel.Current.FileLists[i];
+ RowLayout addFlieRow = new RowLayout
+ {
+ Height = Application.GetRealHeight(122),
+ LineColor = Color.WhiteColor,
+ SubViewWidth = Application.GetRealWidth(90),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
+ };
+ middViewLayout.AddChidren(addFlieRow);
+ //鏂囦欢鍥炬爣
+ Button fileIconBtn = new Button
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetMinRealAverage(106),
+ Height = Application.GetMinRealAverage(106),
+ UnSelectedImagePath = "MusicIcon/fileList.png",
+ };
+ addFlieRow.AddChidren(fileIconBtn);
+ //鎾斁/鏆傚仠鍥炬爣
+ Button playIconBtn = new Button
+ {
+ X = Application.GetRealWidth(94),
+ Y = Application.GetRealHeight(86),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "MusicIcon/filePause.png",
+ SelectedImagePath = "MusicIcon/filePlay.png",
+ };
+ addFlieRow.AddChidren(playIconBtn);
+
+ playIconBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ //鐐瑰嚮鎸夐挳闅忔満鎾斁闊充箰
+ };
+ //鏂囦欢鍚嶆帶浠�
+ Button fileNameBtn = new Button
+ {
+ X = fileIconBtn.Right + Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(51),
+ Width = Application.GetRealWidth(217),
+ Height = Application.GetRealHeight(20),
+ TextColor = Color.TextColor,
+ TextSize = TextSize.Text14,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = list.ListName,
+ };
+ addFlieRow.AddChidren(fileNameBtn);
+ ///缂栬緫鎺т欢
+ var editBtn = new Button
+ {
+ BackgroundColor = Color.MusicEditColor,
+ Text = Language.StringByID(StringId.editMusic),
+ TextColor = Color.WhiteColor,
+ TextSize = TextSize.Text16,
+ };
+ addFlieRow.AddRightView(editBtn);
+ editBtn.MouseUpEventHandler += (sender, e) =>
+ {
+
+ var fileNameList = new List<string>();
+ fileNameList.Clear();
+ foreach (var stringName in A31MusicModel.Current.FileLists)
+ {
+ fileNameList.Add(stringName.ListName);
+
+ }
+ new View.TipView().InputBox(StringId.modifyName, list.ListName, StringId.listNameNull, StringId.listNamesSame, fileNameList, (name) =>
+ {
+ if (list.ListName != name)
+ { ///淇敼鍚嶇О涓嶄竴鏍锋洿鏂颁繚瀛�
+ list.ListName = name;
+ fileNameBtn.Text = name;
+ A31MusicModel.Save();
+ }
+ });
+
+ };
+ ///鍒犻櫎鎺т欢
+ var delBtn = new Button
+ {
+ BackgroundColor = Color.MusicDelColor,
+ Text = Language.StringByID(StringId.delMusic),
+ TextColor = Color.WhiteColor,
+ TextSize = TextSize.Text16,
+ };
+ addFlieRow.AddRightView(delBtn);
+ delBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ new View.TipView().TipBox(StringId.tip, StringId.delMusicFile, () =>
+ {
+ addFlieRow.RemoveFromParent();
+ A31MusicModel.Current.FileLists.Remove(list);
+ A31MusicModel.Save();
+ });
+ };
+
+
+ Button clickBtn = new Button
+ {
+ X = fileIconBtn.Right + Application.GetRealWidth(16),
+ Width = Application.GetRealWidth(375 - 138),
+ Height = Application.GetRealHeight(122),
+ };
+ addFlieRow.AddChidren(clickBtn);
+ clickBtn.MouseUpEventHandler += (sender, e) =>
+ {
+ A31MyListMusic a31MyListMusic = new A31MyListMusic();
+ MainPage.BasePageView.AddChidren(a31MyListMusic);
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ a31MyListMusic.Show(list);
+ };
+
+ }
+ }
+
+ }
+}
diff --git a/HDL_ON/UI/Music/A31MyListMusic.cs b/HDL_ON/UI/Music/A31MyListMusic.cs
new file mode 100644
index 0000000..432a26b
--- /dev/null
+++ b/HDL_ON/UI/Music/A31MyListMusic.cs
@@ -0,0 +1,277 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared;
+namespace HDL_ON.UI.Music
+{
+ public class A31MyListMusic : FrameLayout
+ {
+ public A31MyListMusic()
+ {
+ Tag = "Music";
+ }
+ VerticalRefreshLayout middViewLayout;
+ /// <summary>
+ /// 鍏堝姞杞界晫闈㈠嚭鏉�
+ /// </summary>
+ public void Show(FileListInfo fileListInfo)
+ {
+ #region 鐣岄潰甯冨眬------
+
+ this.BackgroundColor = Color.ViewColor;
+ var topView = new TopView();
+ this.AddChidren(topView.TopFLayoutView());
+ topView.topNameBtn.Text = fileListInfo.ListName;
+ topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
+ {
+
+ //if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive)
+ //{
+ // updateSelectedMusicThread.Abort();
+ //}
+ this.RemoveFromParent();
+ };
+ middViewLayout = new VerticalRefreshLayout
+ {
+ BackgroundColor = Color.WhiteColor,
+ Y = topView.fLayout.Bottom,
+ Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
+ };
+ this.AddChidren(middViewLayout);
+ middViewLayout.BeginHeaderRefreshingAction += () =>
+ {
+ middViewLayout.EndHeaderRefreshing();
+ };
+ #endregion
+ MusicView(fileListInfo.MusicInfoList);
+ }
+ /// <summary>
+ /// 鍔犺浇鏁版嵁鐨勬柟娉�
+ /// </summary>
+ public void MusicView(List<MusicInfo> musicList)
+ {
+ middViewLayout.RemoveAll();
+ int number = 0;
+ for (int i = 0; i < musicList.Count; i++)
+ {
+ number++;
+ var songs = musicList[i];
+ if (string.IsNullOrEmpty(songs.Title))
+ {
+ //闃叉姝屾洸鍚嶅瓧涓虹┖鎶涘紓甯�
+ songs.Title = " ";
+ }
+ if (string.IsNullOrEmpty(songs.Artist))
+ {
+ //闃叉姝屾墜鍚嶅瓧涓虹┖鎶涘紓甯�
+ songs.Artist = " ";
+ }
+ FrameLayout musicViewFl = new FrameLayout
+ {
+ Width = Application.GetRealWidth(375),
+ Height = Application.GetRealHeight(44),
+ };
+ middViewLayout.AddChidren(musicViewFl);
+ //鍒楄〃褰撳墠鎾斁闊充箰鍥炬爣
+ Button playIconBtn = new Button
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(10),
+ Width = Application.GetMinRealAverage(24),
+ Height = Application.GetMinRealAverage(24),
+ UnSelectedImagePath = "MusicIcon/playStatus.png",
+ Visible = false,
+ Name = "playStatus",
+ Tag = songs.URL,
+ };
+ musicViewFl.AddChidren(playIconBtn);
+ //姝屾洸鎺т欢
+ Button songBtn = new Button
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(11),
+ Width = Application.GetRealWidth(100),
+ Height = Application.GetRealHeight(22),
+ TextColor = Color.MusicTxet14Color,
+ TextSize = TextSize.Text16,
+ TextAlignment = TextAlignment.CenterLeft,
+ Name = "song",
+ Tag = songs.URL,
+ Text = songs.Title.Trim()
+ };
+ musicViewFl.AddChidren(songBtn);
+ var wText = songBtn.GetTextWidth();//鑾峰彇鏂囨湰瀹藉害
+ ///(姝屾洸+姝屾墜)瀹藉害鏈�澶у�兼椂280
+ if (wText > 280)
+ {
+
+ songBtn.Width = Application.GetRealWidth(280);
+ }
+ else
+ {
+ songBtn.Width = wText + 5;
+ }
+ //姝屾墜鎺т欢
+ Button singerBtn = new Button
+ {
+ X = songBtn.Right,
+ Y = Application.GetRealHeight(11),
+ Width = Application.GetRealWidth(280 - songBtn.Width),
+ Height = Application.GetRealHeight(22),
+ TextColor = Color.MusicNoTxetColor,
+ TextSize = TextSize.Text12,
+ TextAlignment = TextAlignment.CenterLeft,
+ //Text =("-" +songs.Artist).Trim(),
+ Name = "singer",
+ Tag = songs.URL,
+ Text = "-" + songs.Artist.Trim()
+ };
+ musicViewFl.AddChidren(singerBtn);
+ if (wText > 280)
+ {
+ ///姝屽悕闀垮害灏忎簬250鎵嶅彲浠ユ樉绀烘瓕鎵嬪嚭鏉�
+ singerBtn.Width = Application.GetRealWidth(0);
+ }
+ //娣诲姞鍠滅埍闊充箰鎺т欢
+ Button loveIcon = new Button
+ {
+ X = Application.GetRealWidth(291),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "MusicIcon/love.png",
+ SelectedImagePath = "MusicIcon/loveSelected.png",
+ };
+ musicViewFl.AddChidren(loveIcon);
+ loveIcon.MouseUpEventHandler += (sender, e) =>
+ {
+ loveIcon.IsSelected = !loveIcon.IsSelected;
+ if (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();
+ };
+ 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
+ {
+ X = Application.GetRealWidth(335),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetMinRealAverage(28),
+ Height = Application.GetMinRealAverage(28),
+ UnSelectedImagePath = "MusicIcon/addMusic1.png",
+ };
+ musicViewFl.AddChidren(addIcon);
+ addIcon.MouseUpEventHandler = (sender, e) =>
+ {
+ new View.DialogView { }.FieListView(songs);
+ };
+
+ //鐐瑰嚮鎺т欢
+ Button clickBtn = new Button
+ {
+ Width = Application.GetRealWidth(280),
+ Height = Application.GetRealHeight(44),
+ Tag = number,//鏍囪鎾斁鍝竴棣栨瓕鏇�
+ };
+ musicViewFl.AddChidren(clickBtn);
+ ///鐐瑰嚮鎾斁浜嬩欢
+ clickBtn.MouseUpEventHandler += (sender, e) =>
+ {
+
+ System.Threading.Tasks.Task.Run(() =>
+ {
+ System.Threading.Thread.Sleep(50);
+ Application.RunOnMainThread(() =>
+ {
+ //绉婚櫎鐣岄潰
+ A31MusicModel.Current.A31PlayStatus.Title = songBtn.Text;
+ MainPage.BasePageView.RemoveViewByTag("Music");
+ //System.Threading.Tasks.Task.Run(() =>
+ //{
+ // SendMethod.ListMusicPlay("USBDiskQueue", clickBtn.Tag);
+ //});
+ });
+ });
+
+ };
+
+ }
+ }
+ /// <summary>
+ /// 瀹氭椂鏇存柊褰撳墠鎾斁闊充箰
+ /// </summary>
+ System.Threading.Thread updateSelectedMusicThread;
+ public void UpdateSelectedMusic()
+ {
+ updateSelectedMusicThread = new System.Threading.Thread(() =>
+ {
+ while (this.Parent != null)
+ {
+ System.Threading.Thread.Sleep(1000);
+ Application.RunOnMainThread(() =>
+ {
+ try
+ {
+ for (int i = 0; i < middViewLayout.ChildrenCount; i++)
+ {
+ FrameLayout view = (FrameLayout)middViewLayout.GetChildren(i);
+ var volIconBtn = (Button)view.GetChildren(0);//鐩存帴FrameLayout鐖舵帶浠舵壘鍒拌鎺т欢Button
+ var songNameBtn = (Button)view.GetChildren(1);//鐩存帴FrameLayout鐖舵帶浠舵壘鍒拌鎺т欢Button
+ var artistNameBtn = (Button)view.GetChildren(2);//鐩存帴FrameLayout鐖舵帶浠舵壘鍒拌鎺т欢Button
+ if (A31MusicModel.Current.A31PlayStatus.TrackURL == songNameBtn.Tag.ToString())
+ {
+ volIconBtn.Visible = true;
+ songNameBtn.TextColor = Color.SelectedColor;
+ songNameBtn.X = Application.GetRealWidth(48);
+ artistNameBtn.X = songNameBtn.Right;
+ artistNameBtn.TextColor = Color.SelectedColor;
+ }
+ else
+ {
+ volIconBtn.Visible = false;
+ songNameBtn.TextColor = Color.MusicTxet14Color;
+ songNameBtn.X = Application.GetRealWidth(16);
+ artistNameBtn.X = songNameBtn.Right;
+ artistNameBtn.TextColor = Color.MusicNoTxetColor;
+ }
+
+
+ }
+ }
+ catch { }
+
+ });
+ }
+ });
+ updateSelectedMusicThread.Start();
+ }
+
+ }
+}
diff --git a/HDL_ON/UI/Music/USBMusicList.cs b/HDL_ON/UI/Music/USBMusicList.cs
index 920fa9e..32cc5ff 100644
--- a/HDL_ON/UI/Music/USBMusicList.cs
+++ b/HDL_ON/UI/Music/USBMusicList.cs
@@ -213,7 +213,7 @@
musicViewFl.AddChidren(addIcon);
addIcon.MouseUpEventHandler = (sender, e) =>
{
- new View.DialogView { }.FieListView();
+ new View.DialogView { }.FieListView(songs);
};
//鐐瑰嚮鎺т欢
diff --git a/HDL_ON/UI/Music/View/DialogView.cs b/HDL_ON/UI/Music/View/DialogView.cs
index cb4c323..b72fab6 100644
--- a/HDL_ON/UI/Music/View/DialogView.cs
+++ b/HDL_ON/UI/Music/View/DialogView.cs
@@ -5,10 +5,8 @@
{
public class DialogView
{
- public DialogView()
- {
- }
- public void FieListView()
+
+ public void FieListView(MusicInfo musicInfo)
{
//涓绘帶浠�
Dialog dialog = new Dialog()
@@ -106,14 +104,14 @@
A31MusicModel.Current.FileLists.Add(new FileListInfo { ListName = name, });
A31MusicModel.Save();
- FileView(verticalScrolViewLayout);
+ FileView(dialog, verticalScrolViewLayout, musicInfo);
});
};
- FileView(verticalScrolViewLayout);
+ FileView(dialog, verticalScrolViewLayout, musicInfo);
}
- void FileView(VerticalScrolViewLayout verticalScrolViewLayout)
+ void FileView(Dialog dialog, VerticalScrolViewLayout verticalScrolViewLayout, MusicInfo musicInfo)
{
verticalScrolViewLayout.RemoveAll();
for (int i = 0; i < A31MusicModel.Current.FileLists.Count; i++)
@@ -203,6 +201,20 @@
});
};
+ EventHandler<MouseEventArgs> click = (sender, e) =>
+ {
+
+ if (null == list.MusicInfoList.Find((music) => music.URL == musicInfo.URL))
+ {
+ list.MusicInfoList.Add(musicInfo);
+ A31MusicModel.Save();
+ }
+ dialog.Close();
+ string msg = Language.StringByID(StringId.addMusicList) + list.ListName;
+ new PublicAssmebly().TipMsgAutoClose(msg, false);
+ };
+ fileNameBtn.MouseUpEventHandler += click;
+ addFlieRow.MouseUpEventHandler += click;
}
diff --git a/HDL_ON/UI/Music/View/TipView.cs b/HDL_ON/UI/Music/View/TipView.cs
index 62bcf42..f3ba48c 100644
--- a/HDL_ON/UI/Music/View/TipView.cs
+++ b/HDL_ON/UI/Music/View/TipView.cs
@@ -119,9 +119,10 @@
TextColor = Color.TextCancelColor,
TextSize = TextSize.Text16,
TextID = StringId.cancelMusic,
+ Gravity = Gravity.BottomLeft,
};
whiteView.AddChidren(btnCancel);
-
+ btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft);
Button btnConfirm = new Button()
{
X = btnCancel.Right,
@@ -167,6 +168,7 @@
whiteView.Height = Application.GetRealHeight(183);
btnLine.Y = whiteView.Height - Application.GetRealHeight(44 + 1);
btnCancel.Y = btnLine.Bottom;
+ btnCancel.Gravity = Gravity.BottomLeft;
btnConfirm.Y = btnLine.Bottom;
btnConfirm.Gravity = Gravity.BottomRight;
@@ -289,8 +291,10 @@
TextColor = Color.TextCancelColor,
TextSize = TextSize.Text16,
TextID = StringId.cancelMusic,
+ Gravity = Gravity.BottomLeft,
};
whiteView.AddChidren(btnCancel);
+ btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft);
Button btnConfirm = new Button()
{
@@ -328,6 +332,7 @@
whiteView.Height = Application.GetRealHeight(183);
btnLine.Y = whiteView.Height - Application.GetRealHeight(44 + 1);
btnCancel.Y = btnLine.Bottom;
+ btnCancel.Gravity = Gravity.BottomLeft;
btnConfirm.Y = btnLine.Bottom;
btnConfirm.Gravity = Gravity.BottomRight;
@@ -421,9 +426,10 @@
TextColor = Color.TextCancelColor,
TextSize = TextSize.Text16,
TextID = StringId.cancelMusic,
+ Gravity = Gravity.BottomLeft,
};
whiteView.AddChidren(btnCancel);
-
+ btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft);
Button btnConfirm = new Button()
{
X = btnCancel.Right,
--
Gitblit v1.8.0