From f432344ed815e5b6b88ab42bcee50b45e664472e Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 05 六月 2020 15:49:22 +0800
Subject: [PATCH] 2020-06-05-01

---
 HDL_ON/UI/Music/View/DialogView.cs |  200 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 199 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/Music/View/DialogView.cs b/HDL_ON/UI/Music/View/DialogView.cs
index 44b0034..b9aff05 100644
--- a/HDL_ON/UI/Music/View/DialogView.cs
+++ b/HDL_ON/UI/Music/View/DialogView.cs
@@ -1136,7 +1136,205 @@
                 return a31player.Name;
             }
         }
-       
+        /// <summary>
+        /// 鎾斁鍣ㄩ煶閲忕殑鐣岄潰
+        /// </summary>
+        /// <param name="a31player">涓绘挱鏀惧櫒</param>
+       public  void PlayerVolumeView(A31MusicModel a31player)
+        {
+            #region
+            //涓绘帶浠�
+            Dialog dialog = new Dialog()
+            {
+                //BackgroundColor = Color.PopupBackgroundColor,
+            };
+            dialog.Show();
+            //鐖舵帶浠�
+            FrameLayout frame = new FrameLayout { };
+            dialog.AddChidren(frame);
+            frame.MouseUpEventHandler += (sen, e) =>
+            {
+                dialog.Close();
+            };
+            //鐧借壊蹇埗鎺т欢
+            FrameLayout dialogFra = new FrameLayout()
+            {
+                X = Application.GetRealWidth(16),
+                Y = Application.GetRealHeight(397),
+                Width = Application.GetRealWidth(344),
+                Height = Application.GetRealHeight(250),
+                BackgroundColor = Color.WhiteColor,
+                Radius = (uint)Application.GetRealHeight(12),
+            };
+            frame.AddChidren(dialogFra);
+            //鏄剧ず澶撮儴淇℃伅鐖舵帶浠�
+            FrameLayout topFra = new FrameLayout()
+            {
+                Width = Application.GetRealWidth(344),
+                Height = Application.GetRealHeight(58),
+            };
+            dialogFra.AddChidren(topFra);
+            //鍙栨秷鎺т欢
+            Button cancelnBtn = new Button
+            {
+                X = Application.GetRealWidth(20),
+                Y = Application.GetRealHeight(15),
+                Width = Application.GetRealWidth(60),
+                Height = Application.GetRealHeight(20),
+                TextID = StringId.cancelMusic,
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = Color.MusicNoTxetColor,
+                TextSize = TextSize.Text14,
+            };
+            topFra.AddChidren(cancelnBtn);
+            cancelnBtn.MouseUpEventHandler += (sen, e) =>
+            {
+                dialog.Close();
+            };
+            //鏍囬鎺т欢
+            Button txetBtn = new Button
+            {
+                X = cancelnBtn.Right + Application.GetRealWidth(20),
+                Y = Application.GetRealHeight(14),
+                Width = Application.GetRealWidth(152),
+                Height = Application.GetRealHeight(22),
+                TextColor = Color.TextColor,
+                TextSize = TextSize.Text16,
+                TextAlignment = TextAlignment.Center,
+                //TextID = StringId.readyPlay,
+                Text="璋冭妭闊抽噺",
+                IsBold = true,
+            };
+            topFra.AddChidren(txetBtn);
+            //纭鎺т欢
+            Button confirmBtn = new Button
+            {
+                X = Application.GetRealWidth(344 - 60 - 20),
+                Y = Application.GetRealHeight(15),
+                Width = Application.GetRealWidth(60),
+                Height = Application.GetRealHeight(20),
+                TextID = StringId.confirmMusic,
+                TextAlignment = TextAlignment.CenterRight,
+                TextColor = Color.SelectedColor,
+                TextSize = TextSize.Text14,
+            };
+            topFra.AddChidren(confirmBtn);
+            confirmBtn.MouseUpEventHandler += (sen, e) =>
+            {
+                dialog.Close();
+            };
+
+            VerticalScrolViewLayout verticalScrolViewLayout = new VerticalScrolViewLayout
+            {
+                Y = Application.GetRealHeight(58),
+                Height = dialogFra.Height - Application.GetRealHeight(58),
+                Width = Application.GetRealWidth(343),
+            };
+            dialogFra.AddChidren(verticalScrolViewLayout);
+
+            var playList = new List<A31MusicModel>();
+            for (int i = 0; i < a31player.Slave.slave_list.Count; i++)
+            {
+                var slave = a31player.Slave.slave_list[i];
+                var music_If = A31MusicModel.A31MusicModelList.Find((c) => c.UniqueDeviceName == slave.uuid.Replace("uuid:", ""));
+                if (music_If != null)
+                {
+                    music_If.ServerClientType = -1;
+                    music_If.A31PlayStatus.vol = slave.volume;
+                    playList.Add(music_If);
+                }
+            }
+            playList.Add(a31player);
+
+            for (int i = 0; i < playList.Count; i++)
+            {
+                var player = playList[i];
+                FrameLayout volumeFra = new FrameLayout
+                {
+                    Height = Application.GetRealHeight(64),
+                };
+                verticalScrolViewLayout.AddChidren(volumeFra);
+                Button volumeTextBtn = new Button
+                {
+                    X = Application.GetRealWidth(28),
+                    Y = Application.GetRealHeight(8),
+                    Width = Application.GetRealWidth(200),
+                    Height = Application.GetRealHeight(14),
+                    TextColor = Color.MusicNoTxetColor,
+                    TextSize = TextSize.Text10,
+                    TextAlignment = TextAlignment.CenterLeft,
+                   
+                };
+                volumeFra.AddChidren(volumeTextBtn);
+                if (player.ServerClientType == -1)
+                {
+                    volumeTextBtn.Text = player.Name + "闊抽噺";
+                }
+                else if (player.ServerClientType == 1)
+                {
+                    volumeTextBtn.Text = "鎬婚煶閲�";
+                }
+
+                DiyImageSeekBar volSeekBar = new DiyImageSeekBar
+                {
+                    Y = Application.GetRealHeight(12),
+                    X = Application.GetRealWidth(28),
+                    Width = Application.GetRealWidth(240),
+                    Height = Application.GetRealHeight(54),//杩涘害鏉$埗鎺т欢鑳屾櫙楂樺害
+                    IsProgressTextShow = false,//鏄剧ず鐧惧垎姣�
+                    IsClickable = true,//杩涘害鏉℃槸鍚︽粦鍔�
+                    ProgressBarColor = Color.SelectedColor,//閫変腑杩涘害鏉¢鑹�
+                    ThumbImagePath = "MusicIcon/progressIcon.png",//杩涘害鏉℃寜閽浘鏍�
+                    ThumbImageHeight = Application.GetMinRealAverage(54),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
+                    SeekBarViewHeight = Application.GetMinRealAverage(8),//杩涘害鏉$殑楂樺害
+                    Progress=int.Parse(player.A31PlayStatus.vol),
+                    //ProgressChangeDelayTime=
+                };
+                volumeFra.AddChidren(volSeekBar);
+               
+                Button valueBtn = new Button
+                {
+                    X = Application.GetRealWidth(289),
+                    Y = Application.GetRealHeight(31),
+                    Width = Application.GetRealWidth(26),
+                    Height = Application.GetRealHeight(17),
+                    TextColor = Color.MusicNoTxetColor,
+                    TextSize = TextSize.Text12,
+                    TextAlignment = TextAlignment.CenterLeft,
+                    Text = player.A31PlayStatus.vol + "%",
+                };
+                volumeFra.AddChidren(valueBtn);
+
+                ///闊抽噺杩涘害鏉$偣鍑讳簨浠�
+                EventHandler<int> progressClick = (sender, e) =>
+                {
+                    if (player.ServerClientType == -1)
+                    {
+                        valueBtn.Text = volSeekBar.Progress + "%";
+                        SendMethod.ControlVolume(volSeekBar.Progress, player);
+                    }
+                    else if (player.ServerClientType == 1)
+                    {
+                        for (int j = 0; j < playList.Count; j++)
+                        {
+                            var music = playList[j];
+                            var frameLayout = (FrameLayout)verticalScrolViewLayout.GetChildren(j);
+                            var diyImageSeekBar = (DiyImageSeekBar)frameLayout.GetChildren(1);
+                            var button = (Button)frameLayout.GetChildren(2);
+                            diyImageSeekBar.Progress = volSeekBar.Progress;
+                            button.Text = volSeekBar.Progress + "%";
+                            SendMethod.ControlVolume(volSeekBar.Progress, music);
+                        }
+                    }
+                };
+                volSeekBar.OnProgressChangedEvent += progressClick;
+                volSeekBar.OnStopTrackingTouchEvent += progressClick;
+            }
+            #endregion
+
+        }
+
+
     }
     [System.Serializable]
     public class A31Wifi鈥�    {

--
Gitblit v1.8.0