wjc
2023-02-03 c484347d42f8c14f03f498e689069a14a45abc93
HDL_ON/UI/UI2/FuntionControlView/Music/A31MusicSourcePage.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Security;
using HDL_ON.UI.UI2.FuntionControlView.Music;
using Shared;
namespace HDL_ON.UI.Music
{
@@ -105,7 +106,7 @@
                Height = Application.GetRealHeight(352),
                Width = Application.GetRealWidth(375),
            };
            //middViewLayout.AddChidren(fL3);
            middViewLayout.AddChidren(fL3);
            View.MusicSourceView selectedSourceView = new View.MusicSourceView();
            selectedSourceView.fLayout.Height = Application.GetRealHeight(44);
@@ -114,7 +115,7 @@
            selectedSourceView.textBtn.TextSize = TextSize.Text16;
            selectedSourceView.inputTextBtn.Visible = false;
            selectedSourceView.nextLevelBtn.Visible = false;
            //selectedSourceView.FrameLayoutView(fL3, false);
            selectedSourceView.FrameLayoutView(fL3, false);
            View.MusicSourceView musicSourceView = new View.MusicSourceView();
            musicSourceView.fLayout.Y = selectedSourceView.fLayout.Bottom;
@@ -122,10 +123,16 @@
            musicSourceView.textBtn.TextID = StringId.localMusic;
            //musicSourceView.FrameLayoutView(fL3);
            View.MusicSourceView usbSourceView = new View.MusicSourceView();
            //usbSourceView.fLayout.Y = selectedSourceView.fLayout.Bottom;
            usbSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/usb.png";
            usbSourceView.textBtn.TextID = StringId.usb;
            usbSourceView.FrameLayoutView(fL3);
       
            View.MusicSourceView bluetoothSourceView = new View.MusicSourceView();
            bluetoothSourceView.fLayout.Y = musicSourceView.fLayout.Bottom;
            bluetoothSourceView.fLayout.Y = usbSourceView.fLayout.Bottom;
            bluetoothSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/bluetooth.png";
            bluetoothSourceView.textBtn.TextID = StringId.bluetooth;
            //bluetoothSourceView.FrameLayoutView(fL3);
@@ -142,24 +149,62 @@
            #endregion
            #region  所有点击事件
            ///事件
            ///本地音乐事件
            musicSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
            {
                A31MusicFileList a31MusicFileList = new A31MusicFileList();
                MainPage.BasePageView.AddChidren(a31MusicFileList);
                a31MusicFileList.Show();
                //A31UsbMusicList a31UsbMusicList = new A31UsbMusicList();
                //MainPage.BasePageView.AddChidren(a31UsbMusicList);
                //a31UsbMusicList.Show();
                //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                //Loading loading = new Loading();
                //a31UsbMusicList.AddChidren(loading);
                //loading.Start();
                //System.Threading.Tasks.Task.Run(() =>
                //{
                //    try
                //    {
                //        if (A31MusicModel.Current.UsbMusicLists.Count == 0)
                //        {
                //            SendMethod.Current.GetCurrentPalyList(A31MusicModel.Current.functionMusic);
                //        }
                //    }
                //    catch
                //    {
                //    }
                //    finally
                //    {
                //        Application.RunOnMainThread(() =>
                //        {
                //            loading.Hide();
                //            //a31UsbMusicList.FileView();
                //        });
                //    }
                //});
            };
            ///usb事件
            usbSourceView.clickBtn.MouseUpEventHandler += (sender, e) =>
            {
                A31FlieList a31FlieList = new A31FlieList(KeyProperty.sdcard, usbSourceView.textBtn.Text);
                MainPage.BasePageView.AddChidren(a31FlieList);
                a31FlieList.Show();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                Loading loading = new Loading();
                a31MusicFileList.AddChidren(loading);
                a31FlieList.AddChidren(loading);
                loading.Start();
                var listNameList = CommonMethod.Current.GetListNameListMemory(KeyProperty.sdcard);
                System.Threading.Tasks.Task.Run(() =>
                {
                    try
                    {
                        if (A31MusicModel.Current.palyLists.Count == 0)
                        {
                           SendMethod.Current.GetPalyList(A31MusicModel.Current.functionMusic);
                           
                        if (listNameList.Count == 0)
                        {
                            var Group = SendMethod.Current.GetSingleSourceListNameList(A31MusicModel.Current.functionMusic, KeyProperty.sdcard);
                            CommonMethod.Current.AddSourceGroupListMemory(Group);//保存缓存
                            listNameList.AddRange(Group.groupList);//更新列表值
                        }
                    }
                    catch
@@ -170,10 +215,11 @@
                        Application.RunOnMainThread(() =>
                        {
                            loading.Hide();
                            a31MusicFileList.FileView();
                            a31FlieList.FileListView(listNameList);
                        });
                    }
                });
            };
@@ -241,9 +287,7 @@
                    try
                    {
                        //HDL_ON.DriverLayer.Control.Ins.GetMusicDirectory(device);
                        var palyListName = Music.SendMethod.Current.GetListName(A31MusicModel.Current.functionMusic);
                        var palyList = Music.SendMethod.Current.GetListMusic(A31MusicModel.Current.functionMusic, "hdl_special");
                        var palyList = Music.SendMethod.Current.GetSingleSongList(A31MusicModel.Current.functionMusic, "hdl_special", "");
                        List<string> musicNameList = new List<string>();
                        for (int i = 0; i < palyList.songs.Count; i++)
                        {