From 41995c4cd30ca1c5a814ea0af6f70d3b86368137 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 20 八月 2021 09:07:07 +0800
Subject: [PATCH] 2021-08-20 09:06:44
---
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs | 163 ++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 127 insertions(+), 36 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs
index cefa915..6ab343a 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs
@@ -21,7 +21,7 @@
};
- new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView_ArmCenter(skipAction);
+ new TopViewDiv(bodyView, Language.StringByID(StringId.SecurityCenter)).LoadTopView_ArmCenter(skipAction);
VerticalScrolViewLayout contentView = new VerticalScrolViewLayout()
{
@@ -79,11 +79,15 @@
//{
// Width = Application.GetRealWidth(23),
//});
-
- var adv = new ArmDiyView();
- var view = adv.DiyArmView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png",
+ var view = new ArmDiyView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png",
Language.StringByID(StringId.HouseDefense));
customDeploymentView.AddChidren(view);
+ EventHandler<MouseEventArgs> event1 = (sender, e) =>
+ {
+ ShowArmDialog(new SecurityAlarm());
+ };
+ view.SetClickEvent(event1);
+
if(FunctionList.List.securities.Count>3)
{
@@ -148,7 +152,7 @@
//鐏惧鎶ヨ
- var disasterAlarmView = adv.FixedArmView("FunctionIcon/ArmCenter/DisasterAlarmIcon.png", Language.StringByID(StringId.DisasterDefense), Language.StringByID(StringId.Defense24Hour));
+ var disasterAlarmView = new FixedArmView("FunctionIcon/ArmCenter/DisasterAlarmIcon.png", Language.StringByID(StringId.DisasterDefense), Language.StringByID(StringId.Defense24Hour));
fixedDeploymentTypeView.AddChidren(disasterAlarmView);
fixedDeploymentTypeView.AddChidren(new Button()
@@ -157,34 +161,115 @@
});
//闃茬洍鎶ヨ
- var burglarAlarmView = adv.FixedArmView("FunctionIcon/ArmCenter/BurglarAlarmIcon.png", Language.StringByID(StringId.BurglarAlarm), Language.StringByID(StringId.AlarmMute));
+ var burglarAlarmView = new FixedArmView("FunctionIcon/ArmCenter/BurglarAlarmIcon.png", Language.StringByID(StringId.BurglarAlarm), Language.StringByID(StringId.AlarmMute));
fixedDeploymentTypeView.AddChidren(burglarAlarmView);
}
+
+
+
+ private void ShowArmDialog(SecurityAlarm alarm)
+ {
+ Dialog dialog = new Dialog();
+
+ FrameLayout contentView = new FrameLayout();
+ dialog.AddChidren(contentView);
+ contentView.MouseUpEventHandler = (sender, e) =>
+ {
+ dialog.Close();
+ };
+
+ VerticalScrolViewLayout optinView = new VerticalScrolViewLayout() {
+ Gravity = Gravity.CenterHorizontal,
+ Y = Application.GetRealHeight(515),
+ Width = Application.GetRealWidth(343),
+ Height = Application.GetRealHeight(88),
+ Radius = (uint)Application.GetRealHeight(13),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ };
+ contentView.AddChidren(optinView);
+
+ Button btnOpen = new Button()
+ {
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.MainColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextID = StringId.OpenArm
+ };
+ optinView.AddChidren(btnOpen);
+
+ optinView.AddChidren(new Button() {
+ Height = 1,
+ BackgroundColor = CSS_Color.DividingLineColor
+ });
+
+ Button btnCheckModify = new Button()
+ {
+ Height = Application.GetRealHeight(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.PromptingColor1,
+ TextID = StringId.CheckModify,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ };
+ optinView.AddChidren(btnCheckModify);
+
+
+ Button btnCancel = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y = optinView.Bottom + Application.GetRealHeight(8),
+ Width = Application.GetRealWidth(343),
+ Height = Application.GetRealHeight(44),
+ Radius = (uint)Application.GetRealHeight(13),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ TextID = StringId.Cancel,
+ TextColor = CSS_Color.WarningColor,
+ IsBold = true,
+ };
+ contentView.AddChidren(btnCancel);
+
+ dialog.Show();
+
+
+ btnCheckModify.MouseUpEventHandler = (sender, e) => {
+ dialog.Close();
+ var armSetPage = new ArmDeploymentSettingPage(alarm);
+ MainPage.BasePageView.AddChidren(armSetPage);
+ armSetPage.LoadPage();
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ };
+
+ btnCancel.MouseUpEventHandler = (sender, e) =>
+ {
+ dialog.Close();
+ };
+
+ }
+
+
}
/// <summary>
/// 瀹夐槻鑷畾涔夋帶浠�
/// </summary>
- public class ArmDiyView
+ public class ArmDiyView : FrameLayout
{
-
+ Button btnIcon;
+ Button btnText;
/// <summary>
- ///
+ /// 鑷畾涔夊竷闃茬晫闈�
/// </summary>
/// <param name="UnSelectedIconPath">鍥剧墖璺緞</param>
/// <param name="SelectedIconPath">鍥剧墖璺緞</param>
/// <param name="Text">鏄剧ず鏂囨湰</param>
- public FrameLayout DiyArmView(string UnSelectedIconPath, string SelectedIconPath, string Text)
+ public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text)
{
- var view = new FrameLayout()
- {
- Width = Application.GetRealWidth(82),
- Height = Application.GetRealWidth(80),
- };
+ this.Width = Application.GetRealWidth(82);
+ this.Height = Application.GetRealWidth(80);
- Button btnIcon = new Button()
+ btnIcon = new Button()
{
Gravity = Gravity.CenterHorizontal,
Width = Application.GetRealWidth(40),
@@ -192,9 +277,9 @@
UnSelectedImagePath = UnSelectedIconPath,
SelectedImagePath = SelectedIconPath,
};
- view.AddChidren(btnIcon);
+ this.AddChidren(btnIcon);
- Button btnText = new Button()
+ btnText = new Button()
{
Y = Application.GetRealWidth(40),
Height = Application.GetRealWidth(41),
@@ -203,28 +288,34 @@
TextColor = CSS_Color.TextualColor,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
};
- view.AddChidren(btnText);
-
-
- return view;
+ this.AddChidren(btnText);
}
+ public void SetClickEvent(EventHandler<MouseEventArgs> eventHandler)
+ {
+ this.MouseUpEventHandler = eventHandler;
+ btnIcon.MouseUpEventHandler = eventHandler;
+ btnText.MouseUpEventHandler = eventHandler;
+ }
+
+
+ }
+
+ public class FixedArmView : FrameLayout
+ {
/// <summary>
- ///
+ /// 鍥哄畾甯冮槻鎺т欢
/// </summary>
/// <param name="iconPath"></param>
/// <param name="title"></param>
/// <param name="titleTip"></param>
- public FrameLayout FixedArmView(string iconPath,string title,string titleTip)
+ public 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,
- };
+ this.Width = Application.GetRealWidth(144);
+ this.Height = Application.GetRealHeight(66);
+ this.Radius = (uint)Application.GetRealWidth(6);
+ this.BorderColor = CSS_Color.MainColor;
+ this.BorderWidth = 1;
var btnIcon = new Button()
{
@@ -234,7 +325,7 @@
Gravity = Gravity.CenterVertical,
UnSelectedImagePath = iconPath,// "FunctionIcon/ArmCenter/DisasterAlarmIcon.png",
};
- view.AddChidren(btnIcon);
+ this.AddChidren(btnIcon);
var btnTitle = new Button()
{
@@ -247,7 +338,7 @@
Text = title,
IsBold = true,
};
- view.AddChidren(btnTitle);
+ this.AddChidren(btnTitle);
var btnTitleTip = new Button()
{
@@ -260,9 +351,9 @@
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
Text = titleTip,
};
- view.AddChidren(btnTitleTip);
+ this.AddChidren(btnTitleTip);
- return view;
}
}
+
}
--
Gitblit v1.8.0