From 313ca44a4c4fc9cecbe145c80b26f16af836b7bf Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期五, 20 十二月 2019 13:41:35 +0800
Subject: [PATCH] 2019-12-20-1
---
ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs | 156 +++++++++++++++++++++++++++------------------------
1 files changed, 82 insertions(+), 74 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
index 7c92a85..b44fd18 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -1,4 +1,4 @@
-锘縰sing System;
+锘� using System;
using System.Collections.Generic;
using Shared;
using Shared.Common;
@@ -8,9 +8,10 @@
namespace Shared.Phone.Device.Logic
{
+
public class AddLogicPage : FrameLayout
{
- public AddLogicPage ()
+ public AddLogicPage()
{
Tag = "Logic";
}
@@ -22,27 +23,28 @@
{
BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
Height = Application.GetRealHeight(184),
- LineColor= ZigbeeColor.Current.LogicRowLayoutTopLineColor,
+ LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
};
this.AddChidren(topRowLayout);
var titleName = new Button {
- TextSize = 16,
+ TextSize = 17,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
TextAlignment = TextAlignment.CenterLeft,
X = Application.GetRealWidth(176),
- Width = Application.GetRealWidth(400),
+ Width = Application.GetRealWidth(600),
Height = Application.GetRealHeight(69),
Y = Application.GetRealHeight(92),
TextID = MyInternationalizationString.selection,
+ IsBold = true,
};
topRowLayout.AddChidren(titleName);
var clickBtn = new Button
{
Width = Application.GetRealWidth(81 + 51),
- Height = Application.GetRealHeight(58+40),
- Y = Application.GetRealHeight(98-40),
+ Height = Application.GetRealHeight(58 + 40),
+ Y = Application.GetRealHeight(98 - 40),
};
topRowLayout.AddChidren(clickBtn);
clickBtn.MouseDownEventHandler += (sender, e) =>
@@ -59,28 +61,28 @@
//Gravity = Gravity.CenterVertical;
UnSelectedImagePath = "ZigeeLogic/back.png",
};
- topRowLayout.AddChidren (back);
+ topRowLayout.AddChidren(back);
back.MouseDownEventHandler += (sender, e) => {
- RemoveFromParent ();
+ RemoveFromParent();
};
#endregion
#region 鏈�涓嬮潰鐨勫竷灞�浠g爜
var middle = new FrameLayout {
- Y=topRowLayout.Bottom,
- Height=Application.GetRealHeight(1920-184),
+ Y = topRowLayout.Bottom,
+ Height = Application.GetRealHeight(1920 - 184),
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
- this.AddChidren (middle);
+ this.AddChidren(middle);
#region ----鏃堕棿鏉′欢----
- var timeframelayout= new FrameLayout
+ var timeframelayout = new FrameLayout
{
Height = Application.GetRealHeight(160),
BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
};
middle.AddChidren(timeframelayout);
-
+
var timeiconBtn = new Button
{
@@ -99,16 +101,17 @@
Width = Application.GetRealWidth(850),
Height = Application.GetRealHeight(130),
X = Application.GetRealWidth(176),
- LineColor= ZigbeeColor.Current.LogicRowLayoutLineColor,
+ LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
};
timeframelayout.AddChidren(timerow);
///鏃堕棿鏉′欢
var btntime = new Button {
- Text=Language.StringByID (MyInternationalizationString.timecondition),
+ Text = Language.StringByID(MyInternationalizationString.timecondition),
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ TextSize=15,
};
- timerow.AddChidren (btntime);
+ timerow.AddChidren(btntime);
var btntimeback = new Button {
Width = Application.GetRealWidth(58),
@@ -117,7 +120,7 @@
X = Application.GetRealWidth(789),
Gravity = Gravity.CenterVertical,
};
- timerow.AddChidren (btntimeback);
+ timerow.AddChidren(btntimeback);
EventHandler<MouseEventArgs> timeclick = (sender, e) =>
{
@@ -138,7 +141,7 @@
BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
Y = timeframelayout.Bottom,
};
- middle.AddChidren (deviceframelayout);
+ middle.AddChidren(deviceframelayout);
var deviceiconBtn = new Button
{
@@ -161,15 +164,16 @@
};
deviceframelayout.AddChidren(devicerow);
-
+
///璁惧鐘舵�佹潯浠�
var btndevice = new Button {
//Text = "璁惧鐘舵�佹潯浠�",
TextID = MyInternationalizationString.device,
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ TextSize = 15,
};
- devicerow.AddChidren (btndevice);
+ devicerow.AddChidren(btndevice);
var btndeviceback = new Button {
Width = Application.GetRealWidth(58),
@@ -179,7 +183,7 @@
UnSelectedImagePath = "ZigeeLogic/next.png",
};
- devicerow.AddChidren (btndeviceback);
+ devicerow.AddChidren(btndeviceback);
EventHandler<MouseEventArgs> devicestateclick = (sender, e) =>
{
@@ -231,6 +235,7 @@
TextAlignment = TextAlignment.CenterLeft,
TextID = MyInternationalizationString.security,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ TextSize = 15,
};
securityrow.AddChidren(btnsecurity);
@@ -240,7 +245,7 @@
Height = Application.GetRealHeight(58),
UnSelectedImagePath = "ZigeeLogic/next.png",
X = Application.GetRealWidth(789),
- Gravity=Gravity.CenterVertical,
+ Gravity = Gravity.CenterVertical,
};
securityrow.AddChidren(btnsecurityback);
@@ -291,6 +296,7 @@
TextAlignment = TextAlignment.CenterLeft,
TextID = MyInternationalizationString.location,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ TextSize = 15,
};
locationrow.AddChidren(btnlocation);
@@ -319,8 +325,8 @@
#region ----宸叉湁鑷姩鍖栨潯浠�----
var existencerowlayout = new RowLayout {
- Height = Application.GetRealHeight (180),
- Y= securityframelayout.Bottom,
+ Height = Application.GetRealHeight(180),
+ Y = securityframelayout.Bottom,
};
//middle.AddChidren (existencerowlayout);
///宸叉湁鑷姩鍖栨潯浠�
@@ -331,35 +337,37 @@
X = Application.GetRealWidth(60),
TextID = MyInternationalizationString.automation,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+ TextSize = 15,
};
- existencerowlayout.AddChidren (btnexistence);
+ existencerowlayout.AddChidren(btnexistence);
var btnexistenceback = new Button {
- Width = Application.GetRealWidth (110),
- Height = Application.GetRealHeight (110),
+ Width = Application.GetRealWidth(110),
+ Height = Application.GetRealHeight(110),
UnSelectedImagePath = "ZigeeLogic/next.png",
SelectedImagePath = "ZigeeLogic/NextSelecte.png",
- X = Application.GetRealWidth (1080 - 140),
- Gravity=Gravity.CenterVertical,
+ X = Application.GetRealWidth(1080 - 140),
+ Gravity = Gravity.CenterVertical,
};
- existencerowlayout.AddChidren (btnexistenceback);
+ existencerowlayout.AddChidren(btnexistenceback);
EventHandler<MouseEventArgs> logicclick = (sender, e) => {
- var logicListAutomation = new LogicListAutomation ();
- UserView.HomePage.Instance.AddChidren (logicListAutomation);
+ var logicListAutomation = new LogicListAutomation();
+ UserView.HomePage.Instance.AddChidren(logicListAutomation);
UserView.HomePage.Instance.PageIndex += 1;
- logicListAutomation.Show ();
+ logicListAutomation.Show();
};
btnexistenceback.MouseUpEventHandler += logicclick;
btnexistence.MouseUpEventHandler += logicclick;
existencerowlayout.MouseUpEventHandler += logicclick;
#endregion
-
+
#endregion
}
+
/// <summary>
/// 瀹夐槻鏉′欢View
/// </summary>
@@ -376,23 +384,17 @@
flMain.RemoveFromParent();
};
- var securityfra1= new FrameLayout
- {
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(100),
- Y = Application.GetRealHeight(1920 - 100),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- };
- flMain.AddChidren(securityfra1);
+
var securityfra = new FrameLayout
{
Width = Application.GetRealWidth(1080),
Height = Application.GetRealHeight(690),
- Y = Application.GetRealHeight(1920-690),
+ Y = Application.GetRealHeight(1920 - 690),
BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- Radius = (uint)Application.GetRealHeight(60),
+ //Radius = (uint)Application.GetRealHeight(60),
};
flMain.AddChidren(securityfra);
+ securityfra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
#region -------鍙栨秷 瀹屾垚
var timetype = new RowLayout
{
@@ -408,6 +410,7 @@
Width = Application.GetRealWidth(200),
X = Application.GetRealWidth(80),
TextAlignment = TextAlignment.CenterLeft,
+ TextSize = 14,
};
timetype.AddChidren(Btncancel);
Btncancel.MouseUpEventHandler += (sender16, e16) =>
@@ -435,6 +438,7 @@
Width = Application.GetRealWidth(200),
TextAlignment = TextAlignment.CenterRight,
X = Btntitle.Right + Application.GetRealWidth(100),
+ TextSize = 14,
};
timetype.AddChidren(Btncomplete);
@@ -469,6 +473,7 @@
TextID = MyInternationalizationString.logicathomegarrison,
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
+ TextSize = 14,
};
athomedefenceRowLayout.AddChidren(btnathomedefence);
@@ -502,6 +507,7 @@
TextID = MyInternationalizationString.logicremovehomegarrison,
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
+ TextSize = 14,
};
leavehomedefenceRowLayout.AddChidren(leavehomebtndefence);
var leavehomedefenceSelected = new SelectedButton();
@@ -533,6 +539,7 @@
TextID = MyInternationalizationString.withdrawal,
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
+ TextSize = 14,
};
withdrawalRowLayout.AddChidren(btnwithdrawal);
var withdrawalSelected = new SelectedButton();
@@ -696,7 +703,7 @@
UserView.HomePage.Instance.PageIndex += 1;
logicCommunalPage.Show(() => { });
};
-
+
}
/// <summary>
/// 鍦扮悊鍥存爮View
@@ -714,24 +721,17 @@
flMain.RemoveFromParent();
};
- var Locationfra1 = new FrameLayout
- {
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(100),
- Y = Application.GetRealHeight(1920 - 100),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- };
- flMain.AddChidren(Locationfra1);
+
var Locationfra = new FrameLayout
{
Width = Application.GetRealWidth(1080),
Height = Application.GetRealHeight(530),
Y = Application.GetRealHeight(1920 - 530),
BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- Radius = (uint)Application.GetRealHeight(60),
+ //Radius = (uint)Application.GetRealHeight(60),
};
flMain.AddChidren(Locationfra);
-
+ Locationfra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
#region -------鍙栨秷 瀹屾垚
var typeRow = new RowLayout
@@ -748,6 +748,7 @@
Width = Application.GetRealWidth(200),
X = Application.GetRealWidth(80),
TextAlignment = TextAlignment.CenterLeft,
+ TextSize = 14,
};
typeRow.AddChidren(Btncancel);
Btncancel.MouseUpEventHandler += (sender16, e16) =>
@@ -775,6 +776,7 @@
Width = Application.GetRealWidth(200),
TextAlignment = TextAlignment.CenterRight,
X = Btntitle.Right + Application.GetRealWidth(100),
+ TextSize = 14,
};
typeRow.AddChidren(Btncomplete);
@@ -806,6 +808,7 @@
TextID = MyInternationalizationString.athome,
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
+ TextSize = 14,
};
@@ -838,6 +841,7 @@
TextID = MyInternationalizationString.leavehome,
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
+ TextSize = 14,
};
leavehomeRowLayout.AddChidren(btnleavehome);
var leavehomeSelected = new SelectedButton();
@@ -921,8 +925,13 @@
{
LocationConditionsInfo.Remove("IsValid");
}
+ if (LocationConditionsInfo.ContainsKey("WhoSiteUId"))
+ {
+ LocationConditionsInfo.Remove("WhoSiteUId");
+ }
LocationConditionsInfo.Add("Type", "7");
LocationConditionsInfo.Add("IsValid", "1");
+ LocationConditionsInfo.Add("WhoSiteUId", Config.Instance.Guid);
if (leavehomeSelected.Visible)
{
if (LocationConditionsInfo.ContainsKey("AtHome"))
@@ -939,7 +948,7 @@
}
LocationConditionsInfo.Add("AtHome", "1");
}
- double a1 = 23.134421, a2 = 113.267189;
+ double a1 = Config.Instance.Home.Latitude, a2 = Config.Instance.Home.Longitude;
//璋冪敤鏂规硶锛岃烦杞〉闈�
GDMapKit.Show((mLatitude, mLongitude, mRadius, name) =>
{
@@ -997,14 +1006,7 @@
flMain.RemoveFromParent();
};
- var timetypeframelayout1 = new FrameLayout
- {
- Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(100),
- Y = Application.GetRealHeight(1920 - 100),
- BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- };
- flMain.AddChidren(timetypeframelayout1);
+
var timetypeframelayout = new FrameLayout
{
@@ -1012,9 +1014,10 @@
Height = Application.GetRealHeight(530),
Y = Application.GetRealHeight(1920 - 530),
BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
- Radius = (uint)Application.GetRealHeight(60),
+ // Radius = (uint)Application.GetRealHeight(60),
};
flMain.AddChidren(timetypeframelayout);
+ timetypeframelayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
#region -------鍙栨秷 瀹屾垚
var timetype = new RowLayout
@@ -1029,8 +1032,9 @@
TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
Height = Application.GetRealHeight(140),
Width = Application.GetRealWidth(200),
- X=Application.GetRealWidth(80),
- TextAlignment=TextAlignment.CenterLeft,
+ X = Application.GetRealWidth(80),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextSize = 14,
};
timetype.AddChidren(Btncancel);
Btncancel.MouseUpEventHandler += (sender16, e16) =>
@@ -1039,14 +1043,14 @@
UserView.HomePage.Instance.ScrollEnabled = true;
};
- var Btntitle= new Button
+ var Btntitle = new Button
{
TextID = MyInternationalizationString.type,
TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
Height = Application.GetRealHeight(140),
Width = Application.GetRealWidth(320),
TextAlignment = TextAlignment.Center,
- X= Btncancel.Right+Application.GetRealWidth(100),
+ X = Btncancel.Right + Application.GetRealWidth(100),
TextSize = 16,
};
timetype.AddChidren(Btntitle);
@@ -1058,7 +1062,8 @@
Width = Application.GetRealWidth(200),
TextAlignment = TextAlignment.CenterRight,
X = Btntitle.Right + Application.GetRealWidth(100),
-
+ TextSize = 14,
+
};
timetype.AddChidren(Btncomplete);
#endregion
@@ -1069,7 +1074,7 @@
var timepointFrameLayout = new FrameLayout
{
Height = Application.GetRealHeight(160),
- Y = timetype.Bottom+Application.GetRealHeight(20),
+ Y = timetype.Bottom + Application.GetRealHeight(20),
};
timetypeframelayout.AddChidren(timepointFrameLayout);
@@ -1091,6 +1096,7 @@
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
//Text="绔嬪嵆鎵ц",
+ TextSize = 14,
};
timerow.AddChidren(Btntimepoint);
@@ -1103,7 +1109,7 @@
var timeFrameLayout = new FrameLayout
{
Height = Application.GetRealHeight(160),
- Y =timepointFrameLayout.Bottom,
+ Y = timepointFrameLayout.Bottom,
};
timetypeframelayout.AddChidren(timeFrameLayout);
@@ -1124,6 +1130,7 @@
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
//Text = "鏃堕棿鑼冨洿",
+ TextSize = 14,
};
time1row.AddChidren(Btntime);
@@ -1131,7 +1138,7 @@
time1row.AddChidren(timeSelected);
#endregion
-
+
///绔嬪嵆鎵ц鐐瑰嚮浜嬩欢
EventHandler<MouseEventArgs> timepointclick = (sedner14, e14) =>
{
@@ -1200,4 +1207,5 @@
}
}
+
}
--
Gitblit v1.8.0