wxr
2022-12-07 03d8399009aacc15efde15f08e37893e47dc2427
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -79,6 +79,9 @@
                    case "angle"://角度
                        LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "angle"));
                        break;
                    case "security"://大华摄像布防撤防
                        LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "security"));
                        break;
                }
            }
@@ -332,6 +335,9 @@
            {
                switch (sceneStatus.key)
                {
                    case FunctionAttributeKey.Security:
                        LoadEditDialog_Security(sceneStatus, btnFunctionText);
                        break;
                    case FunctionAttributeKey.OnOff:
                        LoadEditDialog_OnOff(sceneStatus, btnFunctionText);
                        break;
@@ -583,6 +589,109 @@
        }
        /// <summary>
        /// 加载安防布防选择弹窗
        /// </summary>
        /// <param name="function"></param>
        /// <param name="btn"></param>
        void LoadEditDialog_Security(SceneFunctionStatus trait, Button btn)
        {
            Dialog dialog = new Dialog();
            var pView = new FrameLayout()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            dialog.AddChidren(pView);
            var optionBaseView = new FrameLayout()
            {
                Y = Application.GetRealHeight(500),
                Height = Application.GetRealHeight(160),
                AnimateSpeed = 0.3f,
                Animate = Animate.DownToUp,
            };
            pView.AddChidren(optionBaseView);
            var optionView = new VerticalScrolViewLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(100),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
                ScrollEnabled = false,
            };
            optionBaseView.AddChidren(optionView);
            var btnOn = new Button()
            {
                Height = Application.GetRealHeight(50),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.TextualColor,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.Defense,
                IsSelected = trait.value.ToString() == "true"
            };
            optionView.AddChidren(btnOn);
            optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
            var btnOff = new Button()
            {
                Height = Application.GetRealHeight(50),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.TextualColor,
                SelectedTextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextID = StringId.Undefense,
                IsSelected = trait.value.ToString() == "false"
            };
            optionView.AddChidren(btnOff);
            var btnCancel = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(8) + optionView.Bottom,
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(50),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
                TextID = StringId.Cancel,
                TextColor = CSS_Color.WarningColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
            };
            optionBaseView.AddChidren(btnCancel);
            dialog.Show();
            pView.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
            };
            btnCancel.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
            };
            btnOn.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
                trait.value = "true";
                sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Security).value = "true";
                btn.Text = trait.GetValueText() + trait.GetUintString();
            };
            btnOff.MouseUpEventHandler = (sender, e) => {
                dialog.Close();
                trait.value = "false";
                sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Security).value = "false";
                btn.Text = trait.GetValueText() + trait.GetUintString();
            };
        }
        /// <summary>
        /// 加载温度选择弹窗
        /// </summary>