From f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期一, 30 十二月 2019 13:32:33 +0800 Subject: [PATCH] 2019-12-30-1 --- ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs | 111 ++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 77 insertions(+), 34 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs index b761c62..78ee519 100644 --- 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); + + } + } } } @@ -532,7 +547,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 +612,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 +688,7 @@ TextAlignment = TextAlignment.CenterLeft, Text = deviceinof.DeviceEpointName, TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextSize = 14, }; actionsrowLayout.AddChidren(btndevicename); @@ -697,6 +714,7 @@ TextAlignment = TextAlignment.CenterRight, X = Application.GetRealWidth(450), TextColor = ZigbeeColor.Current.LogicBtnCancelColor, + TextSize = 14, }; actionsrowLayout.AddChidren(devicestatus); @@ -1033,6 +1051,7 @@ Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(60), Gravity = Gravity.CenterVertical, + TextSize = 14, }; weekRowLayout.AddChidren(settxet); var btnweektext = new Button @@ -1045,6 +1064,7 @@ TextID = MyInternationalizationString.everyday, Y = Application.GetRealHeight(35), X = settxet.Right, + TextSize = 14, }; weekRowLayout.AddChidren(btnweektext); @@ -1105,6 +1125,7 @@ Height = Application.GetRealHeight(60), Gravity = Gravity.CenterVertical, TextID = MyInternationalizationString.pushswitch, + TextSize = 14, }; pushswitchRowlayout.AddChidren(btnswitchtxet); @@ -1118,23 +1139,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 +1167,7 @@ Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(60), Gravity = Gravity.CenterVertical, + TextSize = 14, }; custompushRowLayout.AddChidren(btncustompush); @@ -1184,7 +1195,31 @@ #endregion + bool tag = false;//鏍囪寮�鍏崇姸鎬�; + btnswitch.MouseUpEventHandler += (sender1, e1) => + { + btnswitch.IsSelected = !btnswitch.IsSelected; + if (btnswitch.IsSelected) + { + tag = true; + custompushFrameLayout.Height = Application.GetRealHeight(160); + if (Common.Logic.CurrentLogic.LogicId != 0) + { + Send.Data("娣诲姞/鏇存柊", "/App/HomeLogicConfig", "POST"); + } + } + else + { + tag = false; + custompushFrameLayout.Height = Application.GetRealHeight(0); + if (Common.Logic.CurrentLogic.LogicId != 0) + { + Send.Data("鍒犻櫎", "/App/DelHomeLogicConfig", "POST"); + } + + } + }; var saveFrameLayout = new FrameLayout { Y = middle.Bottom, @@ -1200,7 +1235,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); @@ -1216,12 +1251,12 @@ new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), 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; - } + //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 +1270,10 @@ { Common.Logic.CurrentLogic.LogicId = logicifon.LogicId; Common.Logic.LogicList.Add(Common.Logic.CurrentLogic); + if (tag) + { + Send.Data("娣诲姞/鏇存柊", "/App/HomeLogicConfig", "POST"); + } } } else @@ -1559,6 +1598,7 @@ Width = Application.GetRealWidth(200), X = Application.GetRealWidth(80), TextAlignment = TextAlignment.CenterLeft, + TextSize = 14, }; timetype.AddChidren(Btncancel); Btncancel.MouseUpEventHandler += (sender16, e16) => @@ -1586,6 +1626,7 @@ Width = Application.GetRealWidth(200), TextAlignment = TextAlignment.CenterRight, X = Btntitle.Right + Application.GetRealWidth(100), + TextSize = 14, }; timetype.AddChidren(Btncomplete); @@ -1621,6 +1662,7 @@ TextID = MyInternationalizationString.Allconditions, TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, + TextSize = 14, }; androw.AddChidren(andbtn); @@ -1656,6 +1698,7 @@ TextID = MyInternationalizationString.anycondition, TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, + TextSize = 14, }; orrow.AddChidren(orbtn); -- Gitblit v1.8.0