| | |
| | | <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\" />
|
| | |
| | | { |
| | | 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 |
| | |
| | | |
| | | private void EventListener() |
| | | { |
| | | cornerFram.LoadButtonPage(4, (value) => |
| | | 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) => |
| | |
| | | }; |
| | | 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; |
New file |
| | |
| | | using 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() |
| | | { |
| | | //初始化UI |
| | | 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(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | /// </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> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置列表数据 |
| | | /// 设置列表数据(请在初始化完成之前调用) |
| | | /// </summary> |
| | | /// <param name="list"></param> |
| | | public void SetList(List<int> list) |
| | |
| | | } |
| | | |
| | | /// <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++) |
| | |
| | | buttonFram.GetNameButton().Text = i.ToString(); |
| | | |
| | | xCount++; |
| | | if (i % rowNumber == 0) |
| | | if (i % this.mRowNumber == 0) |
| | | { |
| | | |
| | | line++; |
| | |
| | | } |
| | | 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> |
New file |
| | |
| | | using 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(); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using 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; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | public class TypeMultiFramLayout |
| | | { |
| | | |
| | | private uint UpBackgroundColor = 0x00000000; |
| | | private uint UpBackgroundColor = MusicColor.ViewColor; |
| | | private uint DownBackgroundColor = 0xff454635; |
| | | |
| | | /// <summary> |
| | |
| | | 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), |
| | |
| | | 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); |
| | |
| | | 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> |
New file |
| | |
| | | using 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() |
| | | { |
| | | //初始化UI |
| | | 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(); |
| | | }); |
| | | }; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | 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, |
| | | }; |