wjc
2023-07-31 175ace9b4dd6a166285ef8de777c412776cee467
2023年07月31日18:15:47

备份代码
8个文件已添加
3个文件已修改
1147 ■■■■■ 已修改文件
HDL_ON/HDL_ON.projitems 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/PayerFramLayout.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs 179 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems
@@ -565,6 +565,14 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\AksListPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\AksCommonMethod.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\AksPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\ButtonFramLayout.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\CornerFramLayout.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\AksMusicPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\BaseFramLayout.cs" />
    <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" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
@@ -595,5 +603,6 @@
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\Face\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\CommonView\" />
  </ItemGroup>
</Project>
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -724,6 +724,13 @@
                        volView.btnText.TextID = StringId.volumeMusic; 
                        fLayout.AddChidren(volView.FLayoutView());
                        //if (SPK.AvMusic == device.spk)
                        //{
                        //    //不支持特殊语音
                        //    volView.frameLayout.Y = Application.GetRealHeight(0);
                        //}
                        ///设备延时iewv
                        DelayView(fLayout, volView.frameLayout.Bottom);
                        #endregion
HDL_ON/UI/UI2/FuntionControlView/Aks/AksMusicPage.cs
New file
@@ -0,0 +1,220 @@
using System;
using HDL_ON.UI.Music;
using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks
{
    public class AksMusicPage : BaseFramLayout
    {
        public AksMusicPage()
        {
        }
        public void Show()
        {
            this.BackgroundColor = MusicColor.ViewColor;
            Button btnTitle = new Button
            {
                Y = Application.GetRealHeight(16),
                X = Application.GetRealWidth(16),
                Height = Application.GetRealHeight(22),
                Width = Application.GetRealWidth(200),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = MusicColor.TextColor,
                TextSize = TextSize.Text16,
                TextID = StringId.bofangqi,
            };
            this.AddChidren(btnTitle);
            CornerFramLayout cornerFram = new CornerFramLayout(343, 452);
            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(4, (value) =>
            {
            });
            FrameLayout payerFramLayout = new FrameLayout();
            payerFramLayout.Width = Application.GetRealWidth(343);
            payerFramLayout.Height = Application.GetRealHeight(364);
            payerFramLayout.Y = cornerFram.Bottom + Application.GetRealHeight(16);
            payerFramLayout.X = Application.GetRealWidth(16);
            payerFramLayout.BackgroundColor = MusicColor.WhiteColor;
            payerFramLayout.Radius = (uint)Application.GetRealHeight(17);
            this.AddChidren(payerFramLayout);
            FrameLayout singleFramLayout = new FrameLayout
            {
                BackgroundColor = MusicColor.ViewColor,
                Y = Application.GetRealHeight(24),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(101),
                Height = Application.GetRealHeight(40),
                Radius = (uint)Application.GetRealHeight(20),
            };
            payerFramLayout.AddChidren(singleFramLayout);
            Button btnLeftImage = new Button
            {
                X = Application.GetRealWidth(16),
                Width = Application.GetRealWidth(16),
                Height = Application.GetRealWidth(16),
                UnSelectedImagePath = "AksIcon/yingku.png",
                Gravity = Gravity.CenterVertical,
                Name = "btnLeftImage",
            };
            singleFramLayout.AddChidren(btnLeftImage);
            Button btnName = new Button
            {
                X = btnLeftImage.Right + Application.GetRealWidth(4),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealHeight(23),
                TextID = StringId.yingku,
                TextSize = TextSize.Text16,
                TextColor = MusicColor.TextColor,
                TextAlignment = TextAlignment.Center,
                Gravity = Gravity.CenterVertical,
                IsMoreLines = true,
                Name = "btnName",
            };
            singleFramLayout.AddChidren(btnName);
            Button btnRightImage = new Button
            {
                X = btnName.Right + Application.GetRealWidth(8),
                Width = Application.GetRealWidth(5),
                Height = Application.GetRealWidth(8),
                UnSelectedImagePath = "AksIcon/yingkunext.png",
                Gravity = Gravity.CenterVertical,
                Name = "btnRightImage",
            };
            singleFramLayout.AddChidren(btnRightImage);
            MenuFramLayout menuFram = new MenuFramLayout
            {
                Y = singleFramLayout.Bottom + Application.GetRealHeight(32),
                Gravity = Gravity.CenterHorizontal,
            };
            menuFram.AddView(payerFramLayout);
            FrameLayout multiFramLayout = new FrameLayout
            {
                BackgroundColor = MusicColor.ViewColor,
                X=Application.GetRealWidth(16),
                Y = menuFram.Bottom+Application.GetRealHeight(32),
                Width = Application.GetRealWidth(311),
                Height = Application.GetRealHeight(40),
                Radius = (uint)Application.GetRealHeight(20),
            };
            payerFramLayout.AddChidren(multiFramLayout);
            FrameLayout leftFramLayout = new FrameLayout
            {
                X = Application.GetRealWidth(16),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(139),
                Height = Application.GetRealHeight(23),
                Radius = (uint)Application.GetRealHeight(20),
            };
            multiFramLayout.AddChidren(leftFramLayout);
            Button btnBottonLeftImage = new Button
            {
                Width = Application.GetRealWidth(16),
                Height = Application.GetRealWidth(16),
                UnSelectedImagePath = "AksIcon/shixuqi.png",
                Gravity = Gravity.CenterVertical,
                Name = "btnBottonLeftImage",
            };
            leftFramLayout.AddChidren(btnBottonLeftImage);
            Button btnBottonName = new Button
            {
                X = btnBottonLeftImage.Right + Application.GetRealWidth(4),
                Width = Application.GetRealWidth(100),
                Height = Application.GetRealHeight(23),
                TextID = StringId.shixuqi,
                TextSize = TextSize.Text16,
                TextColor = MusicColor.TextColor,
                TextAlignment = TextAlignment.CenterLeft,
                Gravity = Gravity.CenterVertical,
                IsMoreLines = true,
                Name = "btnName",
            };
            leftFramLayout.AddChidren(btnBottonName);
            FrameLayout lineFramLayout   = new FrameLayout
            {
                BackgroundColor = MusicColor.TextColor,
                X = leftFramLayout.Right,
                Y =Application.GetRealHeight(10),
                Width = Application.GetRealWidth(1),
                Height = Application.GetRealHeight(20),
            };
            multiFramLayout.AddChidren(lineFramLayout);
            FrameLayout rightFramLayout = new FrameLayout
            {
                X =lineFramLayout.Right,
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(138),
                Height = Application.GetRealHeight(23),
            };
            multiFramLayout.AddChidren(rightFramLayout);
            Button btnBottonRightImage = new Button
            {
                Width = Application.GetRealWidth(16),
                Height = Application.GetRealWidth(16),
                UnSelectedImagePath = "AksIcon/xuanze.png",
                Gravity = Gravity.CenterRight,
                Name = "btnBottonLeftImage",
            };
            rightFramLayout.AddChidren(btnBottonRightImage);
            Button btnBottonRightName = new Button
            {
                X = btnBottonLeftImage.Right + Application.GetRealWidth(4),
                Width = Application.GetRealWidth(100),
                Height = Application.GetRealHeight(23),
                TextID = StringId.bofangqi,
                TextSize = TextSize.Text16,
                TextColor = MusicColor.TextColor,
                TextAlignment = TextAlignment.CenterRight,
                Gravity = Gravity.CenterVertical,
                IsMoreLines = true,
                Name = "btnName",
            };
            rightFramLayout.AddChidren(btnBottonRightName);
            //PayerFramLayout payerFramLayout = new PayerFramLayout(343, 364);
            //payerFramLayout.Y = cornerFram.Bottom + Application.GetRealHeight(16);
            //payerFramLayout.X = Application.GetRealWidth(16);
            //payerFramLayout.LoadPage();
            //this.AddChidren(payerFramLayout);
            this.AdjustRealHeight(20);
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs
@@ -97,22 +97,15 @@
        /// </summary>
        private void InitMiddle()
        {
            this.vv = new VerticalScrolViewLayout()
            vv = new VerticalScrolViewLayout()
            {
                Y = topView.fLayout.Bottom,
                Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
            };
            var middleFl = new FrameLayout
            {
            };
            this.vv.AddChidren(middleFl);
            var whiteFl = new FrameLayout
            {
            };
            middleFl.AddChidren(whiteFl);
            this.AddChidren(vv);
            AksMusicPage aksMusicPage = new AksMusicPage();
            this.vv.AddChidren(aksMusicPage);
            aksMusicPage.Show();
        }
        /// <summary>
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
New file
@@ -0,0 +1,52 @@
using System;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class BaseFramLayout:FrameLayout
    {
        public BaseFramLayout()
        {
        }
        /// <summary>
        /// 调整真实高度
        /// </summary>
        /// <param name="bottomSpace">底部高度(非真实值)</param>
        public void AdjustRealHeight(int bottomSpace = 0)
        {
            int bottomHeight = -1;
            for (int i = 0; i < this.ChildrenCount; i++)
            {
                var child = this.GetChildren(i);
                if (child.Bottom > bottomHeight)
                {
                    bottomHeight = child.Bottom;
                }
            }
            if (bottomHeight != -1)
            {
                this.Height = bottomHeight + Application.GetRealHeight(bottomSpace);
            }
        }
        /// <summary>
        /// 获取坐标底部最下面的那个控件的底部坐标
        /// </summary>
        /// <returns></returns>
        private int GetLocationMostLastViewBottom()
        {
            int bottomHeight = -1;
            for (int i = 0; i < this.ChildrenCount; i++)
            {
                var child = this.GetChildren(i);
                if (child.Bottom > bottomHeight)
                {
                    bottomHeight = child.Bottom;
                }
            }
            return bottomHeight;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs
New file
@@ -0,0 +1,196 @@
using System;
using HDL_ON.UI.Music;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    /// <summary>
    /// 自定义按键容器
    /// </summary>
    public class ButtonFramLayout : BaseFramLayout
    {
        public const int widthFrameLayout = 78;
        public const int heightFrameLayout = 84;
        public const int lineW = 1;
        public const int cornerValue = 8;
        public ButtonFramLayout(int width= widthFrameLayout, int height= heightFrameLayout)
        {
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealHeight(height);
            this.Radius = (uint)Application.GetRealHeight(cornerValue);
        }
        Button btnImage = new Button
        {
            Y = Application.GetRealHeight(12),
            Width = Application.GetRealWidth(32),
            Height = Application.GetRealWidth(32),
            UnSelectedImagePath = "AksIcon/kai.png",
            Gravity = Gravity.CenterHorizontal,
            Name = "btnImage",
        };
        Button btnName = new Button
        {
            Y = Application.GetRealHeight(12 + 32 + 8),
            Width = Application.GetRealWidth(widthFrameLayout),
            Height = Application.GetRealHeight(20),
            TextSize = TextSize.Text14,
            TextColor = MusicColor.TextColor,
            TextAlignment = TextAlignment.Center,
            Gravity = Gravity.CenterHorizontal,
            Padding = new Padding(0, 20, 0, 20),
            IsMoreLines = true,
            Name = "btnName",
        };
        Button btnTopLine = new Button
        {
            Width = Application.GetRealWidth(widthFrameLayout),
            Height = Application.GetRealHeight(lineW),
            BackgroundColor = MusicColor.ViewColor,
            Name = "btnTopLine",
        };
        Button btnBottomLine = new Button
        {
            Width = Application.GetRealWidth(widthFrameLayout),
            Height = Application.GetRealHeight(lineW),
            BackgroundColor = MusicColor.ViewColor,
            Name = "btnBottomLine",
            Y = Application.GetRealHeight(heightFrameLayout - 1),
        };
        Button btnLeftLine = new Button
        {
            Width = Application.GetRealWidth(lineW),
            Height = Application.GetRealHeight(heightFrameLayout),
            BackgroundColor = MusicColor.ViewColor,
            Name = "btnLeftLine",
        };
        Button btnRightLine = new Button
        {
            Width = Application.GetRealWidth(lineW),
            Height = Application.GetRealHeight(heightFrameLayout),
            BackgroundColor = MusicColor.ViewColor,
            X = Application.GetRealWidth(widthFrameLayout - 1),
            Name = "btnRightLine",
        };
        /// <summary>
        /// 添加布局
        /// </summary>
        /// <param name="parent"></param>
        public void AddView(FrameLayout parent)
        {
            parent.AddChidren(this);
            this.AddChidren(btnImage);
            this.AddChidren(btnName);
        }
        public void AddImageView()
        {
            this.AddChidren(btnImage);
        }
        public void AddNameView()
        {
            this.AddChidren(btnName);
        }
        /// <summary>
        /// 添加左边线
        /// </summary>
        public void AddLeftLine()
        {
            this.AddChidren(btnLeftLine);
        }
        /// <summary>
        /// 添加右边线
        /// </summary>
        public void AddRightLine()
        {
            this.AddChidren(btnRightLine);
        }
        /// <summary>
        /// 添加顶部边线
        /// </summary>
        public void AddTopLine()
        {
            this.AddChidren(btnTopLine);
        }
        /// <summary>
        /// 添加底部边线
        /// </summary>
        public void AddBottomLine()
        {
            this.AddChidren(btnBottomLine);
        }
        public Button GetImageButton()
        {
            return this.btnImage;
        }
        public Button GetNameButton()
        {
            return btnName;
        }
        /// <summary>
        /// 事件监听方法
        /// </summary>
        /// <param name="action">回调(第一个是父类对象;第二个是图标对象;第三个是状态对象</param>
        public void SetClickListener(Action<FrameLayout, Button, Button> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                this.BackgroundColor = 0x00000000;
                action?.Invoke(this, btnImage, btnName);
                //弹起来还原背景颜色
            };
            this.MouseUpEventHandler += UpClick;
            btnImage.MouseUpEventHandler += UpClick;
            btnName.MouseUpEventHandler += UpClick;
            //EventHandler<MouseEventArgs> MoveClick = (sender, e) =>
            //{
            //    Console.WriteLine("移动事件=====");
            //    this.BackgroundColor = 0x00000000;
            //    action?.Invoke(this, btnImage, btnName);
            //    //弹起来还原背景颜色
            //};
            //this.MouseMoveEventHandler += MoveClick;
            //btnImage.MouseMoveEventHandler += MoveClick;
            //btnName.MouseMoveEventHandler += MoveClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                this.BackgroundColor = 0xff454635;
            };
            this.MouseDownEventHandler += DownClick;
            btnImage.MouseDownEventHandler += DownClick;
            btnName.MouseDownEventHandler += DownClick;
        }
        /// <summary>
        /// 设置图标
        /// </summary>
        /// <param name="stringId"></param>
        public void SetButtonImage(int stringId)
        {
            switch (stringId)
            {
                case StringId.kai:
                    {
                        this.btnImage.UnSelectedImagePath = "AksIcon/kai.png";
                    }
                    break;
            }
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
New file
@@ -0,0 +1,163 @@
using System;
using HDL_ON.UI.Music;
using Shared;
using System.Collections.Generic;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    /// <summary>
    /// 自定义圆角容器
    /// </summary>
    public class CornerFramLayout : BaseFramLayout
    {
        public const int cornerValue = 17;
        private int topMargin;
        private int leftMargin;
        private int bottomMargin;
        private int rightMargin;
        private int mRowNumber;
        private List<int> mList;
        public CornerFramLayout(int width, int height)
        {
            this.BackgroundColor = MusicColor.WhiteColor;
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealHeight(height);
            this.Radius = (uint)Application.GetRealHeight(cornerValue);
        }
        /// <summary>
        /// 设置边距
        /// </summary>
        /// <param name="top">上边距</param>
        /// <param name="bottom">下边距</param>
        /// <param name="left">左边距</param>
        /// <param name="right">右边距</param>
        public void SetMargin(int top, int bottom, int left, int right)
        {
            this.topMargin = top;
            this.bottomMargin = bottom;
            this.leftMargin = left;
            this.rightMargin = right;
        }
        /// <summary>
        /// 设置列表数据
        /// </summary>
        /// <param name="list"></param>
        public void SetList(List<int> list)
        {
            if (list == null)
            {
                list = new List<int>();
            }
            this.mList = list;
        }
        /// <summary>
        /// 获取测试列表数据
        /// </summary>
        public List<int> GetTestList(int count)
        {
            var list = new List<int>();
            for (int i = 1; i <= count; i++)
            {
                list.Add(i);
            }
            return list;
        }
        /// <summary>
        /// 加载按键界面
        /// </summary>
        /// <param name="rowNumber">一行几个元素</param>
        /// <param name="action">回调</param>
        public void LoadButtonPage(int rowNumber, Action<int> action)
        {
            if (rowNumber == 0)
            {
                return;
            }
            this.mRowNumber = rowNumber;
            int line = 0;
            int xCount = 0;
            for (int i = 1; i <= this.mList.Count; i++)
            {
                ButtonFramLayout buttonFram = new ButtonFramLayout();
                this.AddChidren(buttonFram);
                buttonFram.Tag = i - 1;
                buttonFram.Y = Application.GetRealHeight(this.topMargin) + Application.GetRealHeight(ButtonFramLayout.heightFrameLayout * line);
                buttonFram.X = Application.GetRealWidth(this.leftMargin) + Application.GetRealWidth(ButtonFramLayout.widthFrameLayout * xCount);
                buttonFram.AddImageView();
                buttonFram.AddNameView();
                if (!IsLastRight(i))
                {
                    buttonFram.AddRightLine();
                }
                if (!IsLastColumn(i))
                {
                    buttonFram.AddBottomLine();
                }
                buttonFram.GetNameButton().Text = i.ToString();
                xCount++;
                if (i % rowNumber == 0)
                {
                    line++;
                    xCount = 0;
                }
                buttonFram.SetClickListener((fl, btnIcon, btnName) =>
                {
                    action.Invoke((int)buttonFram.Tag);
                });
            }
            //this.AdjustRealHeight(this.bottomMargin);
        }
        /// <summary>
        /// 最后一行
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        private bool IsLastColumn(int value)
        {
            int lineCount = this.mList.Count / this.mRowNumber;
            int number = this.mList.Count % this.mRowNumber;
            if (number != 0)
            {
                if (value > lineCount * this.mRowNumber)
                {
                    return true;
                }
            }
            else
            {
                if (value > lineCount-- * this.mRowNumber)
                {
                    return true;
                }
            }
            return false;
        }
        /// <summary>
        /// 最后右边那一个
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        private bool IsLastRight(int value)
        {
            if (value % this.mRowNumber == 0)
            {
                return true;
            };
            return false;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
New file
@@ -0,0 +1,89 @@
using System;
using HDL_ON.UI.Music;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class MenuFramLayout : BaseFramLayout
    {
        public const int widthFrameLayout = 180;
        public const int heightFrameLayout = 180;
        public const int cornerValue = 90;
        public MenuFramLayout(int width = widthFrameLayout, int height = heightFrameLayout)
        {
            this.Width = Application.GetMinRealAverage(width);
            this.Height = Application.GetMinRealAverage(height);
            this.Radius = (uint)Application.GetRealHeight(cornerValue);
            this.BackgroundColor = MusicColor.ViewColor;
        }
        Button btnTop = new Button
        {
            Y = Application.GetMinRealAverage(16),
            X = Application.GetMinRealAverage(78),
            Width = Application.GetRealWidth(24),
            Height = Application.GetRealHeight(20),
            UnSelectedImagePath = "AksIcon/shang.png",
        };
        Button btnBottom = new Button
        {
            Y = Application.GetMinRealAverage(144),
            X = Application.GetMinRealAverage(78),
            Width = Application.GetRealWidth(24),
            Height = Application.GetRealHeight(20),
            UnSelectedImagePath = "AksIcon/xia.png",
        };
        Button btnLeft = new Button
        {
            Y = Application.GetMinRealAverage(78),
            X = Application.GetMinRealAverage(16),
            Width = Application.GetRealWidth(20),
            Height = Application.GetRealHeight(24),
            UnSelectedImagePath = "AksIcon/zuo.png",
        };
        Button btnRight = new Button
        {
            Y = Application.GetMinRealAverage(78),
            X = Application.GetMinRealAverage(144),
            Width = Application.GetRealWidth(20),
            Height = Application.GetRealHeight(24),
            UnSelectedImagePath = "AksIcon/you.png",
        };
        Button btnOkbj = new Button
        {
            Y = Application.GetMinRealAverage(52),
            X = Application.GetMinRealAverage(52),
            Width = Application.GetMinRealAverage(76),
            Height = Application.GetMinRealAverage(76),
            Radius = (uint)Application.GetRealHeight(38),
            BackgroundColor = MusicColor.WhiteColor,
        };
        Button btnOk = new Button
        {
            Y = Application.GetMinRealAverage(76),
            X = Application.GetMinRealAverage(76),
            Width = Application.GetMinRealAverage(28),
            Height = Application.GetMinRealAverage(28),
            Radius = (uint)Application.GetRealHeight(14),
            BackgroundColor = MusicColor.SelectedColor,
        };
        public void AddView(FrameLayout layout)
        {
            layout.AddChidren(this);
            this.AddChidren(btnTop);
            this.AddChidren(btnBottom);
            this.AddChidren(btnLeft);
            this.AddChidren(btnRight);
            this.AddChidren(btnOkbj);
            this.AddChidren(btnOk);
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/PayerFramLayout.cs
New file
@@ -0,0 +1,40 @@
using System;
using HDL_ON.UI.Music;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class PayerFramLayout : BaseFramLayout
    {
        public PayerFramLayout(int width, int height)
        {
            this.BackgroundColor = MusicColor.WhiteColor;
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealHeight(height);
            this.Radius = (uint)Application.GetRealHeight(17);
        }
        public void LoadPage()
        {
            TypeSingleFramLayout singleFramLayout = new TypeSingleFramLayout(101, 40);
            this.AddChidren(singleFramLayout);
            singleFramLayout.Y = Application.GetRealHeight(24);
            singleFramLayout.Gravity = Gravity.CenterHorizontal;
            singleFramLayout.AddBtnLeftImage();
            singleFramLayout.AddBtnName();
            singleFramLayout.AddBtnRightImage();
            MenuFramLayout menuFramLayout = new MenuFramLayout();
            menuFramLayout.Y = singleFramLayout.Bottom + Application.GetRealHeight(32);
            menuFramLayout.Gravity = Gravity.CenterHorizontal;
            menuFramLayout.AddView(this);
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs
New file
@@ -0,0 +1,175 @@
using HDL_ON.UI.Music;
using System;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class TypeMultiFramLayout:BaseFramLayout
    {
        private uint UpBackgroundColor = 0x00000000;
        private uint DownBackgroundColor = 0xff454635;
        public TypeMultiFramLayout()
        {
            this.BackgroundColor = MusicColor.ViewColor;
            this.Height = Application.GetRealHeight(40);
            this.Radius = (uint)Application.GetRealHeight(20);
        }
        Button btnLeftImage = new Button
        {
           X = Application.GetRealWidth(16),
            Width = Application.GetRealWidth(16),
            Height = Application.GetRealWidth(16),
            UnSelectedImagePath = "AksIcon/yingku.png",
            Gravity = Gravity.CenterVertical,
            Name = "btnLeftImage",
        };
        Button btnName1 = new Button
        {
            Width = Application.GetRealWidth(32),
            Height = Application.GetRealHeight(23),
            TextSize = TextSize.Text16,
            TextColor = MusicColor.TextColor,
            TextAlignment = TextAlignment.Center,
            Gravity = Gravity.CenterVertical,
            IsMoreLines = true,
            Name = "btnName",
        };
        Button btnRightImage = new Button
        {
            Width = Application.GetRealWidth(16),
            Height = Application.GetRealWidth(16),
            UnSelectedImagePath = "AksIcon/yingkunext.png",
            Gravity = Gravity.CenterVertical,
            Name = "btnRightImage",
        };
        public void AddBtnLeftImage()
        {
            this.AddChidren(btnLeftImage);
        }
        public void AddBtnName(int gap = 4)
        {
            if (this.IsAddBtn(btnLeftImage))
            {
                btnName1.X = btnLeftImage.Right + Application.GetRealWidth(gap);
            }
            //if (btnName.GetTextWidth() < btnName.Width)
            //{
            //    btnName.Width = btnName.GetTextWidth();
            //}
            this.AddChidren(btnName1);
        }
        public void AddBtnRightImage(int gap = 8)
        {
            if (this.IsAddBtn(btnName1))
            {
                btnRightImage.X = btnName1.Right + Application.GetRealWidth(gap);
                if (gap == 8)
                {
                    btnRightImage.Width = Application.GetRealWidth(5);
                    btnRightImage.Height = Application.GetRealHeight(8);
                }
            }
            this.AddChidren(btnRightImage);
        }
        public Button GetBtnLeftImage()
        {
            return btnLeftImage;
        }
        public Button GetBtnName()
        {
            return btnName1;
        }
        public Button GetBtnRightImage()
        {
            return btnRightImage;
        }
        public void SetClickUpBackgroundColor(uint backgroundColor)
        {
            this.UpBackgroundColor = backgroundColor;
        }
        public void SetClickDownBackgroundColor(uint backgroundColor)
        {
            this.DownBackgroundColor = backgroundColor;
        }
        /// <summary>
        /// 事件监听方法
        /// </summary>
        /// <param name="action">回调(第一个是父类对象;第二个是图标对象;第三个是状态对象</param>
        public void SetClickListener(Action<FrameLayout, Button, Button, Button> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                this.BackgroundColor = this.UpBackgroundColor;
                action?.Invoke(this, btnLeftImage, btnName1, btnRightImage);
                //弹起来还原背景颜色
            };
            this.MouseUpEventHandler += UpClick;
            btnLeftImage.MouseUpEventHandler += UpClick;
            btnName1.MouseUpEventHandler += UpClick;
            btnRightImage.MouseUpEventHandler += UpClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                this.BackgroundColor = this.DownBackgroundColor;
            };
            this.MouseDownEventHandler += DownClick;
            btnLeftImage.MouseDownEventHandler += DownClick;
            btnName1.MouseDownEventHandler += DownClick;
            btnRightImage.MouseDownEventHandler += DownClick;
        }
        /// <summary>
        /// 在父布局查找子控件是否存在
        /// </summary>
        /// <param name="btn">查找对象</param>
        /// <returns>存在为true,否则为false</returns>
        private bool IsAddBtn(View btn)
        {
            if (this.ChildrenCount <= 0 || btn == null)
            {
                return false;
            }
            for (int i = 0; i < this.ChildrenCount; i++)
            {
                View view = this.GetChildren(i);
                if (view == null)
                {
                    continue;
                }
                if (view is Button)
                {
                    if (view.Name == btn.Name)
                    {
                        return true;
                    }
                }
            }
            return false;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs
New file
@@ -0,0 +1,179 @@
using HDL_ON.UI.Music;
using System;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class TypeSingleFramLayout : BaseFramLayout
    {
        private uint UpBackgroundColor = 0x00000000;
        private uint DownBackgroundColor = 0xff454635;
        public TypeSingleFramLayout(int width, int height)
        {
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealHeight(height);
            this.Radius = (uint)Application.GetRealHeight(20);
            this.BackgroundColor = MusicColor.ViewColor;
        }
        Button btnLeftImage = new Button
        {
            X=Application.GetRealWidth(16),
            Width = Application.GetRealWidth(16),
            Height = Application.GetRealWidth(16),
            UnSelectedImagePath = "AksIcon/yingku.png",
            Gravity = Gravity.CenterVertical,
            Name = "btnLeftImage",
        };
        Button btnName = new Button
        {
            Width = Application.GetRealWidth(32),
            Height = Application.GetRealHeight(23),
           TextID=StringId.yingku,
            TextSize = TextSize.Text16,
            TextColor = MusicColor.TextColor,
            TextAlignment = TextAlignment.Center,
            Gravity = Gravity.CenterVertical,
            IsMoreLines = true,
            Name = "btnName",
        };
        Button btnRightImage = new Button
        {
            Width = Application.GetRealWidth(16),
            Height = Application.GetRealWidth(16),
            UnSelectedImagePath = "AksIcon/yingkunext.png",
            Gravity = Gravity.CenterVertical,
            Name = "btnRightImage",
        };
        public void AddBtnLeftImage()
        {
            this.AddChidren(btnLeftImage);
        }
        public void AddBtnName(int gap = 4)
        {
            this.AddChidren(btnName);
            if (this.IsAddBtn(btnLeftImage))
            {
                btnName.X = btnLeftImage.Right + Application.GetRealWidth(gap);
            }
            //if (btnName.GetTextWidth() < btnName.Width)
            //{
            //    btnName.Width = btnName.GetTextWidth();
            //}
        }
        public void AddBtnRightImage(int gap = 8)
        {
            this.AddChidren(btnRightImage);
            if (this.IsAddBtn(btnName))
            {
                btnRightImage.X = btnName.Right + Application.GetRealWidth(gap);
                if (gap == 8)
                {
                    btnRightImage.Width = Application.GetRealWidth(5);
                    btnRightImage.Height = Application.GetRealHeight(8);
                }
            }
        }
        public Button GetBtnLeftImage()
        {
            return btnLeftImage;
        }
        public Button GetBtnName()
        {
            return btnName;
        }
        public Button GetBtnRightImage()
        {
            return btnRightImage;
        }
        public void SetClickUpBackgroundColor(uint backgroundColor)
        {
            this.UpBackgroundColor = backgroundColor;
        }
        public void SetClickDownBackgroundColor(uint backgroundColor)
        {
            this.DownBackgroundColor = backgroundColor;
        }
        /// <summary>
        /// 事件监听方法
        /// </summary>
        /// <param name="action">回调(第一个是父类对象;第二个是图标对象;第三个是状态对象</param>
        public void SetClickListener(Action<FrameLayout, Button, Button, Button> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                this.BackgroundColor = this.UpBackgroundColor;
                action?.Invoke(this, btnLeftImage, btnName, btnRightImage);
                //弹起来还原背景颜色
            };
            this.MouseUpEventHandler += UpClick;
            btnLeftImage.MouseUpEventHandler += UpClick;
            btnName.MouseUpEventHandler += UpClick;
            btnRightImage.MouseUpEventHandler += UpClick;
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                this.BackgroundColor = this.DownBackgroundColor;
            };
            this.MouseDownEventHandler += DownClick;
            btnLeftImage.MouseDownEventHandler += DownClick;
            btnName.MouseDownEventHandler += DownClick;
            btnRightImage.MouseDownEventHandler += DownClick;
        }
        /// <summary>
        /// 在父布局查找子控件是否存在
        /// </summary>
        /// <param name="btn">查找对象</param>
        /// <returns>存在为true,否则为false</returns>
        private bool IsAddBtn(View btn)
        {
            if (this.ChildrenCount <= 0 || btn == null)
            {
                return false;
            }
            for (int i = 0; i < this.ChildrenCount; i++)
            {
                View view = this.GetChildren(i);
                if (view == null)
                {
                    continue;
                }
                if (view is Button)
                {
                    if (view.Name == btn.Name)
                    {
                        return true;
                    }
                }
            }
            return false;
        }
    }
}