From ac9a9ea595168753cc45dff7f4eb9843beb2b0ca Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期五, 11 八月 2023 19:40:56 +0800 Subject: [PATCH] 2023年08月11日19:40:20 --- HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs | 48 +++ HDL_ON/UI/UI2/FuntionControlView/Aks/TyyPage.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Aks/Entity/MovieLibraryInfoEntity.cs | 13 HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs | 147 +++------ HDL_ON/HDL_ON.projitems | 2 HDL_ON/UI/UI2/FuntionControlView/Aks/DetailPage.cs | 327 ++++++++++++++++----- /dev/null | 11 HDL_ON/UI/UI2/FuntionControlView/Aks/TvPage.cs | 4 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs | 32 + HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs | 15 HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs | 165 +++++++--- HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs | 117 +++++++ HDL_ON/UI/UI2/FuntionControlView/Aks/JdhPage.cs | 4 15 files changed, 619 insertions(+), 272 deletions(-) diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 21d3415..8c7450c 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -579,14 +579,12 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CollectPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\DetailPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\TvPage.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\NumberFrameLayout.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\JdhPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\MusicPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\GfPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\TyyPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\YkqPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\SendMethod.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\Entity\AksEntiy.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\Entity\RemoteControlEntity.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\Entity\SequencerEntity.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\Entity\FilterCategoryEntity.cs" /> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs index 25caea1..c494ed2 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs @@ -30,7 +30,124 @@ } } + /// <summary> + /// 娓呯┖鎵�鏈夌紦瀛樻暟鎹� + /// </summary> + public void ClearData() { + movieLibraryInfoEntities.Clear(); + } + /// <summary> + /// 褰辩墖璇︽儏鍒楄〃 + /// </summary> + public Dictionary<string, MovieLibraryInfoEntity> movieLibraryInfoEntities = new Dictionary<string, MovieLibraryInfoEntity>(); + /// <summary> + /// 鏀惰棌褰辩墖璇︽儏鍒楄〃 + /// </summary> + public List<MovieLibrary> CollectList = new List<MovieLibrary>(); + /// <summary> + /// 娣诲姞褰辩墖璇︽儏缂撳瓨 + /// </summary> + /// <param name="movieLibraryInfo"></param> + public void AddMovieLibraryInfo(MovieLibraryInfoEntity movieLibraryInfo) + { + if (movieLibraryInfo == null) + { + return; + } + if (string.IsNullOrEmpty(movieLibraryInfo.rcId) && string.IsNullOrEmpty(movieLibraryInfo.movieId)) + { + return; + } + string key = movieLibraryInfo.rcId + "_" + movieLibraryInfo.movieId; + if (movieLibraryInfoEntities.ContainsKey(key)) + { + movieLibraryInfoEntities.Remove(key); + } + movieLibraryInfoEntities.Add(key, movieLibraryInfo); + } + /// <summary> + /// 鍒犻櫎褰辩墖璇︽儏缂撳瓨 + /// </summary> + /// <param name="key"></param> + public bool DelMovieLibraryInfo(string key) + { + if (movieLibraryInfoEntities.ContainsKey(key)) + { + return movieLibraryInfoEntities.Remove(key); + } + return true; + } + /// <summary> + /// 浠庣紦瀛樿幏鍙栧奖鐗囪鎯� + /// </summary> + /// <param name="key">瑙勫垯:rcId_movieId(閬ユ帶鍣╥d_褰辩墖id)</param> + /// <returns>涓嶅瓨鍦ㄨ繑鍥瀗ull</returns> + public MovieLibraryInfoEntity GetMovieLibraryInfo(string key) + { + if (string.IsNullOrEmpty(key)) + { + return null; + } + foreach (var dic in movieLibraryInfoEntities) + { + if (dic.Key == key) + { + return dic.Value; + } + } + return null; + } + /// <summary> + /// 娣诲姞鏀惰棌褰辩墖 + /// </summary> + /// <param name="movieLibraryInfo"></param> + public void AddCollectMovie(MovieLibrary movieLibrary) + { + if (movieLibrary == null) + { + return; + } + if (string.IsNullOrEmpty(movieLibrary.movieId)) + { + return; + } + for (int i = 0; i < CollectList.Count; i++) + { + if (CollectList[i].movieId == movieLibrary.movieId) + { + CollectList.RemoveAt(i); + CollectList.Insert(i, movieLibrary); + } + + } + } + /// <summary> + /// 鍒犻櫎娣诲姞鏀惰棌褰辩墖 + /// </summary> + /// <param name="key"></param> + public bool DelCollectMovie(MovieLibrary movieLibrary) + { + if (movieLibrary == null) + { + return false; + } + if ( string.IsNullOrEmpty(movieLibrary.movieId)) + { + return false; + } + + for (int i = 0; i < CollectList.Count; i++) + { + if (CollectList[i].movieId == movieLibrary.movieId) + { + CollectList.RemoveAt(i); + break; + } + + } + return true; + } /// <summary> /// 鑾峰彇褰遍煶涓帶灞忓垪琛� diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs index 839a0e8..5e38d48 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs @@ -135,6 +135,8 @@ //杩斿洖 this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { + //娓呯┖鎵�鏈夌紦瀛樻暟鎹� + AksCommonMethod.Current.ClearData(); this.RemoveFromParent(); }; //璁剧疆 diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs index 663707f..86a8cdb 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs @@ -1,15 +1,10 @@ 锘縰sing Shared; -using System; using System.Collections.Generic; -using System.Text; -using HDL_ON.UI.CSS; -using HDL_ON.Entity; -using HDL_ON.DriverLayer; using HDL_ON.UI.Music; -using HDL_ON.UI.UI2.Intelligence.Automation; -using System.Linq; using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView; using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; +using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity; + namespace HDL_ON.UI.UI2.FuntionControlView.Aks { /// <summary> @@ -17,88 +12,156 @@ /// </summary> public class CollectPage : FrameLayout { - public CollectPage() + public CollectPage(RemoteControlEntity remoteControlEntity) { + this.remoteControl = remoteControlEntity; + //璇荤紦瀛樻暟鎹� + this.mMovieLibraryList.AddRange(AksCommonMethod.Current.CollectList); } - - + /// <summary> + /// 褰辩墖鍒楄〃 + /// </summary> + private List<MovieLibrary> mMovieLibraryList; + /// <summary> + /// 褰撳墠鐨勯仴鎺у櫒瀵硅薄 + /// </summary> + RemoteControlEntity remoteControl; + /// <summary> + /// 褰辩墖鍒楄〃涓婁笅婊戝姩瀹瑰櫒 + /// </summary> + VerticalRefreshLayout vv; + /// <summary> + /// 褰辩墖瀹瑰櫒 + /// </summary> + CornerFramLayout imageFLayout; /// <summary> /// 澶撮儴甯冨眬 /// </summary> private TopView topView; /// <summary> - /// 鍒犻櫎璁惧鍚庨渶瑕佹洿鏂扮晫闈㈢殑鍥炶皟 + /// 褰撳墠椤垫暟 /// </summary> - public Action action; + private int pageNo=1; + + public void Show() { //鍒濆鍖朥I - this.InitTop(); + this.InitUi(); this.InitMiddle(); - //鍒濆鍖栦簨浠� - this.EventListener(); //璇诲彇鏁版嵁 + ReadData(); } /// <summary> /// 鍒濆鍖栧ご閮ㄧ晫闈� /// </summary> - private void InitTop() + private void InitUi() { this.BackgroundColor = MusicColor.ViewColor; this.topView = new TopView(); this.topView.setBtn.Visible = false; //this.topView.topNameBtn.TextID = StringId.shanchushebei; this.topView.topNameBtn.Text ="鎴戠殑鏀惰棌"; - this.AddChidren(topView.TopFLayoutView()); - } - /// <summary> - /// 鍒濆鍖栦腑閮ㄧ晫闈� - /// </summary> - private void InitMiddle() - { - - var vv = new VerticalRefreshLayout + vv = new VerticalRefreshLayout { Y = topView.fLayout.Bottom, Height = Application.GetRealHeight(H_W.H - H_W.T_Height), BackgroundColor = MusicColor.WhiteColor, }; this.AddChidren(vv); - vv.BeginHeaderRefreshingAction += () => - { - //鍏抽棴鍒锋柊View锛� - vv.EndHeaderRefreshing(); - }; - CornerFramLayout imageFLayout = new CornerFramLayout(343, 20 * 168, 0); - vv.AddChidren(imageFLayout); - imageFLayout.X = Application.GetRealWidth(16); - imageFLayout.LoadImagePage(new List<Entity.MovieLibrary>()); - imageFLayout.selectAction += (index) => - { - CommonMethod.Current.MainThread(() => - { - DetailPage detailPage = new DetailPage(); - MainPage.BasePageView.AddChidren(detailPage); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - detailPage.Show(); - }); - }; - imageFLayout.AdjustRealHeight(16); - } - /// <summary> - /// 娉ㄥ唽浜嬩欢 - /// </summary> - private void EventListener() - { //杩斿洖 this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; + } + /// <summary> + /// 鍒濆鍖栦腑閮ㄧ晫闈� + /// </summary> + private void InitMiddle() + { + if (vv == null) + { + return; + } + vv.RemoveAll(); + int count = this.mMovieLibraryList == null ? 0 : this.mMovieLibraryList.Count; + imageFLayout = new CornerFramLayout(343, count * 168, 0); + vv.AddChidren(imageFLayout); + imageFLayout.X = Application.GetRealWidth(16); + imageFLayout.LoadImagePage(this.mMovieLibraryList); + imageFLayout.AdjustRealHeight(16); + + vv.BeginHeaderRefreshingAction += () => + { + //鍏抽棴鍒锋柊View锛� + vv.EndHeaderRefreshing(); + mMovieLibraryList.Clear(); + ReadData(); + }; + imageFLayout.selectImageAction += (movieLibrary) => + { + CommonMethod.Current.MainThread(() => + { + DetailPage detailPage = new DetailPage(remoteControl, movieLibrary); + MainPage.BasePageView.AddChidren(detailPage); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + detailPage.Show(); + detailPage.action += (isUpdate) => + { + if (isUpdate) + { + this.mMovieLibraryList = AksCommonMethod.Current.CollectList; + InitMiddle(); + } + }; + }); + }; + + } + + /// <summary> + /// 鍒濆鏁版嵁 + /// </summary> + private void ReadData() + { + if (mMovieLibraryList.Count > 0) + { + CommonMethod.Current.MainThread(() => + { + //鏈夌紦瀛樻暟鎹洿鎺ュ姞杞� + InitMiddle(); + }); + return; + } + CommonMethod.Current.Loading.Start(); + CommonMethod.Current.SunThread(() => + { + try + { + this.mMovieLibraryList = SendMethod.Current.GetcollectPage(this.remoteControl.deviceId, this.remoteControl.rcId, pageNo, SendMethod.pageSize); + for (int i = 0; i < this.mMovieLibraryList.Count; i++) + { + var mMovieLibrary = this.mMovieLibraryList[i]; + var bytes = SendMethod.Current.GetImage(mMovieLibrary.posterUrl); + mMovieLibrary.imageBytes = bytes; + } + } + catch { } + finally + { + CommonMethod.Current.MainThread(() => + { + CommonMethod.Current.Loading.Hide(); + InitMiddle(); + + }); + } + }); } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs index 25a64f5..ca2f461 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs @@ -23,8 +23,14 @@ /// 鍒楄〃鏈�澶у�� /// </summary> private int mListCount; - - public Action<KeypadEntity> selectAction = null; + /// <summary> + /// 鎸夐敭鍥炶皟 + /// </summary> + public Action<KeypadEntity> selectKeyAction = null; + /// <summary> + /// 褰辩墖鍥炶皟 + /// </summary> + public Action<MovieLibrary> selectImageAction = null; /// <summary> @@ -119,7 +125,7 @@ { if (buttonFram.Tag != null&& buttonFram.Tag is KeypadEntity) { - selectAction?.Invoke((KeypadEntity)buttonFram.Tag); + selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag); } }); @@ -200,7 +206,7 @@ { if (buttonFram.Tag != null&& buttonFram.Tag is KeypadEntity) { - selectAction?.Invoke((KeypadEntity)buttonFram.Tag); + selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag); } }); @@ -265,7 +271,7 @@ return; } button.IsSelected = true; - selectAction?.Invoke((KeypadEntity)button.Tag); + selectKeyAction?.Invoke((KeypadEntity)button.Tag); }; button.MouseUpEventHandler += (sen, e) => { @@ -318,14 +324,14 @@ imageFram.SetClickListener((fl) => { - if (imageFram.Tag != null&& imageFram.Tag is KeypadEntity) + if (imageFram.Tag != null&& imageFram.Tag is MovieLibrary) { - selectAction?.Invoke((KeypadEntity)imageFram.Tag); + selectImageAction?.Invoke((MovieLibrary)imageFram.Tag); } }); //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) //{ - // selectAction?.Invoke((int)imageFram.Tag); + // selectImageAction?.Invoke((int)imageFram.Tag); //} } } @@ -335,7 +341,7 @@ /// </summary> /// <param name="mRowNumber">涓�琛屽灏戜釜鍏冪礌</param> /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</param> - public void LoadImagePage(List<KeypadEntity> mList, int mRowNumber) + public void LoadImagePage(List<MovieLibrary> mList, int mRowNumber) { if (mList == null || mList.Count == 0) { @@ -368,15 +374,15 @@ } imageFram.SetClickListener((fl) => { - if (imageFram.Tag != null) + if (imageFram.Tag != null && imageFram.Tag is MovieLibrary) { - selectAction?.Invoke((KeypadEntity)imageFram.Tag); + selectImageAction?.Invoke((MovieLibrary)imageFram.Tag); } }); //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) //{ - // selectAction?.Invoke((int)imageFram.Tag); + // selectImageAction?.Invoke((MovieLibrary)imageFram.Tag); //} @@ -428,7 +434,7 @@ keypad.category = filters.category; keypad.filterValue = filters.filterValue; keypad.filterName = filters.filterName; - selectAction?.Invoke(keypad); + selectKeyAction?.Invoke(keypad); }; horizontal.InitControl(filterCategory.filters, defaultIndex); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/NumberFrameLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/NumberFrameLayout.cs deleted file mode 100644 index 2775a50..0000000 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/NumberFrameLayout.cs +++ /dev/null @@ -1,267 +0,0 @@ -锘縰sing System; -using HDL_ON.UI.Music; -using Shared; -namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView -{ - public class NumberFrameLayout - { - public NumberFrameLayout() - { - } - private uint UpBackgroundColor = MusicColor.WhiteColor; - private uint DownBackgroundColor = 0xff454635; - private Action<Button> action = null; - public FrameLayout layout = new FrameLayout - { - - Height = Application.GetRealHeight(368), - Width = Application.GetRealWidth(343), - Radius = (uint)Application.GetRealHeight(17), - BackgroundColor = MusicColor.WhiteColor, - }; - - Button btn1 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "1", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - Button btn2 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "2", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - Button btn3 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "3", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - Button btn4 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "4", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - Button btn5 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "5", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - Button btn6 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "6", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - - Button btn7 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "7", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - Button btn8 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "8", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - Button btn9 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "9", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - Button btn0 = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "0", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - - Button btn = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - Text = "-/--", - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - - Button btn_jia = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - TextID = StringId.pindaojia, - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - - - }; - - Button btn_jian = new Button - { - Width = Application.GetRealWidth(78), - Height = Application.GetRealHeight(84), - TextID = StringId.pindaojian, - TextSize = TextSize.Text20, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsBold = true, - - - }; - - /// <summary> - /// 娣诲姞甯冨眬 - /// </summary> - /// <param name="parent"></param> - public void AddView(FrameLayout parent) - { - parent.AddChidren(layout); - layout.AddChidren(btn1); - layout.AddChidren(btn2); - layout.AddChidren(btn3); - layout.AddChidren(btn4); - layout.AddChidren(btn5); - layout.AddChidren(btn6); - layout.AddChidren(btn7); - layout.AddChidren(btn8); - layout.AddChidren(btn9); - layout.AddChidren(btn0); - layout.AddChidren(btn); - layout.AddChidren(btn_jia); - layout.AddChidren(btn_jian); - - btn1.Y = Application.GetRealHeight(16); - btn1.X = Application.GetRealWidth(16); - btn2.Y = Application.GetRealHeight(16); - btn2.X = btn1.Right; - btn3.Y = Application.GetRealHeight(16); - btn3.X = btn2.Right; - btn_jia.Y = Application.GetRealHeight(16); - btn_jia.X = btn3.Right; - - btn4.Y = btn1.Bottom; - btn4.X = Application.GetRealWidth(16); - btn5.Y = btn2.Bottom; - btn5.X = btn4.Right; - btn6.Y = btn3.Bottom; - btn6.X = btn5.Right; - btn_jian.Y = btn_jia.Bottom; - btn_jian.X = btn6.Right; - - btn7.Y = btn6.Bottom; - btn7.X = Application.GetRealWidth(16); - btn8.Y = btn5.Bottom; - btn8.X = btn7.Right; - btn9.Y = btn6.Bottom; - btn9.X = btn8.Right; - btn.Y = btn_jian.Bottom; - btn.X = btn9.Right; - - btn0.Y = btn8.Bottom; - btn0.X = Application.GetRealWidth(16 + 78); - - btn1.MouseDownEventHandler += (sen, e) => ClickListener(btn1); - - btn2.MouseDownEventHandler += (sen, e) => ClickListener(btn2); - - btn3.MouseDownEventHandler += (sen, e) => ClickListener(btn3); - - btn4.MouseDownEventHandler += (sen, e) => ClickListener(btn4); - - btn5.MouseDownEventHandler += (sen, e) => ClickListener(btn5); - - btn6.MouseDownEventHandler += (sen, e) => ClickListener(btn6); - - btn7.MouseDownEventHandler += (sen, e) => ClickListener(btn7); - - btn8.MouseDownEventHandler += (sen, e) => ClickListener(btn8); - - btn9.MouseDownEventHandler += (sen, e) => ClickListener(btn9); - - btn0.MouseDownEventHandler += (sen, e) => ClickListener(btn0); - - btn.MouseDownEventHandler += (sen, e) => ClickListener(btn); - - btn_jia.MouseDownEventHandler += (sen, e) => ClickListener(btn_jia); - - btn_jian.MouseDownEventHandler += (sen, e) => ClickListener(btn_jian); - - - } - - private void ClickListener(Button button) - { - if (button == null) - { - return; - } - button.BackgroundColor = DownBackgroundColor; - action?.Invoke(button); - button.MouseUpEventHandler += (sen, e) => - { - button.BackgroundColor = UpBackgroundColor; - }; - } - - - /// <summary> - /// 浜嬩欢鐩戝惉鏂规硶 - /// </summary> - /// <param name="action">鍥炶皟(鐐瑰嚮鎺т欢瀵硅薄</param> - public void SetClickListener(Action<Button> action) - { - this.action = action; - } - - } -} diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/DetailPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/DetailPage.cs index 0a2ebc6..8ae8e68 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/DetailPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/DetailPage.cs @@ -1,15 +1,10 @@ 锘縰sing Shared; using System; -using System.Collections.Generic; -using System.Text; -using HDL_ON.UI.CSS; -using HDL_ON.Entity; -using HDL_ON.DriverLayer; using HDL_ON.UI.Music; -using HDL_ON.UI.UI2.Intelligence.Automation; -using System.Linq; using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView; using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; +using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity; + namespace HDL_ON.UI.UI2.FuntionControlView.Aks { /// <summary> @@ -17,23 +12,69 @@ /// </summary> public class DetailPage : FrameLayout { - public DetailPage() + /// <summary> + /// + /// </summary> + /// <param name="remoteControlEntity">閬ユ帶鍣ㄥ璞�</param> + /// <param name="movieLibrary">褰辩墖瀵硅薄</param> + public DetailPage(RemoteControlEntity remoteControlEntity, MovieLibrary movieLibrary) { + this.remoteControl = remoteControlEntity; + this.movieLibrary = movieLibrary; + //浠庣紦瀛樿幏鍙� + this.movieLibraryInfo = AksCommonMethod.Current.GetMovieLibraryInfo(remoteControl.rcId + "_" + movieLibrary.movieId); } + /// <summary> + /// 褰撳墠鐨勯仴鎺у櫒瀵硅薄 + /// </summary> + RemoteControlEntity remoteControl; + /// <summary> + /// 褰辩墖璇︽儏 + /// </summary> + MovieLibraryInfoEntity movieLibraryInfo; /// <summary> /// 澶撮儴甯冨眬 /// </summary> private TopView topView; - /// <summary> - /// 鍒犻櫎璁惧鍚庨渶瑕佹洿鏂扮晫闈㈢殑鍥炶皟 - /// </summary> - public Action action; /// <summary> /// 绔嬪嵆鎾斁 /// </summary> Button btnPaly; + + /// <summary> + /// 褰辩墖 + /// </summary> + MovieLibrary movieLibrary; + + /// <summary> + /// 骞翠唤 + /// </summary> + Button btnYear; + /// <summary> + /// 鍦板尯 + /// </summary> + Button btnRegion; + /// <summary> + /// 鏀惰棌 + /// </summary> + Button btnCollectImage; + Button btnCollectText; + /// <summary> + /// 鐢靛奖绠�浠嬪唴瀹� + /// </summary> + Button btnIntroduceContent; + /// <summary> + /// 婕斿憳鍥剧墖鍒楄〃瀹瑰櫒 + /// </summary> + HorizontalScrolViewLayout horizontalFram; + + public Action<bool> action; + + + private bool isOldState; + public void Show() { @@ -43,6 +84,7 @@ //鍒濆鍖栦簨浠� this.EventListener(); //璇诲彇鏁版嵁 + ReadData(); } /// <summary> @@ -61,25 +103,31 @@ /// </summary> private void InitMiddle() { - var vv = new VerticalScrolViewLayout + var vv = new VerticalRefreshLayout { Y = topView.fLayout.Bottom, Height = Application.GetRealHeight(H_W.H - H_W.T_Height), BackgroundColor = MusicColor.WhiteColor, }; this.AddChidren(vv); + vv.BeginHeaderRefreshingAction += () => + { + vv.EndHeaderRefreshing(); + movieLibraryInfo = null; + ReadData(); + }; + BaseFramLayout baseFramLayout = new BaseFramLayout(); vv.AddChidren(baseFramLayout); - Button btnImage = new Button + ImageView btnImage = new ImageView { X = Application.GetRealWidth(16), Y = Application.GetRealHeight(16), Width = Application.GetRealWidth(140), Height = Application.GetRealHeight(180), - BackgroundColor = 0xff765723, - //UnSelectedImagePath = "AksIcon/kai.png", Radius = (uint)Application.GetRealHeight(12), + ImageBytes = movieLibrary.imageBytes, }; baseFramLayout.AddChidren(btnImage); //鐢靛奖鍚嶇О @@ -89,27 +137,27 @@ Y = Application.GetRealHeight(36), Width = Application.GetRealWidth(178), Height = Application.GetRealHeight(45), - Text = "鍡ㄨ捣鏉ヤ簡鍏勫紵浠�,骞村簳鍒嗙孩,浣犳嬁7浠�,鎴戞嬁3浠�", + Text = movieLibrary.name, TextColor = MusicColor.TextColor, TextSize = TextSize.Text16, TextAlignment = TextAlignment.CenterLeft, IsBold = true, - IsMoreLines=true, + IsMoreLines = true, }; baseFramLayout.AddChidren(btnName); this.AdjustRealWidth(btnName, 178); //骞翠唤 - Button btnYear = new Button + btnYear = new Button { X = btnImage.Right + Application.GetRealWidth(16), Y = btnName.Bottom + Application.GetRealHeight(12), Width = Application.GetRealWidth(34), Height = Application.GetRealHeight(20), - Text = "2023", TextColor = MusicColor.TextColor, TextSize = TextSize.Text14, TextAlignment = TextAlignment.CenterLeft, + Text = movieLibraryInfo == null ? "" : movieLibraryInfo.releaseDate, }; baseFramLayout.AddChidren(btnYear); this.AdjustRealWidth(btnYear, 34); @@ -128,16 +176,16 @@ baseFramLayout.AddChidren(btnSlope); //鍦板尯 - Button btnRegion = new Button + btnRegion = new Button { X = btnSlope.Right + Application.GetRealWidth(8), Y = btnName.Bottom + Application.GetRealHeight(12), Width = Application.GetRealWidth(140), Height = Application.GetRealHeight(20), - Text = "涓浗濂界數褰�", TextColor = MusicColor.TextColor, TextSize = TextSize.Text14, TextAlignment = TextAlignment.CenterLeft, + Text = movieLibraryInfo == null ? "" : movieLibraryInfo.area, }; baseFramLayout.AddChidren(btnRegion); this.AdjustRealWidth(btnRegion, 140); @@ -150,7 +198,7 @@ Y = btnYear.Bottom + Application.GetRealHeight(20), Width = Application.GetRealWidth(45), Height = Application.GetRealHeight(43), - Text = "9.9", + Text = movieLibrary.rating, TextSize = 32, TextColor = MusicColor.TextColor, TextAlignment = TextAlignment.CenterLeft, @@ -170,11 +218,12 @@ TextColor = 0xffA5AEBC, TextSize = TextSize.Text12, TextAlignment = TextAlignment.CenterLeft, + Text = movieLibraryInfo == null ? "" : movieLibraryInfo.rating, }; baseFramLayout.AddChidren(btnScore); - Button btnCollectImage = new Button + btnCollectImage = new Button { X = btnImage.Right + Application.GetRealWidth(167), Y = btnRegion.Bottom + Application.GetRealHeight(12), @@ -182,10 +231,11 @@ Height = Application.GetRealWidth(32), UnSelectedImagePath = "MusicIcon/collect.png", SelectedImagePath = "MusicIcon/collectSelected.png", + IsSelected = movieLibraryInfo == null ? false : movieLibraryInfo.collect, }; baseFramLayout.AddChidren(btnCollectImage); - Button btnCollectText = new Button + btnCollectText = new Button { X = btnImage.Right + Application.GetRealWidth(169), Y = btnCollectImage.Bottom + Application.GetRealHeight(2), @@ -197,38 +247,44 @@ TextAlignment = TextAlignment.CenterLeft, }; baseFramLayout.AddChidren(btnCollectText); + if (btnCollectImage.IsSelected) { + btnCollectText.TextID = StringId.yishoucang; + } else { + btnCollectText.TextID = StringId.weishoucang; + } + isOldState = btnCollectImage.IsSelected; //鐢靛奖绠�浠� Button btnIntroduceTitle = new Button { - X =Application.GetRealWidth(16), + X = Application.GetRealWidth(16), Y = btnImage.Bottom + Application.GetRealHeight(28), Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(23), //TextID = StringId., - Text= "鐢靛奖绠�浠�", + Text = "鐢靛奖绠�浠�", TextColor = MusicColor.TextColor, TextSize = TextSize.Text16, TextAlignment = TextAlignment.CenterLeft, - IsBold=true, + IsBold = true, }; baseFramLayout.AddChidren(btnIntroduceTitle); //鐢靛奖绠�浠嬪唴瀹� - Button btnIntroduceContent = new Button + btnIntroduceContent = new Button { X = Application.GetRealWidth(16), Y = btnIntroduceTitle.Bottom + Application.GetRealHeight(12), Width = Application.GetRealWidth(343), Height = Application.GetRealHeight(140), //TextID = StringId., - Text = "鐢靛奖鍚嶇О锛氥�婂彲鎬曠殑涓�鍫傝銆嬬數褰遍暱搴︼細澶х害1灏忔椂宸﹀彸婕斿憳浠嬬粛锛氫富浜哄叕锛氭湰浜猴紙涔熷氨鏄垜锛夐厤瑙掞細琛ㄥ摜銆佽〃鍝ョ殑濡堝銆佹湰浜虹殑濡堝銆佸彲鎬曠殑鑰佸笀鍜屼竴浜涘鐢熷奖鐗囩畝浠嬶細鍦ㄤ竴涓槼鍏夋槑濯氱殑鏃╂櫒锛屾垜鍜岃〃鍝ヨ鍚勮嚜鐨勫濡堥�肩潃鍘讳竴涓嫳璇鏍″鑻辫銆傝櫧鐒舵棭鏅ㄩ槼鍏夋槑濯氾紝浣嗘垜鐨勫績閲屽嵈鍦ㄤ笅鐫�澶ч洦锛堝績鎯呭緢涓嶅ソ锛夛紝瑕佹槸鑻辫璇捐兘鍙樻垚鐢佃剳璇惧氨濂戒簡锛堟垜鐨勫己椤癸級", TextColor = MusicColor.TextCancelColor, TextSize = TextSize.Text14, TextAlignment = TextAlignment.TopLeft, IsBold = true, - IsMoreLines=true, + IsMoreLines = true, + Text = movieLibraryInfo == null ? "" : movieLibraryInfo.introduction, }; baseFramLayout.AddChidren(btnIntroduceContent); @@ -249,56 +305,16 @@ }; baseFramLayout.AddChidren(btnActor); - - HorizontalScrolViewLayout horizontalFram = new HorizontalScrolViewLayout { - Y= btnActor.Bottom+ Application.GetRealHeight(12), + + horizontalFram = new HorizontalScrolViewLayout + { + Y = btnActor.Bottom + Application.GetRealHeight(12), X = Application.GetRealWidth(16), - Height =Application.GetRealHeight(112), - Width=Application.GetRealWidth(375-16), + Height = Application.GetRealHeight(112), + Width = Application.GetRealWidth(375 - 16), }; baseFramLayout.AddChidren(horizontalFram); - - for (int i = 0; i < 6; i++) - { - FrameLayout actorFrame = new FrameLayout - { - Height = Application.GetRealHeight(112), - Width = Application.GetRealWidth(72), - }; - horizontalFram.AddChidren(actorFrame); - - Button btnActorImage = new Button - { - Width = Application.GetRealWidth(72), - Height = Application.GetRealHeight(84), - Radius = (uint)Application.GetRealHeight(8), - //UnSelectedImagePath = "Collection/CollectionGrayIcon.png", - BackgroundColor = 0xff765876, - }; - actorFrame.AddChidren(btnActorImage); - - - Button btnActorName = new Button - { - Y = btnActorImage.Bottom + Application.GetRealHeight(8), - Width = Application.GetRealWidth(72), - Height = Application.GetRealHeight(20), - TextSize = TextSize.Text14, - TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, - IsMoreLines = true, - Text = "鍒樺痉鍗�", - }; - actorFrame.AddChidren(btnActorName); - - //闂撮殧,寮勪釜绌虹殑杩涘幓鍗犱綅缃� - Button btnSpacing = new Button - { - Width = Application.GetRealWidth(8), - }; - horizontalFram.AddChidren(btnSpacing); - } - + LoadActorPage(); #endregion @@ -312,14 +328,65 @@ TextColor = MusicColor.WhiteColor, TextSize = TextSize.Text16, TextAlignment = TextAlignment.Center, - Gravity=Gravity.CenterHorizontal, - BackgroundColor=MusicColor.SelectedColor, - Radius=(uint)Application.GetRealHeight(22), + Gravity = Gravity.CenterHorizontal, + BackgroundColor = MusicColor.SelectedColor, + Radius = (uint)Application.GetRealHeight(22), }; baseFramLayout.AddChidren(btnPaly); baseFramLayout.AdjustRealHeight(37); } + /// <summary> + /// 鍔犺浇婕斿憳鍥剧墖鍒楄〃 + /// </summary> + private void LoadActorPage() + { + if (this.movieLibraryInfo == null || this.movieLibraryInfo.actors.Count == 0) + { + return; + } + for (int i = 0; i < this.movieLibraryInfo.actors.Count; i++) + { + var actors = this.movieLibraryInfo.actors[i]; + FrameLayout actorFrame = new FrameLayout + { + Height = Application.GetRealHeight(112), + Width = Application.GetRealWidth(72), + }; + horizontalFram.AddChidren(actorFrame); + + ImageView btnActorImage = new ImageView + { + Width = Application.GetRealWidth(72), + Height = Application.GetRealHeight(84), + Radius = (uint)Application.GetRealHeight(8), + ImageBytes = actors.imageBytes, + }; + actorFrame.AddChidren(btnActorImage); + + + Button btnActorName = new Button + { + Y = btnActorImage.Bottom + Application.GetRealHeight(8), + Width = Application.GetRealWidth(72), + Height = Application.GetRealHeight(20), + TextSize = TextSize.Text14, + TextColor = MusicColor.TextColor, + TextAlignment = TextAlignment.Center, + IsMoreLines = true, + Text = actors.actorName, + }; + actorFrame.AddChidren(btnActorName); + + //闂撮殧,寮勪釜绌虹殑杩涘幓鍗犱綅缃� + Button btnSpacing = new Button + { + Width = Application.GetRealWidth(8), + }; + horizontalFram.AddChidren(btnSpacing); + } + } + /// <summary> /// 娉ㄥ唽浜嬩欢 /// </summary> @@ -328,15 +395,111 @@ //杩斿洖 this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { + action(isOldState != btnCollectImage.IsSelected); this.RemoveFromParent(); }; //绔嬪嵆鎾斁 this.btnPaly.MouseUpEventHandler += (sender, e) => { - + CommonMethod.Current.Loading.Start(); + CommonMethod.Current.SunThread(() => + { + try + { + SendMethod.Current.MovieLibraryPlay(remoteControl.deviceId, remoteControl.rcId, movieLibrary.movieId); + } + catch { } + finally + { + CommonMethod.Current.MainThread(() => + { + CommonMethod.Current.Loading.Hide(); + }); + } + }); }; + //鏀惰棌 + EventHandler<MouseEventArgs> CollectClick = (sender, e) => + { + btnCollectImage.IsSelected = !btnCollectImage.IsSelected; + if (btnCollectImage.IsSelected) + { + btnCollectText.TextID = StringId.yishoucang; + } + else + { + btnCollectText.TextID = StringId.weishoucang; + } + CommonMethod.Current.Loading.Start(); + CommonMethod.Current.SunThread(() => + { + try + { + var isBool = SendMethod.Current.IsCollect(remoteControl.deviceId, remoteControl.rcId, movieLibrary.movieId, btnCollectImage.IsSelected); + if (isBool) + { + //鎴愬姛鍚庢墠鏇存柊缂撳瓨鏁版嵁 + if (btnCollectImage.IsSelected) + { + AksCommonMethod.Current.AddCollectMovie(movieLibrary); + } + else + { + AksCommonMethod.Current.DelCollectMovie(movieLibrary); + } + } + } + catch { } + }); + }; + btnCollectImage.MouseUpEventHandler += CollectClick; + btnCollectText.MouseUpEventHandler += CollectClick; } + + /// <summary> + /// 鍒濆鏁版嵁 + /// </summary> + private void ReadData() + { + if (this.movieLibraryInfo != null) + { + return; + } + + + + CommonMethod.Current.Loading.Start(); + CommonMethod.Current.SunThread(() => + { + try + { + this.movieLibraryInfo = SendMethod.Current.GetMovieLibraryInfo(remoteControl.deviceId, remoteControl.rcId, movieLibrary.movieId); + if (movieLibraryInfo.actors.Count == 0) + { + return; + } + for (int i = 0; i < movieLibraryInfo.actors.Count; i++) + { + movieLibraryInfo.actors[i].imageBytes = SendMethod.Current.GetImage(movieLibraryInfo.actors[i].actorUrl); + } + } + catch { } + finally + { + CommonMethod.Current.MainThread(() => + { + CommonMethod.Current.Loading.Hide(); + btnYear.Text = movieLibraryInfo.releaseDate; + btnRegion.Text = movieLibraryInfo.area; + btnCollectImage.IsSelected = movieLibraryInfo.collect; + btnIntroduceContent.Text = movieLibraryInfo.introduction; + LoadActorPage(); + AksCommonMethod.Current.AddMovieLibraryInfo(movieLibraryInfo); + }); + } + }); + } /// <summary> /// 閲嶆柊璁$畻button瀹藉害 /// </summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/Entity/AksEntiy.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/Entity/AksEntiy.cs deleted file mode 100644 index e579cec..0000000 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/Entity/AksEntiy.cs +++ /dev/null @@ -1,11 +0,0 @@ -锘縰sing System; -namespace HDL_ON.UI.UI2.FuntionControlView.Aks.Entity -{ - public class AksEntiy - { - public AksEntiy() - { - } - - } -} diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/Entity/MovieLibraryInfoEntity.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/Entity/MovieLibraryInfoEntity.cs index 14d1cc6..0e0cced 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/Entity/MovieLibraryInfoEntity.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/Entity/MovieLibraryInfoEntity.cs @@ -7,7 +7,14 @@ /// </summary> public class MovieLibraryInfoEntity { - + /// <summary> + /// 閬ユ帶鍣╥d(鑷畾涔�) + /// </summary> + public string rcId = string.Empty; + /// <summary> + /// 璁惧id(鑷畾涔�) + /// </summary> + public string deviceId = string.Empty; /// <summary> /// 褰辩墖id /// </summary> @@ -59,6 +66,10 @@ /// 涓绘紨鍚嶇О /// </summary> public string actorName = string.Empty; + /// <summary> + /// 褰辩墖鏁版嵁(鑷畾涔�) + /// </summary> + public byte[] imageBytes; } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs index 0c297a2..3a8f805 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs @@ -52,7 +52,7 @@ private void EventListener() { - cornerFram.selectAction += (value) => + cornerFram.selectKeyAction += (value) => { Console.WriteLine("1"); }; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/JdhPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/JdhPage.cs index 7d8ca90..dbb1b44 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/JdhPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/JdhPage.cs @@ -71,12 +71,12 @@ private void EventListener() { //鍔熻兘閿帶鍒� - cornerTopFram.selectAction += (value) => + cornerTopFram.selectKeyAction += (value) => { Console.WriteLine("1"); }; //鏁板瓧閿帶鍒� - numberFrame.selectAction += (s) => + numberFrame.selectKeyAction += (s) => { Console.WriteLine("鎵撳嵃====" + s); }; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs index a4de234..668d031 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs @@ -54,7 +54,7 @@ private void EventListener() { - cornerFram.selectAction += (value) => + cornerFram.selectKeyAction += (value) => { Console.WriteLine("1"); }; @@ -124,31 +124,34 @@ this.AddChidren(btnTitle); cornerFram = new CornerFramLayout(343, 452, 17); + this.AddChidren(cornerFram); cornerFram.X = Application.GetRealWidth(16); cornerFram.Y = btnTitle.Bottom + Application.GetRealHeight(16); - this.AddChidren(cornerFram); cornerFram.SetMargin(16, 0, 16, 0); cornerFram.LoadButtonPage(AksCommonMethod.Current.GetMusicKeypadList(), 4); CornerFramLayout cornerBottomFram = new CornerFramLayout(343, 364, 17); + this.AddChidren(cornerBottomFram); cornerBottomFram.X = Application.GetRealWidth(16); cornerBottomFram.Y = cornerFram.Bottom + Application.GetRealHeight(16); cornerBottomFram.BackgroundColor = MusicColor.WhiteColor; cornerBottomFram.Radius = (uint)Application.GetRealHeight(17); - this.AddChidren(cornerBottomFram); + typeSingleFramLayout = new TypeSingleFramLayout(); - typeSingleFramLayout.singleFramLayout.Y = Application.GetRealHeight(24); typeSingleFramLayout.AddView(cornerBottomFram); + typeSingleFramLayout.singleFramLayout.Y = Application.GetRealHeight(24); + menuFram = new MenuFramLayout(); - menuFram.Y = typeSingleFramLayout.singleFramLayout.Bottom + Application.GetRealHeight(32); menuFram.AddView(cornerBottomFram); + menuFram.Y = typeSingleFramLayout.singleFramLayout.Bottom + Application.GetRealHeight(32); + typeMultiFramLayout = new TypeMultiFramLayout(); - typeMultiFramLayout.multiFramLayout.Y = menuFram.Bottom + Application.GetRealHeight(32); typeMultiFramLayout.AddView(cornerBottomFram); + typeMultiFramLayout.multiFramLayout.Y = menuFram.Bottom + Application.GetRealHeight(32); //typeMultiFramLayout.btnBottonRightName.TextID = StringId.bofangqi; typeMultiFramLayout.btnBottonRightName.Text = this.remoteControl.name; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs index 0e13859..c276894 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs @@ -7,6 +7,7 @@ using HDL_ON.Entity; using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity; using Newtonsoft.Json.Linq; +using RestSharp; namespace HDL_ON.UI.UI2.FuntionControlView.Aks { @@ -194,7 +195,7 @@ /// <param name="pageSize">椤垫暟</param> /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param> /// <returns>杩斿洖缁撴灉涓嶄細涓簄ull</returns> - public List<MovieLibrary> GetMovieLibraryPage(string deviceId, string rcId, List<Filters> filterCategorys, int pageNo, int pageSize, TipType tipType = TipType.flicker) + public List<MovieLibrary> GetMovieLibraryPage(string deviceId, string rcId, List<Filters> filterCategorys, int pageNo, int pageSize, TipType tipType = TipType.flicker) { JObject jObject = new JObject(); @@ -240,6 +241,7 @@ /// <param name="rcId">閬ユ帶鍣╥d</param> /// <param name="movieId">褰辩墖id</param> /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param> + /// <returns>杩斿洖缁撴灉涓嶄細涓簄ull</returns> public MovieLibraryInfoEntity GetMovieLibraryInfo(string deviceId, string rcId, string movieId, TipType tipType = TipType.flicker) { @@ -250,7 +252,7 @@ jObject.Add("movieId", movieId);//褰辩墖id //d.Add("zoneType", deviceId);//鍖哄煙 - var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(jObject.ToString(), NewAPI.Api_Post_Aks_MovieLibraryInfo, "褰辩墖璇︽儏鑾峰彇"); + var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(jObject, NewAPI.Api_Post_Aks_MovieLibraryInfo, "褰辩墖璇︽儏鑾峰彇"); if (!this.DataChecking(responsePackNew, tipType)) { return new MovieLibraryInfoEntity(); @@ -260,6 +262,8 @@ { return new MovieLibraryInfoEntity(); } + movieLibraryEntity.rcId = rcId; + movieLibraryEntity.deviceId = deviceId; return movieLibraryEntity; } @@ -314,7 +318,7 @@ jObject.Add("pageNo", pageNo);//褰撳墠椤� jObject.Add("pageSize", pageSize);//椤垫暟 //d.Add("zoneType", deviceId);//鍖哄煙 - var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(jObject.ToString(), NewAPI.Api_Post_Aks_Controlist, "鏀惰棌褰辩墖鍒嗛〉鑾峰彇"); + var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(jObject, NewAPI.Api_Post_Aks_MovieLibraryCollectPage, "鏀惰棌褰辩墖鍒嗛〉鑾峰彇"); if (!this.DataChecking(responsePackNew, tipType)) { return new List<MovieLibrary>(); @@ -352,7 +356,44 @@ return true; } + /// <summary> + /// 鑾峰彇褰辩墖 + /// </summary> + /// <param name="imageUrl">鍥剧墖鍦板潃</param> + public byte[] GetImage(string imageUrl, int mTimeout = 3) + { + return RequestHttpsBase(imageUrl, mTimeout); + } + #endregion + + + /// <summary> + /// 缃戠粶璇锋眰 + /// </summary> + /// <param name="mTimeout"></param> + /// <returns></returns> + private byte[] RequestHttpsBase(string imageUrl, int mTimeout = 3) + { + + try + { + Log($"{DateTime.Now}->鍙戦��->鑾峰彇褰辩墖璧勬簮", imageUrl, ""); + RestClient client = new RestClient(imageUrl); + RestRequest request = new RestRequest(Method.GET); + request.Timeout = mTimeout * 1000; + //request.AddHeader("content-type", "application/json"); + IRestResponse response = client.Execute(request); + return response.RawBytes; + + } + catch (Exception ex) + { + return null; + } + + + } /// <summary> ///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛� @@ -371,6 +412,7 @@ } + /// <summary> /// <summary> /// 妫�楠屾暟鎹洖澶嶆垚鍔熸垨鑰呭け璐� diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/TvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/TvPage.cs index 30765ca..8a43e9c 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/TvPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/TvPage.cs @@ -70,12 +70,12 @@ private void EventListener() { //鍔熻兘閿帶鍒� - cornerTopFram.selectAction += (value) => + cornerTopFram.selectKeyAction += (value) => { Console.WriteLine("1"); }; //鏁板瓧閿帶鍒� - numberFrame.selectAction += (s) => + numberFrame.selectKeyAction += (s) => { Console.WriteLine("鎵撳嵃====" + s); }; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/TyyPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/TyyPage.cs index cf64a26..4425f01 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/TyyPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/TyyPage.cs @@ -59,7 +59,7 @@ //鍔熻兘閿帶鍒� - cornerTopFram.selectAction += (value) => + cornerTopFram.selectKeyAction += (value) => { Console.WriteLine("1"); }; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs index cd1c0af..edf6293 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs @@ -1,19 +1,9 @@ 锘縰sing Shared; -using System; using System.Collections.Generic; -using System.Text; -using HDL_ON.UI.CSS; -using HDL_ON.Entity; -using HDL_ON.DriverLayer; using HDL_ON.UI.Music; -using System.Linq; using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView; using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity; -using HDL_ON.DAL.Server; -using System.Net; -using System.IO; -using RestSharp; namespace HDL_ON.UI.UI2.FuntionControlView.Aks { @@ -32,6 +22,10 @@ this.remoteControl = remoteControlEntity; } /// <summary> + /// 褰撳墠鐨勯仴鎺у櫒瀵硅薄 + /// </summary> + RemoteControlEntity remoteControl; + /// <summary> /// 褰辩墖鍒嗙被鍒楄〃 /// </summary> List<FilterCategoryEntity> mFilterCategoryList; @@ -39,10 +33,6 @@ /// 褰辩墖鍒楄〃 /// </summary> List<MovieLibrary> mMovieLibraryList; - /// <summary> - /// 褰撳墠鐨勯仴鎺у櫒瀵硅薄 - /// </summary> - RemoteControlEntity remoteControl; /// <summary> /// 澶撮儴甯冨眬 /// </summary> @@ -59,14 +49,16 @@ CornerFramLayout horizontalFl; CornerFramLayout imageFLayout; + /// <summary> + /// 椤垫暟 + /// </summary> + private int pageNo = 1; public void Show() { //鍒濆鍖朥I this.InitUI(); - //鍒濆鍖栦簨浠剁洃鍚櫒 - this.EventListener(); //璇诲彇鏁版嵁 this.ReadData(); @@ -91,96 +83,88 @@ BackgroundColor = MusicColor.WhiteColor, }; this.AddChidren(fLayout); - this.LoadFTypeLayout(); + //this.LoadFTypeLayout(); + //this.LoadImageFLayout(); + //杩斿洖 + this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => + { + this.RemoveFromParent(); + }; + //鏀惰棌鐐瑰嚮浜嬩欢 + this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) => + { + CommonMethod.Current.MainThread(() => + { + + CollectPage collectPage = new CollectPage(remoteControl); + MainPage.BasePageView.AddChidren(collectPage); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + collectPage.Show(); + }); + }; } /// <summary> - /// 鍔犺浇绫诲瀷甯冨眬 + /// 鍔犺浇鍒嗙被甯冨眬 /// </summary> private void LoadFTypeLayout() { - if (fLayout == null) - { - return; - } + fLayout.RemoveAll(); int count = this.mFilterCategoryList == null ? 0 : this.mFilterCategoryList.Count; horizontalFl = new CornerFramLayout(375, count * 75); fLayout.AddChidren(horizontalFl); - horizontalFl.LoadHorizontalPage(this.mFilterCategoryList); horizontalFl.AdjustRealHeight(20); - vv = new VerticalRefreshLayout() { Y = horizontalFl.Bottom, Height = fLayout.Height - horizontalFl.Bottom, }; fLayout.AddChidren(vv); - vv.BeginHeaderRefreshingAction += () => + //浜岀骇杩囨护浜嬩欢 + horizontalFl.selectKeyAction += (filters) => { - //鍏抽棴鍒锋柊View锛� - vv.EndHeaderRefreshing(); + + }; - LoadImageFLayout(); } /// <summary> /// 鍔犺浇褰辩墖鍒楄〃甯冨眬 /// </summary> private void LoadImageFLayout() { - if (vv == null) { return; } vv.RemoveAll(); - imageFLayout = new CornerFramLayout(343, 20 * 168, 0); + int count =this.mMovieLibraryList == null ? 0 : this.mMovieLibraryList.Count; + imageFLayout = new CornerFramLayout(343, count * 168, 0); vv.AddChidren(imageFLayout); imageFLayout.X = Application.GetRealWidth(16); imageFLayout.LoadImagePage(this.mMovieLibraryList); imageFLayout.AdjustRealHeight(16); - } - /// 娉ㄥ唽浜嬩欢 - /// </summary> - private void EventListener() - { - //杩斿洖 - this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => - { - this.RemoveFromParent(); - }; - //璁剧疆 - this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) => - { - CommonMethod.Current.MainThread(() => - { - - CollectPage collectPage = new CollectPage(); - MainPage.BasePageView.AddChidren(collectPage); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - collectPage.Show(); - }); - }; - //浜岀骇杩囨护浜嬩欢 - horizontalFl.selectAction += (filters) => - { - - - }; //褰辩墖浜嬩欢 - imageFLayout.selectAction += (index) => + imageFLayout.selectImageAction += (movieLibrary) => { CommonMethod.Current.MainThread(() => { - DetailPage detailPage = new DetailPage(); + DetailPage detailPage = new DetailPage(remoteControl, movieLibrary); MainPage.BasePageView.AddChidren(detailPage); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; detailPage.Show(); }); }; + //涓嬫媺鍒锋柊 + vv.BeginHeaderRefreshingAction += () => + { + //鍏抽棴鍒锋柊View锛� + vv.EndHeaderRefreshing(); + }; } + /// <summary> /// 鍒濆鏁版嵁 /// </summary> @@ -192,13 +176,14 @@ try { this.mFilterCategoryList = SendMethod.Current.GetFilterCategoryLits(this.remoteControl.deviceId, this.remoteControl.rcId); - this.mMovieLibraryList = SendMethod.Current.GetMovieLibraryPage(this.remoteControl.deviceId, this.remoteControl.rcId, new List<Filters>(), 1, SendMethod.pageSize); + + this.mMovieLibraryList = SendMethod.Current.GetMovieLibraryPage(this.remoteControl.deviceId, this.remoteControl.rcId, new List<Filters>(), pageNo, SendMethod.pageSize); for (int i = 0; i < this.mMovieLibraryList.Count; i++) { var mMovieLibrary = this.mMovieLibraryList[i]; - var bytes = RequestHttpsBase(mMovieLibrary.posterUrl); + var bytes = SendMethod.Current.GetImage(mMovieLibrary.posterUrl); mMovieLibrary.imageBytes = bytes; - + } } catch { } @@ -207,46 +192,14 @@ CommonMethod.Current.MainThread(() => { CommonMethod.Current.Loading.Hide(); - LoadFTypeLayout(); + this.LoadFTypeLayout(); + this.LoadImageFLayout(); }); } }); - - } - - - - - /// <summary> - /// 缃戠粶璇锋眰 - /// </summary> - /// <param name="mTimeout"></param> - /// <returns></returns> - private byte[] RequestHttpsBase(string imageUrl, int mTimeout = 5) - { - - try - { - RestClient client = new RestClient(imageUrl); - RestRequest request = new RestRequest(Method.GET); - request.Timeout = mTimeout * 1000; - //request.AddHeader("content-type", "application/json"); - IRestResponse response = client.Execute(request); - return response.RawBytes; - - } - catch (Exception ex) - { - HDL_ON.Utlis.WriteLine(ex.Message); - return null; - } - - - } - } } -- Gitblit v1.8.0