From a0ff1e2375ea0ad8ea127341e04799be8123bd54 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期三, 02 八月 2023 20:29:57 +0800 Subject: [PATCH] 2023年08月02日20:29:54 --- HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/HorizontalFramLayout.cs | 145 ++++++++++++ HDL_ON/UI/UI2/FuntionControlView/Aks/SxqPage.cs | 4 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/VerticalBoutonFLayout.cs | 14 - HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs | 102 +++++++- HDL_ON/UI/UI2/FuntionControlView/Aks/AksListPage.cs | 4 HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs | 171 ++++++++++++++ HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs | 19 + HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs | 102 ++++++++ HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ImageFramlayout.cs | 103 ++++++++ HDL_ON/HDL_ON.projitems | 4 HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs | 4 12 files changed, 631 insertions(+), 43 deletions(-) diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 1eb232c..8ce1461 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -574,6 +574,10 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\TypeMultiFramLayout.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\VerticalBoutonFLayout.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\SxqPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\HorizontalFramLayout.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\YkPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\ImageFramlayout.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CollectPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksListPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksListPage.cs index 7936de1..77ae5fb 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksListPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksListPage.cs @@ -164,8 +164,8 @@ { X = Application.GetRealWidth(299), Y = Application.GetRealHeight(10), - Width = Application.GetMinRealAverage(40), - Height = Application.GetMinRealAverage(40), + Width = Application.GetRealWidth(40), + Height = Application.GetRealWidth(40), SelectedImagePath = "Collection/CollectionIcon.png", UnSelectedImagePath = "Collection/CollectionGrayIcon.png", IsSelected = i_device.collect diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs index 55d702f..c8f33a1 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs @@ -40,18 +40,22 @@ private void EventListener() { - cornerFram.LoadButtonPage(4, (value) => - { - Console.WriteLine("1"); - }); + cornerFram.selectAction += (value) => + { + Console.WriteLine("1"); + }; typeSingleFramLayout.SetClickListener((f) => { - Console.WriteLine("2"); + YkPage ykPage = new YkPage(); + MainPage.BasePageView.AddChidren(ykPage); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + ykPage.Show(); }); menuFram.SetTopClickListener((b) => { + Console.WriteLine("5"); }); menuFram.SetBottomClickListener((b) => @@ -104,15 +108,16 @@ }; this.AddChidren(btnTitle); - cornerFram = new CornerFramLayout(343, 452); + cornerFram = new CornerFramLayout(343, 452, 4,17); cornerFram.X = Application.GetRealWidth(16); cornerFram.Y = btnTitle.Bottom + Application.GetRealHeight(16); this.AddChidren(cornerFram); cornerFram.SetList(cornerFram.GetTestList(17)); cornerFram.SetMargin(16, 0, 16, 0); + cornerFram.LoadButtonPage(); - CornerFramLayout cornerBottomFram = new CornerFramLayout(343, 364); + CornerFramLayout cornerBottomFram = new CornerFramLayout(343, 364, 0,17); cornerBottomFram.X = Application.GetRealWidth(16); cornerBottomFram.Y = cornerFram.Bottom + Application.GetRealHeight(16); cornerBottomFram.BackgroundColor = MusicColor.WhiteColor; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs new file mode 100644 index 0000000..4e22269 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CollectPage.cs @@ -0,0 +1,102 @@ +锘縰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; +namespace HDL_ON.UI.UI2.FuntionControlView.Aks +{ + /// <summary> + /// 鏀惰棌鐣岄潰 + /// </summary> + public class CollectPage : FrameLayout + { + public CollectPage() + { + } + + + /// <summary> + /// 澶撮儴甯冨眬 + /// </summary> + private TopView topView; + /// <summary> + /// 鍒犻櫎璁惧鍚庨渶瑕佹洿鏂扮晫闈㈢殑鍥炶皟 + /// </summary> + public Action action; + + public void Show() + { + //鍒濆鍖朥I + this.InitTop(); + this.InitMiddle(); + //鍒濆鍖栦簨浠� + this.EventListener(); + //璇诲彇鏁版嵁 + + } + + + /// <summary> + /// 鍒濆鍖栧ご閮ㄧ晫闈� + /// </summary> + private void InitTop() + { + 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 + { + 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, 3, 0); + vv.AddChidren(imageFLayout); + imageFLayout.X = Application.GetRealWidth(16); + imageFLayout.SetList(imageFLayout.GetTestList(20)); + imageFLayout.LoadImagePage(); + imageFLayout.selectAction += (index) => + { + Console.WriteLine("5"); + }; + imageFLayout.AdjustRealHeight(16); + } + /// <summary> + /// 娉ㄥ唽浜嬩欢 + /// </summary> + private void EventListener() + { + //杩斿洖 + this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => + { + this.RemoveFromParent(); + }; + + } + + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs index eb902d3..2d3b075 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs @@ -10,26 +10,40 @@ /// </summary> public class CornerFramLayout : BaseFramLayout { - public const int cornerValue = 17; private int topMargin; private int leftMargin; private int bottomMargin; private int rightMargin; - + /// <summary> + /// 涓�琛屽嚑涓厓绱� + /// </summary> private int mRowNumber; private List<int> mList; - public CornerFramLayout(int width, int height) + public Action<int> selectAction = null; + /// <summary> + /// 褰撳墠閫夋嫨鐨勭储寮�(鍐呴儴浣跨敤) + /// </summary> + private int CurrnetSelectIndex = -1; + /// <summary> + /// + /// </summary> + /// <param name="width">瀹瑰櫒瀹藉害</param> + /// <param name="height">瀹瑰櫒楂樺害</param> + ///<param name="rowNumber">涓�琛屽嚑涓厓绱�</param> + ///<param name="rowNumber">鍦嗚鍊�</param> + public CornerFramLayout(int width, int height, int rowNumber,int radius=0) { this.BackgroundColor = MusicColor.WhiteColor; this.Width = Application.GetRealWidth(width); this.Height = Application.GetRealHeight(height); - this.Radius = (uint)Application.GetRealHeight(cornerValue); + this.Radius = (uint)Application.GetRealHeight(radius); + this.mRowNumber = rowNumber; } /// <summary> - /// 璁剧疆杈硅窛 + /// 璁剧疆鍐呰竟璺� /// </summary> /// <param name="top">涓婅竟璺�</param> /// <param name="bottom">涓嬭竟璺�</param> @@ -44,7 +58,7 @@ } /// <summary> - /// 璁剧疆鍒楄〃鏁版嵁 + /// 璁剧疆鍒楄〃鏁版嵁(璇峰湪鍒濆鍖栧畬鎴愪箣鍓嶈皟鐢�) /// </summary> /// <param name="list"></param> public void SetList(List<int> list) @@ -70,22 +84,19 @@ } /// <summary> - /// 鍔犺浇鎸夐敭鐣岄潰 + /// 鍔ㄦ�佸姞杞芥寜閿晫闈� /// </summary> - /// <param name="rowNumber">涓�琛屽嚑涓厓绱�</param> - /// <param name="action">鍥炶皟</param> - public void LoadButtonPage(int rowNumber, Action<int> action) + public void LoadButtonPage() { - if (rowNumber == 0) + if (this.mRowNumber == 0) { return; } - this.mRowNumber = rowNumber; int line = 0; int xCount = 0; for (int i = 1; i <= this.mList.Count; i++) { - ButtonFramLayout buttonFram = new ButtonFramLayout(); + ButtonFramLayout buttonFram = new ButtonFramLayout(); this.AddChidren(buttonFram); buttonFram.Tag = i - 1; buttonFram.Y = Application.GetRealHeight(this.topMargin) + Application.GetRealHeight(ButtonFramLayout.heightFrameLayout * line); @@ -103,7 +114,7 @@ buttonFram.GetNameButton().Text = i.ToString(); xCount++; - if (i % rowNumber == 0) + if (i % this.mRowNumber == 0) { line++; @@ -111,14 +122,73 @@ } buttonFram.SetClickListener((fl, btnIcon, btnName) => { - action.Invoke((int)buttonFram.Tag); + selectAction?.Invoke((int)buttonFram.Tag); }); + + //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) + //{ + // selectAction?.Invoke((int)buttonFram.Tag); + //} } - //this.AdjustRealHeight(this.bottomMargin); } + + /// <summary> + /// 鍔ㄦ�佸姞杞藉浘鐗囩晫闈� + /// </summary> + public void LoadImagePage() + { + if (this.mRowNumber == 0) + { + return; + } + int line = 0; + int xCount = 0; + for (int i = 1; i <= this.mList.Count; i++) + { + ImageFramlayout imageFram = new ImageFramlayout(); + imageFram.AddView(this); + //this.AddChidren(imageFram); + imageFram.Tag = i - 1; + imageFram.Y = Application.GetRealHeight(this.topMargin)+ Application.GetRealHeight((ImageFramlayout.heightFrameLayout + 20) * line); + imageFram.X = Application.GetRealWidth((ImageFramlayout.widthFrameLayout + 8) * xCount); + //imageFram.AddImageView(); + //imageFram.AddScoreButton(); + //imageFram.AddNameButton(); + imageFram.btnName.Text = i.ToString(); + + xCount++; + if (i % this.mRowNumber == 0) + { + + line++; + xCount = 0; + } + imageFram.SetClickListener((fl) => + { + selectAction?.Invoke((int)imageFram.Tag); + }); + + //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) + //{ + // selectAction?.Invoke((int)imageFram.Tag); + //} + + + } + } + /// <summary> + /// 璁剧疆鍒濆閫夋嫨(璇峰湪鍒濆鍖栧畬鎴愪箣鍓嶈皟鐢�) + /// </summary> + /// <param name="index">浠庡垪琛�0寮�濮嬭绠楃涓�涓厓绱�,璁剧疆瓒呰繃鍒楄〃鏈�澶�(new List().count-1)鍊艰涓烘棤鏁�</param> + public void SetIndex(int index = -1) + { + if (index == -1) { return; } + this.CurrnetSelectIndex = index; + + } /// <summary> /// 鏈�鍚庝竴琛� /// </summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/HorizontalFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/HorizontalFramLayout.cs new file mode 100644 index 0000000..4f09852 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/HorizontalFramLayout.cs @@ -0,0 +1,145 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.Music; +using System.Collections.Generic; + +namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView +{ + /// <summary> + /// 姘村钩婊戝姩瀹瑰櫒 + /// </summary> + public class HorizontalFramLayout : HorizontalScrolViewLayout + { + public HorizontalFramLayout() + { + this.Height = Application.GetRealHeight(28); + } + + private List<string> mList = new List<string>(); + /// <summary> + /// 閫夋嫨浜嬩欢 + /// </summary> + public Action<int> SelectTypeEvent = null; + + /// <summary> + /// 褰撳墠閫夋嫨鐨勭储寮�(鍐呴儴浣跨敤) + /// </summary> + private int CurrnetSelectIndex = -1; + + + /// <summary> + /// 鍒濆鍖栨帶浠� + /// </summary> + public void InitControl() + { + if (this.mList == null || this.mList.Count == 0) + { + return; + } + Button btnSelected = new Button(); + for (int i = 0; i < this.mList.Count; i++) + { + Button button = new Button + { + Height = Application.GetRealHeight(28), + Width = Application.GetRealWidth(20), + SelectedBackgroundColor = MusicColor.ViewColor, + BackgroundColor = 0x00000000, + Text = mList[i], + TextSize = TextSize.Text14, + TextColor = MusicColor.TextColor, + SelectedTextColor = MusicColor.MusicTxet14SelectedColor, + TextAlignment = TextAlignment.Center, + Padding = new Padding(4, 4, 4, 4), + Radius = (uint)Application.GetRealHeight(4), + Tag = i, + }; + + //閲嶆柊璁$畻缁勪欢瀹藉害 + button.Width = button.GetTextWidth() + Application.GetRealWidth(4 + 4); + this.AddChidren(button); + //闂撮殧,寮勪釜绌虹殑杩涘幓鍗犱綅缃� + Button btnSpacing = new Button + { + Height = Application.GetRealHeight(28), + Width = Application.GetRealWidth(20), + BackgroundColor = 0x00000000, + }; + this.AddChidren(btnSpacing); + button.MouseDownEventHandler += (sen, e) => + { + btnSelected.IsSelected = false; + button.IsSelected = true; + btnSelected = button; + if (button.Tag == null) + { + return; + } + SelectTypeEvent?.Invoke((int)button.Tag); + + }; + if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) + { + btnSelected.IsSelected = false; + button.IsSelected = true; + btnSelected = button; + if (button.Tag == null) + { + return; + } + SelectTypeEvent?.Invoke((int)button.Tag); + } + } + + + + } + + + /// <summary> + /// 璁剧疆鍒濆閫夋嫨(璇峰湪鍒濆鍖栧畬鎴愪箣鍓嶈皟鐢�) + /// </summary> + /// <param name="index">浠庡垪琛�0寮�濮嬭绠楃涓�涓厓绱�,璁剧疆瓒呰繃鍒楄〃鏈�澶�(new List().count-1)鍊艰涓烘棤鏁�</param> + public void SetIndex(int index = -1) + { + if (index == -1) { return; } + this.CurrnetSelectIndex = index; + + } + + /// <summary> + /// 璁剧疆鍒楄〃鏁版嵁(璇峰湪鍒濆鍖栧畬鎴愪箣鍓嶈皟鐢�) + /// </summary> + public void SetList(List<string> list) + { + if (list == null) + { + this.mList = new List<string>(); + } + this.mList = list; + + } + /// <summary> + /// 娴嬭瘯鏁版嵁 + /// </summary> + public List<string> GetTestData + { + get + { + return new List<string> { "4245725454", "2", "绫诲瀷", "涓浗鐢靛奖", "鍏ㄩ儴绫诲瀷", "绫诲瀷鍙戦�佸湴鍝﹀摝鍝�", "涓浗鐢靛奖鎰熻瀵归厭褰撴瓕", "鍏ㄩ儴绫诲瀷", }; + } + + } + + + /// <summary> + /// 鎺т欢鎽ф瘉 + /// </summary> + public override void RemoveFromParent() + { + this.SelectTypeEvent = null; + base.RemoveFromParent(); + } + + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ImageFramlayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ImageFramlayout.cs new file mode 100644 index 0000000..848fc15 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ImageFramlayout.cs @@ -0,0 +1,103 @@ +锘縰sing System; +using Shared; +using HDL_ON.UI.Music; +using System.Collections.Generic; +namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView +{ + public class ImageFramlayout : BaseFramLayout + { + + public const int widthFrameLayout = 109; + public const int heightFrameLayout = 168; + + public ImageFramlayout(int width = widthFrameLayout, int height = heightFrameLayout) + { + this.Width = Application.GetRealWidth(width); + this.Height = Application.GetRealHeight(height); + this.BackgroundColor = 0x00000000; + } + + public Button btnImage = new Button + { + Height = Application.GetRealHeight(140), + Width = Application.GetRealWidth(109), + Radius = (uint)Application.GetRealHeight(12), + //UnSelectedImagePath = "Collection/CollectionGrayIcon.png", + BackgroundColor=0xff765876, + }; + + public Button btnScore = new Button + { + Y = Application.GetRealHeight(110), + X = Application.GetRealWidth(21), + Height = Application.GetRealHeight(22), + Width = Application.GetRealWidth(80), + Text = "9.1", + TextColor = MusicColor.WhiteColor, + TextSize = TextSize.Text16, + TextAlignment = TextAlignment.CenterRight, + }; + + public Button btnName = new Button + { + //Y = Application.GetRealHeight(140 + 8), + Width = Application.GetRealWidth(widthFrameLayout), + Height = Application.GetRealHeight(20), + TextSize = TextSize.Text14, + TextColor = MusicColor.TextColor, + TextAlignment = TextAlignment.Center, + Padding = new Padding(0, 4, 0, 4), + IsMoreLines = true, + }; + + public void AddView(FrameLayout layout) + { + layout.AddChidren(this); + this.AddChidren(btnImage); + this.AddChidren(btnScore); + this.AddChidren(btnName); + btnName.Y = btnImage.Bottom + Application.GetRealHeight(8); + + } + + /// <summary> + /// 浜嬩欢鐩戝惉鏂规硶 + /// </summary> + /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄/param> + public void SetClickListener(Action<FrameLayout> action) + { + EventHandler<MouseEventArgs> UpClick = (sender, e) => + { + this.BackgroundColor = 0x00000000; + + //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + }; + this.MouseUpEventHandler += UpClick; + btnImage.MouseUpEventHandler += UpClick; + btnScore.MouseUpEventHandler += UpClick; + btnName.MouseUpEventHandler += UpClick; + + + //EventHandler<MouseEventArgs> MoveClick = (sender, e) => + //{ + // this.BackgroundColor = 0x00000000; + // //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + //}; + //this.MouseMoveEventHandler += MoveClick; + //btnImage.MouseMoveEventHandler += MoveClick; + //btnName.MouseMoveEventHandler += MoveClick; + + EventHandler<MouseEventArgs> DownClick = (sender, e) => + { + //鎸変笅鍘绘敼鍙樿儗鏅鑹� + this.BackgroundColor = 0xff454635; + action?.Invoke(this); + }; + this.MouseUpEventHandler += DownClick; + btnImage.MouseUpEventHandler += DownClick; + btnScore.MouseUpEventHandler += DownClick; + btnName.MouseUpEventHandler += DownClick; + } + + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs index ea76914..673083f 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs @@ -6,7 +6,7 @@ public class TypeMultiFramLayout { - private uint UpBackgroundColor = 0x00000000; + private uint UpBackgroundColor = MusicColor.ViewColor; private uint DownBackgroundColor = 0xff454635; /// <summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/VerticalBoutonFLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/VerticalBoutonFLayout.cs index e8d0e83..d16b329 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/VerticalBoutonFLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/VerticalBoutonFLayout.cs @@ -18,18 +18,6 @@ Radius = (uint)Application.GetRealHeight(cornerValue); } - - - //public FrameLayout fLayout = new FrameLayout - //{ - // Y = Application.GetRealHeight(16), - // Width = Application.GetRealWidth(widthFrameLayout - 8), - // Height = Application.GetRealHeight(heightFrameLayout - 16), - // Radius = (uint)Application.GetRealHeight(cornerValue), - // BackgroundColor = MusicColor.ViewColor, - //}; - - public FrameLayout ONFLayout = new FrameLayout { Height = Application.GetRealWidth(40), @@ -85,13 +73,11 @@ public void AddView(FrameLayout parent) { parent.AddChidren(this); - //this.AddChidren(fLayout); this.AddChidren(ONFLayout); ONFLayout.AddChidren(ONButton); this.AddChidren(btnName); this.AddChidren(OFFFLayout); OFFFLayout.AddChidren(OFFButton); - ONFLayout.Y = Application.GetRealHeight(11); btnName.Y = ONFLayout.Bottom + Application.GetRealHeight(11); OFFFLayout.Y = btnName.Bottom + Application.GetRealHeight(11); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/SxqPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/SxqPage.cs index 40a6fcf..a0bc204 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/SxqPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/SxqPage.cs @@ -6,13 +6,15 @@ using HDL_ON.Entity; using HDL_ON.DriverLayer; using HDL_ON.UI.Music; -using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; using HDL_ON.UI.UI2.Intelligence.Automation; using System.Linq; using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView; namespace HDL_ON.UI.UI2.FuntionControlView.Aks { + /// <summary> + /// 鏃跺簭鍣ㄧ晫闈� + /// </summary> public class SxqPage : FrameLayout { /// <summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs new file mode 100644 index 0000000..d56a238 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs @@ -0,0 +1,171 @@ +锘縰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; + +namespace HDL_ON.UI.UI2.FuntionControlView.Aks +{ + /// <summary> + /// 褰卞簱鐣岄潰 + /// </summary> + public class YkPage:FrameLayout + { + + /// <summary> + /// 澶撮儴甯冨眬 + /// </summary> + private TopView topView; + /// <summary> + /// 鍒犻櫎璁惧鍚庨渶瑕佹洿鏂扮晫闈㈢殑鍥炶皟 + /// </summary> + public Action action; + + + public YkPage() + { + } + public void Show() + { + //鍒濆鍖朥I + this.InitTop(); + this.InitMiddle(); + //鍒濆鍖栦簨浠� + this.EventListener(); + //璇诲彇鏁版嵁 + + } + + + /// <summary> + /// 鍒濆鍖栧ご閮ㄧ晫闈� + /// </summary> + private void InitTop() + { + this.BackgroundColor = MusicColor.ViewColor; + this.topView = new TopView(); + this.topView.setBtn.Visible = true; + this.topView.setBtn.Width = Application.GetMinRealAverage(32); + this.topView.setBtn.Height = Application.GetMinRealAverage(32); + this.topView.setBtn.UnSelectedImagePath = "Collection/CollectionGrayIcon.png"; + this.topView.topNameBtn.TextID = StringId.yingku; + this.AddChidren(topView.TopFLayoutView()); + } + /// <summary> + /// 鍒濆鍖栦腑閮ㄧ晫闈� + /// </summary> + private void InitMiddle() + { + + var fLayout = new FrameLayout { + Y = topView.fLayout.Bottom, + Height = Application.GetRealHeight(H_W.H - H_W.T_Height), + BackgroundColor = MusicColor.WhiteColor, + }; + this.AddChidren(fLayout); + + BaseFramLayout typeFLayout = new BaseFramLayout(); + fLayout.AddChidren(typeFLayout); + int span= Application.GetRealHeight(20);//闂撮殧 + int x = Application.GetRealHeight(16);//X杞村亸绉婚噺 + HorizontalFramLayout horizontalFram = new HorizontalFramLayout(); + typeFLayout.AddChidren(horizontalFram); + horizontalFram.Y = Application.GetRealHeight(20); + horizontalFram.X = x; + horizontalFram.SetIndex(2); + horizontalFram.SetList(horizontalFram.GetTestData); + horizontalFram.InitControl(); + horizontalFram.SelectTypeEvent += (index) => { + Console.WriteLine("1"); + + }; + HorizontalFramLayout horizontalFram1 = new HorizontalFramLayout(); + typeFLayout.AddChidren(horizontalFram1); + horizontalFram1.Y = horizontalFram.Bottom + span; + horizontalFram1.X = x; + horizontalFram1.SetIndex(2); + horizontalFram1.SetList(horizontalFram1.GetTestData); + horizontalFram1.InitControl(); + horizontalFram1.SelectTypeEvent += (index) => { + Console.WriteLine("2"); + + }; + HorizontalFramLayout horizontalFram2 = new HorizontalFramLayout(); + typeFLayout.AddChidren(horizontalFram2); + horizontalFram2.Y = horizontalFram1.Bottom + span; + horizontalFram2.X = x; + horizontalFram2.SetIndex(2); + horizontalFram2.SetList(horizontalFram2.GetTestData); + horizontalFram2.InitControl(); + horizontalFram2.SelectTypeEvent += (index) => { + Console.WriteLine("3"); + }; + HorizontalFramLayout horizontalFram3 = new HorizontalFramLayout(); + typeFLayout.AddChidren(horizontalFram3); + horizontalFram3.Y = horizontalFram2.Bottom + span; + horizontalFram3.X = x; + horizontalFram3.SetIndex(2); + horizontalFram3.SetList(horizontalFram3.GetTestData); + horizontalFram3.InitControl(); + horizontalFram3.SelectTypeEvent += (index) => { + Console.WriteLine("4"); + }; + typeFLayout.AdjustRealHeight(); + + var vv = new VerticalRefreshLayout() + { + Y = typeFLayout.Bottom, + Height = fLayout.Height- typeFLayout.Bottom, + }; + fLayout.AddChidren(vv); + vv.BeginHeaderRefreshingAction += () => + { + //鍏抽棴鍒锋柊View锛� + vv.EndHeaderRefreshing(); + }; + + + CornerFramLayout imageFLayout = new CornerFramLayout(343, 20 * 168, 3, 0); + vv.AddChidren(imageFLayout); + imageFLayout.X = Application.GetRealWidth(16); + imageFLayout.SetList(imageFLayout.GetTestList(20)); + imageFLayout.LoadImagePage(); + imageFLayout.selectAction += (index) => + { + Console.WriteLine("5"); + }; + imageFLayout.AdjustRealHeight(16); + } + /// <summary> + /// 娉ㄥ唽浜嬩欢 + /// </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(); + }); + }; + } + + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs index 7bc13d0..f92e78f 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Music/View/TopView.cs @@ -55,8 +55,8 @@ { Y = Application.GetRealHeight(29), X = Application.GetRealWidth(337), - Width = Application.GetRealWidth(28), - Height = Application.GetRealWidth(28), + Width = Application.GetMinRealAverage(28), + Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "MusicIcon/set.png", Visible=false, }; -- Gitblit v1.8.0