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/TemplatePage.cs | 173 +++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 111 insertions(+), 62 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs index b761c62..9231d7a 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs @@ -36,7 +36,7 @@ var titleName = new Button { - TextSize = 16, + TextSize = 17, TextColor = ZigbeeColor.Current.LogicTextBlackColor, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth(176), @@ -44,6 +44,7 @@ Height = Application.GetRealHeight(69), Y = Application.GetRealHeight(92), TextID = MyInternationalizationString.selection, + IsBold = true, }; topRowLayout.AddChidren(titleName); if (Common.Logic.CurrentLogic.LogicId != 0) @@ -108,7 +109,7 @@ Height = Application.GetRealHeight(436), X = Application.GetRealWidth(72), Y = Application.GetRealHeight(30), - UnSelectedImagePath = "ZigeeLogic/logicbj" + s + ".png", + UnSelectedImagePath = $"ZigeeLogic/logicbj{s}.png", }; logiciconfl.AddChidren(iconBtn); @@ -131,18 +132,19 @@ TextID = MyInternationalizationString.automationname, TextColor = ZigbeeColor.Current.LogicTextBlackColor, Y = Application.GetRealHeight(35), + TextSize = 15, }; logicnamefl.AddChidren(text); logicTextBox = new EditText { Y = Application.GetRealHeight(35), - Width = Application.GetRealWidth(900), + Width = Application.GetRealWidth(1080 - 58 - 300), Height = Application.GetRealHeight(60), X = text.Right, TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.LogicBtnCancelColor, - TextSize = 13, + TextSize = 14, Text = Common.Logic.CurrentLogic.LogicName, //TextID=MyInternationalizationString.automation1, }; @@ -185,7 +187,7 @@ TextColor = ZigbeeColor.Current.LogicTextBlackColor, Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(60), - TextSize = 16, + TextSize = 15, Gravity = Gravity.CenterVertical, }); @@ -296,11 +298,12 @@ var addtextbtn = new Button { Height = Application.GetRealHeight(58), - Width = Application.GetRealWidth(300), + Width = Application.GetRealWidth(400), Y = Application.GetRealHeight(45 + 30), TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - TextID = MyInternationalizationString.addconditions, - X = Application.GetRealWidth(390), + TextID = MyInternationalizationString.addsensor, + X = Application.GetRealWidth(340), + TextSize = 14, }; addfl.AddChidren(addtextbtn); @@ -374,6 +377,7 @@ TextAlignment = TextAlignment.CenterLeft, Text = deviceinof.DeviceEpointName, TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextSize = 14, }; conditionsRowLayout.AddChidren(btndevice); @@ -416,6 +420,7 @@ TextAlignment = TextAlignment.CenterRight, X = Application.GetRealWidth(400), TextColor = ZigbeeColor.Current.LogicBtnCancelColor, + TextSize = 14, }; conditionsRowLayout.AddChidren(devicestatus); @@ -437,14 +442,24 @@ { int minute = int.Parse(conditions["IgnoreTime"]) / 60; int second = int.Parse(conditions["IgnoreTime"]) % 60; - if (second != 0) + if (minute != 0 && second != 0) { devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); } else { - devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); + if (minute == 0 && second != 0) + { + 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.unattendedtime1); + + } + } } } @@ -479,21 +494,18 @@ 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 templatePage = new TemplatePage(); - UserView.HomePage.Instance.AddChidren(templatePage); - UserView.HomePage.Instance.PageIndex += 1; - templatePage.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 templatePage = new TemplatePage(); + UserView.HomePage.Instance.AddChidren(templatePage); + UserView.HomePage.Instance.PageIndex += 1; + templatePage.Show(); + }; }; @@ -532,7 +544,7 @@ TextColor = ZigbeeColor.Current.LogicTextBlackColor, Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(60), - TextSize = 16, + TextSize = 15, Gravity = Gravity.CenterVertical, }; targetRowLayout.AddChidren(btntargettitle); @@ -597,11 +609,12 @@ var addtextbtn = new Button { Height = Application.GetRealHeight(58), - Width = Application.GetRealWidth(300), + Width = Application.GetRealWidth(400), Y = Application.GetRealHeight(45 + 30), TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - TextID = MyInternationalizationString.addfunction, - X = Application.GetRealWidth(390), + TextID = MyInternationalizationString.addlighting, + X = Application.GetRealWidth(340), + TextSize = 14, }; addfl.AddChidren(addtextbtn); EventHandler<MouseEventArgs> addfunctionclick = (sender, e) => @@ -672,6 +685,7 @@ TextAlignment = TextAlignment.CenterLeft, Text = deviceinof.DeviceEpointName, TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextSize = 14, }; actionsrowLayout.AddChidren(btndevicename); @@ -697,6 +711,7 @@ TextAlignment = TextAlignment.CenterRight, X = Application.GetRealWidth(450), TextColor = ZigbeeColor.Current.LogicBtnCancelColor, + TextSize = 14, }; actionsrowLayout.AddChidren(devicestatus); @@ -978,20 +993,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.Actions.Remove(actions); - var templatePage = new TemplatePage(); - UserView.HomePage.Instance.AddChidren(templatePage); - UserView.HomePage.Instance.PageIndex += 1; - templatePage.Show(); - } - }; + + var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, + Language.StringByID(MyInternationalizationString.doyouwanttodelete), + Language.StringByID(MyInternationalizationString.confrim)); alert.Show(); + alert.ConfirmClickEvent += () => + { + Common.Logic.CurrentLogic.Actions.Remove(actions); + var templatePage = new TemplatePage(); + UserView.HomePage.Instance.AddChidren(templatePage); + UserView.HomePage.Instance.PageIndex += 1; + templatePage.Show(); + }; }; @@ -1033,6 +1047,7 @@ Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(60), Gravity = Gravity.CenterVertical, + TextSize = 14, }; weekRowLayout.AddChidren(settxet); var btnweektext = new Button @@ -1045,6 +1060,7 @@ TextID = MyInternationalizationString.everyday, Y = Application.GetRealHeight(35), X = settxet.Right, + TextSize = 14, }; weekRowLayout.AddChidren(btnweektext); @@ -1105,6 +1121,7 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterVertical, TextID = MyInternationalizationString.pushswitch, + TextSize = 14, }; pushswitchRowlayout.AddChidren(btnswitchtxet); @@ -1118,23 +1135,12 @@ Gravity = Gravity.CenterVertical, }; pushswitchRowlayout.AddChidren(btnswitch); - btnswitch.MouseUpEventHandler += (sender1, e1) => - { - btnswitch.IsSelected = !btnswitch.IsSelected; - if (btnswitch.IsSelected) - { - - } - else - { - - } - }; + var custompushFrameLayout = new FrameLayout { - Height = Application.GetRealHeight(160), + Height = Application.GetRealHeight(0), BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, }; middle.AddChidren(custompushFrameLayout); @@ -1157,6 +1163,7 @@ Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(60), Gravity = Gravity.CenterVertical, + TextSize = 14, }; custompushRowLayout.AddChidren(btncustompush); @@ -1184,7 +1191,38 @@ #endregion + 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) + { + tag = false; + btnswitch.IsSelected = false; + custompushFrameLayout.Height = Application.GetRealHeight(0); + } + else + { + tag = true; + btnswitch.IsSelected = true; + custompushFrameLayout.Height = Application.GetRealHeight(160); + } var saveFrameLayout = new FrameLayout { Y = middle.Bottom, @@ -1200,7 +1238,7 @@ Width = Application.GetRealWidth(910), Radius = (uint)Application.GetRealHeight(60), BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, - TextID = MyInternationalizationString.Save, + TextID = MyInternationalizationString.application, TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, }; saveFrameLayout.AddChidren(btnsave); @@ -1213,15 +1251,18 @@ //} 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; @@ -1235,6 +1276,10 @@ { Common.Logic.CurrentLogic.LogicId = logicifon.LogicId; Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); + if (tag) + { + Send.Zj(tag, Common.Logic.CurrentLogic); + } } } else @@ -1559,6 +1604,7 @@ Width = Application.GetRealWidth(200), X = Application.GetRealWidth(80), TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, }; timetype.AddChidren(Btncancel); Btncancel.MouseUpEventHandler += (sender16, e16) => @@ -1586,6 +1632,7 @@ Width = Application.GetRealWidth(200), TextAlignment = TextAlignment.CenterRight, X = Btntitle.Right + Application.GetRealWidth(100), + TextSize = 14, }; timetype.AddChidren(Btncomplete); @@ -1621,6 +1668,7 @@ TextID = MyInternationalizationString.Allconditions, TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, + TextSize = 14, }; androw.AddChidren(andbtn); @@ -1656,6 +1704,7 @@ TextID = MyInternationalizationString.anycondition, TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, + TextSize = 14, }; orrow.AddChidren(orbtn); -- Gitblit v1.8.0