From ee5f2543624a0e3ae9d046062b822727a31685e1 Mon Sep 17 00:00:00 2001 From: tzy <hxb@hdlchina.com.cn> Date: 星期五, 14 五月 2021 17:15:48 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/wxr4' into dev-tzy --- HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs | 268 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 268 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs new file mode 100644 index 0000000..cefa915 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs @@ -0,0 +1,268 @@ +锘縰sing System; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; +namespace HDL_ON.UI +{ + public class ArmCenterPage : FrameLayout + { + /// <summary> + /// 涓荤獥浣� + /// </summary> + FrameLayout bodyView; + public ArmCenterPage() + { + bodyView = this; + } + + public void LoadPage() + { + Action skipAction = () => { + + }; + + new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView_ArmCenter(skipAction); + + VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(667 - 64), + BackgroundColor = CSS_Color.MainBackgroundColor, + ScrollEnabled = false, + }; + bodyView.AddChidren(contentView); + + contentView.AddChidren(new Button() + { + Height =Application.GetRealWidth(32), + }); + + //瀹夐槻鐘舵�佽儗鏅浘 + Button btnArmTipIcon = new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(198), + Height = Application.GetRealWidth(198), + UnSelectedImagePath = "FunctionIcon/ArmCenter/NoDefenseBigIcon.png", + SelectedImagePath = "FunctionIcon/ArmCenter/InDefenseBigIcon.png", + }; + contentView.AddChidren(btnArmTipIcon); + + contentView.AddChidren(new Button() + { + Height = Application.GetRealWidth(16), + }); + + #region 鑷畾涔夊竷闃� + //鑷畾涔夊竷闃叉爣棰� + Button btnCustomDeploymentTitle = new Button() + { + X = Application.GetRealWidth(24), + Height = Application.GetRealWidth(54), + TextAlignment = TextAlignment.CenterLeft, + IsBold = true, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + TextID = StringId.CustomDeployment, + }; + contentView.AddChidren(btnCustomDeploymentTitle); + + HorizontalScrolViewLayout customDeploymentView = new HorizontalScrolViewLayout() + { + X = Application.GetRealWidth(23), + Height = Application.GetRealWidth(80), + ScrollEnabled = false, + }; + 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); + + if(FunctionList.List.securities.Count>3) + { + customDeploymentView.ScrollEnabled = true; + } + + foreach (var mode in FunctionList.List.securities) + { + } + #endregion + + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(20), + }); + + var fixedDeploymentView = new FrameLayout() + { + Height = Application.GetRealHeight(133), + }; + 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), + ScrollEnabled = false, + }; + 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); + + } + } + + + /// <summary> + /// 瀹夐槻鑷畾涔夋帶浠� + /// </summary> + public class ArmDiyView + { + + /// <summary> + /// + /// </summary> + /// <param name="UnSelectedIconPath">鍥剧墖璺緞</param> + /// <param name="SelectedIconPath">鍥剧墖璺緞</param> + /// <param name="Text">鏄剧ず鏂囨湰</param> + public FrameLayout DiyArmView(string UnSelectedIconPath, string SelectedIconPath, string Text) + { + var view = new FrameLayout() + { + Width = Application.GetRealWidth(82), + Height = Application.GetRealWidth(80), + }; + + Button btnIcon = new Button() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(40), + Height = Application.GetRealWidth(40), + UnSelectedImagePath = UnSelectedIconPath, + SelectedImagePath = SelectedIconPath, + }; + view.AddChidren(btnIcon); + + Button btnText = new Button() + { + Y = Application.GetRealWidth(40), + Height = Application.GetRealWidth(41), + Text = Text, + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + }; + 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; + } + } +} -- Gitblit v1.8.0