wjc
2023-08-01 01f9d2ef466c1313bc5f0e486d90db0054bcddd9
2023年08月01日20:12:52
2个文件已添加
1个文件已删除
4个文件已修改
405 ■■■■ 已修改文件
HDL_ON/HDL_ON.projitems 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/PayerFramLayout.cs 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/VerticalBoutonFLayout.cs 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/SxqPage.cs 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems
@@ -572,7 +572,8 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\MenuFramLayout.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\TypeSingleFramLayout.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\TypeMultiFramLayout.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\PayerFramLayout.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\VerticalBoutonFLayout.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\SxqPage.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs
@@ -15,7 +15,7 @@
        public AksMusicPage()
        {
        }
        public Action<IntType> action;
        CornerFramLayout cornerFram;
        TypeSingleFramLayout typeSingleFramLayout;
@@ -73,7 +73,11 @@
            typeMultiFramLayout.SetLeftFlClickListener((f) =>
            {
                Console.WriteLine("3");
                SxqPage sxqPage = new SxqPage();
                MainPage.BasePageView.AddChidren(sxqPage);
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                sxqPage.Show();
            });
            typeMultiFramLayout.SetRightFlClickListener((f) =>
@@ -126,8 +130,6 @@
            typeMultiFramLayout = new TypeMultiFramLayout();
            typeMultiFramLayout.multiFramLayout.Y = menuFram.Bottom + Application.GetRealHeight(32);
            typeMultiFramLayout.AddView(cornerBottomFram);
            this.AdjustRealHeight(20);
        }
HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs
@@ -49,7 +49,7 @@
        /// </summary>
        public Action action;
        public IntType currnetIntType;
        public IntType currnetIntType= IntType.none;
        public VerticalScrolViewLayout vv;
        #endregion
@@ -189,10 +189,6 @@
        /// </summary>
        private void SwitchUI(IntType type)
        {
            if (vv != null)
            {
                vv.RemoveAll();
            }
            if (this.currnetIntType == type)
            {
                return;
@@ -201,6 +197,10 @@
            {
                return;
            }
            if (vv != null)
            {
                vv.RemoveAll();
            }
            this.currnetIntType = type;
            switch (type)
            {
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/PayerFramLayout.cs
File was deleted
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs
@@ -3,7 +3,7 @@
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class TypeMultiFramLayout:BaseFramLayout
    public class TypeMultiFramLayout
    {
        private uint UpBackgroundColor = 0x00000000;
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/VerticalBoutonFLayout.cs
New file
@@ -0,0 +1,178 @@
using System;
using HDL_ON.UI.Music;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class VerticalBoutonFLayout:BaseFramLayout
    {
        public const int widthFrameLayout = 80;
        public const int heightFrameLayout = 140;
        public const int cornerValue = 12;
        public VerticalBoutonFLayout(int width = widthFrameLayout, int height = heightFrameLayout)
        {
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealHeight(height);
            this.BackgroundColor = MusicColor.ViewColor;
            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),
            Width = Application.GetRealWidth(40),
            Radius = (uint)Application.GetRealHeight(20),
            BackgroundColor = MusicColor.WhiteColor,
            Gravity = Gravity.CenterHorizontal,
        };
       public Button ONButton = new Button
        {
            Text = "ON",
            Gravity = Gravity.Center,
            TextColor = MusicColor.MusicTxet14SelectedColor,
            TextSize = TextSize.Text14,
        };
       public Button btnName = new Button
        {
            Width = Application.GetRealWidth(widthFrameLayout),
            Height = Application.GetRealHeight(17),
            TextSize = TextSize.Text12,
            TextColor = MusicColor.TextColor,
            TextAlignment = TextAlignment.Center,
            Gravity = Gravity.CenterHorizontal,
            Padding = new Padding(0, 20, 0, 20),
            IsMoreLines = true,
            Text="none"
        };
        public FrameLayout OFFFLayout = new FrameLayout
        {
            Height = Application.GetRealWidth(40),
            Width = Application.GetRealWidth(40),
            Radius = (uint)Application.GetRealHeight(20),
            BackgroundColor = MusicColor.WhiteColor,
            Gravity = Gravity.CenterHorizontal,
        };
        public Button OFFButton = new Button
        {
            Text = "OFF",
            Gravity = Gravity.Center,
            TextColor = 0xFFA5AEBC,
            TextSize = TextSize.Text14,
        };
        /// <summary>
        /// 添加布局
        /// </summary>
        /// <param name="parent"></param>
         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);
        }
        /// <summary>
        /// 事件监听方法
        /// </summary>
        /// <param name="action">回调(第一个是父类对象;第二个是图标对象</param>
         public void SetONClickListener(Action<FrameLayout, Button> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                ONFLayout.BackgroundColor = MusicColor.WhiteColor;
                ONButton.TextColor = MusicColor.MusicTxet14SelectedColor;
                //弹起来还原背景颜色
            };
            ONFLayout.MouseUpEventHandler += UpClick;
            ONButton.MouseUpEventHandler += UpClick;
            //EventHandler<MouseEventArgs> MoveClick = (sender, e) =>
            //{
            //    this.BackgroundColor = 0x00000000;
            //    //弹起来还原背景颜色
            //};
            //this.MouseMoveEventHandler += MoveClick;
            //btnImage.MouseMoveEventHandler += MoveClick;
            //btnName.MouseMoveEventHandler += MoveClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                ONFLayout.BackgroundColor = MusicColor.MusicTxet14SelectedColor;
                ONButton.TextColor = MusicColor.WhiteColor;
                action?.Invoke(ONFLayout, ONButton);
            };
            ONFLayout.MouseDownEventHandler += DownClick;
            ONButton.MouseDownEventHandler += DownClick;
        }
        /// <summary>
        /// 事件监听方法
        /// </summary>
        /// <param name="action">回调(第一个是父类对象;第二个是图标对象</param>
        public void SetOFFClickListener(Action<FrameLayout, Button> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                OFFFLayout.BackgroundColor = MusicColor.WhiteColor;
                OFFButton.TextColor = 0xFFA5AEBC;
                //弹起来还原背景颜色
            };
            OFFFLayout.MouseUpEventHandler += UpClick;
            OFFButton.MouseUpEventHandler += UpClick;
            //EventHandler<MouseEventArgs> MoveClick = (sender, e) =>
            //{
            //    this.BackgroundColor = 0x00000000;
            //    //弹起来还原背景颜色
            //};
            //this.MouseMoveEventHandler += MoveClick;
            //btnImage.MouseMoveEventHandler += MoveClick;
            //btnName.MouseMoveEventHandler += MoveClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                OFFFLayout.BackgroundColor = MusicColor.MusicTxet14SelectedColor;
                OFFButton.TextColor = MusicColor.WhiteColor;
                action?.Invoke(OFFFLayout, OFFButton);
            };
            OFFFLayout.MouseDownEventHandler += DownClick;
            OFFButton.MouseDownEventHandler += DownClick;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/SxqPage.cs
New file
@@ -0,0 +1,133 @@
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.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
{
    public class SxqPage : FrameLayout
    {
        /// <summary>
        /// 头部布局
        /// </summary>
        private TopView topView;
        /// <summary>
        /// 删除设备后需要更新界面的回调
        /// </summary>
        public Action action;
        public VerticalScrolViewLayout vv;
        public SxqPage()
        {
        }
        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.shixuqi;
            this.AddChidren(topView.TopFLayoutView());
        }
        /// <summary>
        /// 初始化中部界面
        /// </summary>
        private void InitMiddle()
        {
            vv = new VerticalScrolViewLayout()
            {
                Y = topView.fLayout.Bottom,
                Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
                BackgroundColor = MusicColor.WhiteColor,
            };
            this.AddChidren(vv);
            BaseFramLayout fLayout = new BaseFramLayout();
            this.vv.AddChidren(fLayout);
            var mList = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 };
            int line = 0;
            int xCount = 0;
            int rowNumber = 4;
            for (int i = 1; i <= mList.Count; i++)
            {
                VerticalBoutonFLayout buttonFram = new VerticalBoutonFLayout();
                buttonFram.AddView(fLayout);
                buttonFram.Tag = i - 1;
                buttonFram.Y = Application.GetRealWidth(16)+ Application.GetRealHeight((VerticalBoutonFLayout.heightFrameLayout+16) * line);
                buttonFram.X = Application.GetRealWidth(16) + Application.GetRealWidth((VerticalBoutonFLayout.widthFrameLayout+8) * xCount);
                xCount++;
                if (i % rowNumber == 0)
                {
                    line++;
                    xCount = 0;
                }
                buttonFram.SetONClickListener((fl, btn) =>
                {
                    //action.Invoke((int)buttonFram.Tag);
                });
                buttonFram.SetOFFClickListener((fl, btn) =>
                {
                    //action.Invoke((int)buttonFram.Tag);
                });
            }
            fLayout.AdjustRealHeight(16);
            List<string> list = new List<string>() {
             "A","B","C","D"
            };
            for (int i = 0; i < list.Count; i++)
            {
                Button btnName = new Button
                {
                    Y = fLayout.Height,
                    X = Application.GetRealWidth(16) + Application.GetRealWidth((VerticalBoutonFLayout.widthFrameLayout+8) * i),
                    Width = Application.GetRealWidth(80),
                    Height = Application.GetRealHeight(44),
                    TextSize = TextSize.Text14,
                    TextColor = MusicColor.TextColor,
                    TextAlignment = TextAlignment.Center,
                    Text = list[i],
                    BackgroundColor = MusicColor.ViewColor,
                    Radius = (uint)Application.GetRealHeight(12),
                };
                fLayout.AddChidren(btnName);
            }
            fLayout.AdjustRealHeight(16);
        }
        /// <summary>
        /// 注册事件
        /// </summary>
        private void EventListener()
        {
            //返回
            this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                this.RemoveFromParent();
            };
        }
    }
}