From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 28 二月 2020 15:25:13 +0800
Subject: [PATCH] 2020.2.28
---
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs | 251 +++++++++++++++++++++++++++++---------------------
1 files changed, 145 insertions(+), 106 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
index a8167b2..cab5da2 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -79,12 +79,7 @@
action();
RemoveFromParent();
};
-
-
-
#endregion
-
-
var middle = new VerticalScrolViewLayout
{
@@ -93,7 +88,26 @@
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
this.AddChidren(middle);
+ var saveFrameLayout = new FrameLayout
+ {
+ Y = middle.Bottom,
+ Height = Application.GetRealHeight(180),
+ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+ };
+ this.AddChidren(saveFrameLayout);
+ var btnsave = new Button
+ {
+ X = Application.GetRealWidth(85),
+ Height = Application.GetRealHeight(130),//194
+ Width = Application.GetRealWidth(910),
+ Radius = (uint)Application.GetRealHeight(60),
+ BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
+ TextID = MyInternationalizationString.Save,
+ TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
+ TextSize = 16,
+ };
+ saveFrameLayout.AddChidren(btnsave);
#region -----鑷姩鍖栧悕绉� 璁剧疆鍚嶇О-----
var logicnamefl = new FrameLayout
@@ -621,19 +635,19 @@
int second = int.Parse(conditions["IgnoreTime"]) % 60;
if (minute != 0 && second != 0)
{
- devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime);
+ devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
}
else
{
if (minute == 0 && second != 0)
{
- devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime);
+ devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
}
if (minute != 0 && second == 0)
{
- devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime);
+ devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1);
}
@@ -922,26 +936,37 @@
};
conditionsRowLayout.AddChidren(securitystatus);
- if (conditions["EnOrWithdrawMode"] == "1")
+ switch (conditions["EnOrWithdrawMode"])
{
- conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
- securitystatus.Text = Language.StringByID(MyInternationalizationString.withdrawal);
- }
- else
- {
- if (conditions["ModeId"] == "1")
- {
- conditionIcon.UnSelectedImagePath = "ZigeeLogic/athome.png";
- securitystatus.Text = Language.StringByID(MyInternationalizationString.logicathomegarrison);
+ case "0":
+ {
+ if (conditions["ModeId"] == "1")
+ {
+ conditionIcon.UnSelectedImagePath = "ZigeeLogic/athome.png";
+ securitystatus.Text = Language.StringByID(MyInternationalizationString.logicathomegarrison);
- }
- else
- {
- conditionIcon.UnSelectedImagePath = "ZigeeLogic/leavehome.png";
- securitystatus.Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison);
-
- }
+ }
+ else
+ {
+ conditionIcon.UnSelectedImagePath = "ZigeeLogic/leavehome.png";
+ securitystatus.Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison);
+ }
+ }
+ break;
+ case "1":
+ {
+ conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
+ securitystatus.Text = Language.StringByID(MyInternationalizationString.withdrawal);
+ }
+ break;
+ case "2":
+ {
+ conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
+ securitystatus.Text = Language.StringByID(MyInternationalizationString.urgentwithdrawal);
+ }
+ break;
}
+
}
break;
case 7:
@@ -950,7 +975,7 @@
conditionIcon.UnSelectedImagePath = "ZigeeLogic/position.png";
var btnlocation = new Button
{
- Width = Application.GetRealWidth(700),
+ Width = Application.GetRealWidth(250),
TextAlignment = TextAlignment.CenterLeft,
Gravity = Gravity.CenterVertical,
TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
@@ -977,11 +1002,11 @@
var locationstatus = new Button
{
- Width = Application.GetRealWidth(300),
+ Width = Application.GetRealWidth(550),
Height = Application.GetRealHeight(130),
Gravity = Gravity.CenterVertical,
TextAlignment = TextAlignment.CenterRight,
- X = Application.GetRealWidth(500),
+ X = Application.GetRealWidth(250),
TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
TextSize = 14,
};
@@ -1015,20 +1040,19 @@
del.MouseUpEventHandler += (sender, e) =>
{
- var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
- Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
- alert.ResultEventHandler += (sender1, e1) =>
- {
- if (e1)
- {
- Common.Logic.CurrentLogic.Conditions.Remove(conditions);
- var logicCommunalPage = new LogicCommunalPage();
- UserView.HomePage.Instance.AddChidren(logicCommunalPage);
- UserView.HomePage.Instance.PageIndex += 1;
- logicCommunalPage.Show(() => { });
- }
- };
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
+ Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+ Language.StringByID(MyInternationalizationString.confrim));
alert.Show();
+
+ alert.ConfirmClickEvent += () =>
+ {
+ Common.Logic.CurrentLogic.Conditions.Remove(conditions);
+ var logicCommunalPage = new LogicCommunalPage();
+ UserView.HomePage.Instance.AddChidren(logicCommunalPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ logicCommunalPage.Show(() => { });
+ };
};
@@ -1511,20 +1535,24 @@
//鏈湴娌℃湁瀛樺湪;
if (sceneinof == null)
{
- //鍦ㄧ綉鍏虫煡鎵捐鍦烘櫙;
- sceneinof =await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString()));
- //缃戝叧娌℃湁瀛樺湪;
- if (sceneinof == null)
- {
-
- //娉ㄨВ:鏈湴鍜岀綉鍏抽兘涓嶅瓨鍦ㄨ鍦烘櫙,鐣岄潰灏嗕笉浼氭樉绀鸿鍦烘櫙;
- //sceneinof = new SceneUI();
- //绉婚櫎璇ュ満鏅暟鎹�;
- Common.Logic.CurrentLogic.Actions.Remove(actions);
- //绉婚櫎璇ュ満鏅鍥�;
- devicesFrameLayout.RemoveFromParent();
- continue;
- }
+ //瀹炵幇鐩殑:鏄剧ず鍑烘潵璁╁彲浠ヨ嚜宸辨槸鍚﹀垹闄�
+ sceneinof = new SceneUI();
+ #region --------
+ ////鍦ㄧ綉鍏虫煡鎵捐鍦烘櫙;
+ ////鏍囪闂:缃戠粶璇锋眰锛屽瓨鍦ㄨ鍥惧姞杞藉揩鎱㈢殑闂锛�
+ //sceneinof = await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString()));
+ ////缃戝叧娌℃湁瀛樺湪;
+ //if (sceneinof == null)
+ //{
+ // //娉ㄨВ:鏈湴鍜岀綉鍏抽兘涓嶅瓨鍦ㄨ鍦烘櫙,鐣岄潰灏嗕笉浼氭樉绀鸿鍦烘櫙;
+ // //sceneinof = new SceneUI();
+ // //绉婚櫎璇ュ満鏅暟鎹�;
+ // Common.Logic.CurrentLogic.Actions.Remove(actions);
+ // //绉婚櫎璇ュ満鏅鍥�;
+ // devicesFrameLayout.RemoveFromParent();
+ // continue;
+ //}
+ #endregion
}
actionsIcon.UnSelectedImagePath = "ZigeeLogic/scene.png";
@@ -1761,21 +1789,19 @@
del.MouseUpEventHandler += (sender, e) =>
{
- var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
- Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
- alert.ResultEventHandler += (sender1, e1) =>
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
+ Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+ Language.StringByID(MyInternationalizationString.confrim));
+ alert.Show();
+ alert.ConfirmClickEvent += () =>
{
- if (e1)
- {
- Common.Logic.CurrentLogic.Actions.Remove(actions);
- // devicesFrameLayout.RemoveFromParent();
- var logicCommunalPage = new LogicCommunalPage();
- UserView.HomePage.Instance.AddChidren(logicCommunalPage);
- UserView.HomePage.Instance.PageIndex += 1;
- logicCommunalPage.Show(() => { });
- }
+ Common.Logic.CurrentLogic.Actions.Remove(actions);
+ // devicesFrameLayout.RemoveFromParent();
+ var logicCommunalPage = new LogicCommunalPage();
+ UserView.HomePage.Instance.AddChidren(logicCommunalPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ logicCommunalPage.Show(() => { });
};
- alert.Show();
};
@@ -1957,55 +1983,60 @@
btncustompush.MouseUpEventHandler += customclick;
custompushback.MouseUpEventHandler += customclick;
custompushRowLayout.MouseUpEventHandler += customclick;
- btnswitch.MouseUpEventHandler += (sender1, e1) =>
+ bool tag = false;//鏍囪寮�鍏崇姸鎬�;
+ btnswitch.MouseUpEventHandler +=(sender1, e1) =>
+ {
+ btnswitch.IsSelected = !btnswitch.IsSelected;
+ if (btnswitch.IsSelected)
+ {
+ tag = true;
+ custompushFrameLayout.Height = Application.GetRealHeight(160);
+ Common.Logic.CurrentLogic.LogicIsCustomPushText = 1;
+
+ }
+ else
+ {
+ tag = false;
+ custompushFrameLayout.Height = Application.GetRealHeight(0);
+ Common.Logic.CurrentLogic.LogicIsCustomPushText = 0;
+ }
+ Send.Zj(tag,Common.Logic.CurrentLogic);
+ };
+
+ if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0)
{
- btnswitch.IsSelected = !btnswitch.IsSelected;
- if (btnswitch.IsSelected)
- {
- custompushFrameLayout.Height = Application.GetRealHeight(160);
- }
- else
- {
- custompushFrameLayout.Height = Application.GetRealHeight(0);
- }
- };
+ tag = false;
+ btnswitch.IsSelected = false;
+ custompushFrameLayout.Height = Application.GetRealHeight(0);
+ }
+ else
+ {
+ tag = true;
+ btnswitch.IsSelected = true;
+ custompushFrameLayout.Height = Application.GetRealHeight(160);
+ }
#endregion
- var saveFrameLayout = new FrameLayout
- {
- Y = middle.Bottom,
- Height = Application.GetRealHeight(180),
- BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
- this.AddChidren(saveFrameLayout);
-
- var btnsave = new Button
- {
- X = Application.GetRealWidth(85),
- Height = Application.GetRealHeight(130),//194
- Width = Application.GetRealWidth(910),
- Radius = (uint)Application.GetRealHeight(60),
- BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
- TextID = MyInternationalizationString.Save,
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- TextSize=16,
- };
- saveFrameLayout.AddChidren(btnsave);
+
btnsave.MouseUpEventHandler += async (sender, e) =>
{
var name = logicTextBox.Text.Trim();
if (string.IsNullOrEmpty(logicTextBox.Text.Trim()))
{
- new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show();
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.PleaseEnterLogicName),
+ Language.StringByID(MyInternationalizationString.confrim));
+ alert.Show();
return;
}
- var logicname = Common.Logic.LogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name);
- if (logicname != null)
- {
- new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show();
- return;
- }
+ ///鍏堥殣钘忓垽鏂悕瀛楃浉鍚岀殑鍔熻兘锛�
+ //var logicname = Common.Logic.LogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name);
+ //if (logicname != null)
+ //{
+ // new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show();
+ // return;
+ //}
Common.Logic.CurrentLogic.LogicName = name;
bool succeed = false;
@@ -2020,6 +2051,10 @@
succeed = true;
Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
+ if (tag)
+ {
+ Send.Zj(tag, Common.Logic.CurrentLogic);
+ }
}
}
else
@@ -2579,5 +2614,9 @@
{ IsBackground = true }.Start();
}
+
+
+
+
}
}
--
Gitblit v1.8.0