wei
2021-04-27 0d327ccb7ef675bfa9f669ba5b3ad6bc6958cbf5
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs
@@ -1,7 +1,8 @@
using System;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.ArmCenter
namespace HDL_ON.UI
{
    public class ArmCenterPage : FrameLayout
    {
@@ -24,6 +25,7 @@
            VerticalScrolViewLayout contentView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(603),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                ScrollEnabled = false,
@@ -51,6 +53,7 @@
                Height = Application.GetRealWidth(16),
            });
            #region 自定义布防
            //自定义布防标题
            Button btnCustomDeploymentTitle = new Button()
            {
@@ -71,11 +74,84 @@
            };
            contentView.AddChidren(customDeploymentView);
            //customDeploymentView.AddChidren(new Button()
            //{
            //    Width = Application.GetRealWidth(23),
            //});
            var adv = new ArmDiyView();
            var view = adv.DiyArmView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png",
                Language.StringByID(StringId.HouseDefense));
            customDeploymentView.AddChidren(view);
            foreach (var mode in FunctionList.List.securities)
            {
            }
            #endregion
            contentView.AddChidren(new Button()
            {
                Height = Application.GetRealHeight(20),
            });
            var fixedDeploymentView = new FrameLayout()
            {
                Height = Application.GetRealHeight(123),
            };
            contentView.AddChidren(fixedDeploymentView);
            Button btnFixedDeploymentTitle = new Button()
            {
                X = Application.GetRealWidth(24),
                Height = Application.GetRealWidth(24),
                TextAlignment = TextAlignment.CenterLeft,
                IsBold = true,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextID = StringId.FixedDeployment,
            };
            fixedDeploymentView.AddChidren(btnFixedDeploymentTitle);
            Button btnFixedDeploymentTip = new Button()
            {
                X = Application.GetRealWidth(24),
                Y = btnFixedDeploymentTitle.Bottom,
                Height = Application.GetRealWidth(19),
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextColor = CSS_Color.MainColor,
                TextID = StringId.UndoDefenseDoesNotAffect
            };
            fixedDeploymentView.AddChidren(btnFixedDeploymentTip);
            //固定布防区域
            var fixedDeploymentTypeView = new HorizontalScrolViewLayout()
            {
                Y = btnFixedDeploymentTip.Bottom + Application.GetRealHeight(15),
                Height = Application.GetRealHeight(80),
            };
            fixedDeploymentView.AddChidren(fixedDeploymentTypeView);
            fixedDeploymentTypeView.AddChidren(new Button()
            {
                Width = Application.GetRealWidth(24),
            });
            //灾害报警
            var disasterAlarmView = adv.FixedArmView("FunctionIcon/ArmCenter/DisasterAlarmIcon.png", Language.StringByID(StringId.DisasterDefense), Language.StringByID(StringId.Defense24Hour));
            fixedDeploymentTypeView.AddChidren(disasterAlarmView);
            fixedDeploymentTypeView.AddChidren(new Button()
            {
                Width = Application.GetRealWidth(30),
            });
            //防盗报警
            var burglarAlarmView = adv.FixedArmView("FunctionIcon/ArmCenter/BurglarAlarmIcon.png", Language.StringByID(StringId.BurglarAlarm), Language.StringByID(StringId.AlarmMute));
            fixedDeploymentTypeView.AddChidren(burglarAlarmView);
        }
    }
@@ -86,16 +162,16 @@
    /// </summary>
    public class ArmDiyView
    {
        public FrameLayout ArmDiyButton;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="IconPath">图片路径</param>
        /// <param name="UnSelectedIconPath">图片路径</param>
        /// <param name="SelectedIconPath">图片路径</param>
        /// <param name="Text">显示文本</param>
        public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text)
        public FrameLayout DiyArmView(string UnSelectedIconPath, string SelectedIconPath, string Text)
        {
            ArmDiyButton = new FrameLayout()
            var view = new FrameLayout()
            {
                Width = Application.GetRealWidth(82),
                Height = Application.GetRealWidth(80),
@@ -109,7 +185,7 @@
                UnSelectedImagePath = UnSelectedIconPath,
                SelectedImagePath = SelectedIconPath,
            };
            ArmDiyButton.AddChidren(btnIcon);
            view.AddChidren(btnIcon);
            Button btnText = new Button()
            {
@@ -120,9 +196,66 @@
                TextColor = CSS_Color.TextualColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
            ArmDiyButton.AddChidren(btnText);
            view.AddChidren(btnText);
            return view;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="iconPath"></param>
        /// <param name="title"></param>
        /// <param name="titleTip"></param>
        public FrameLayout FixedArmView(string iconPath,string title,string titleTip)
        {
            var view = new FrameLayout()
            {
                Width = Application.GetRealWidth(144),
                Height = Application.GetRealHeight(66),
                Radius = (uint)Application.GetRealWidth(6),
                BorderColor = CSS_Color.MainColor,
                BorderWidth = 1,
            };
            var btnIcon = new Button()
            {
                X = Application.GetRealWidth(15),
                Width = Application.GetRealWidth(24),
                Height = Application.GetRealWidth(24),
                Gravity = Gravity.CenterVertical,
                UnSelectedImagePath = iconPath,// "FunctionIcon/ArmCenter/DisasterAlarmIcon.png",
            };
            view.AddChidren(btnIcon);
            var btnTitle = new Button()
            {
                X = Application.GetRealWidth(55),
                Width = Application.GetRealWidth(89),
                Height = Application.GetRealHeight(44),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                Text = title,
                IsBold = true,
            };
            view.AddChidren(btnTitle);
            var btnTitleTip = new Button()
            {
                X = Application.GetRealWidth(55),
                Y = Application.GetRealHeight(23),
                Width = Application.GetRealWidth(89),
                Height = Application.GetRealHeight(44),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                Text = titleTip,
            };
            view.AddChidren(btnTitleTip);
            return view;
        }
    }
}