From 24dce73df68f96c4e7ae4ef82658d5fc89f31e0b Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 23 八月 2021 09:58:33 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/FuntionControlView/Music/View/SongView.cs | 135 ++++++++++-----------------------------------
1 files changed, 30 insertions(+), 105 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..cc67593 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>
@@ -20,8 +21,8 @@
{
X = Application.GetRealWidth(16),
Y = Application.GetRealHeight(10),
- Width = Application.GetMinRealAverage(24),
- Height = Application.GetMinRealAverage(24),
+ Width = Application.GetRealWidth(24),
+ Height = Application.GetRealWidth(24),
UnSelectedImagePath = "MusicIcon/playStatus.png",
Visible = false,
Name = "playStatus",
@@ -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(),
@@ -65,8 +64,8 @@
{
X = Application.GetRealWidth(291),
Y = Application.GetRealHeight(8),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
UnSelectedImagePath = "MusicIcon/love.png",
SelectedImagePath = "MusicIcon/loveSelected.png",
};
@@ -78,16 +77,16 @@
{
X = Application.GetRealWidth(335),
Y = Application.GetRealHeight(8),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
- UnSelectedImagePath = "MusicIcon/addMusic.png",
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
+ 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