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/DeviceTarget.cs | 403 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 221 insertions(+), 182 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs old mode 100644 new mode 100755 index c5377a2..56ff12d --- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs @@ -11,182 +11,248 @@ public class DeviceTarget : FrameLayout { - public DeviceTarget() + public DeviceTarget () { Tag = "Logic"; } - public void Show() + public void Show () { - this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor; - - var topFrameLayout = new FrameLayout + #region 鏈�涓婇潰鐨勫竷灞�浠g爜 + var topRowLayout = new RowLayout { - Height = Application.GetRealHeight(140), - Y = Application.GetRealHeight(80), + BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor, + Height = Application.GetRealHeight(184), + LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor, }; - AddChidren(topFrameLayout); - + this.AddChidren(topRowLayout); var titleName = new Button { - //Text = "娣诲姞鎵ц鐩爣", - TextID = MyInternationalizationString.addImplementationgoals, TextSize = 17, TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextAlignment = TextAlignment.CenterLeft, + X = Application.GetRealWidth(176), + Width = Application.GetRealWidth(600), + Height = Application.GetRealHeight(69), + Y = Application.GetRealHeight(92), + TextID = MyInternationalizationString.addaction, + IsBold = true, }; - topFrameLayout.AddChidren(titleName); + topRowLayout.AddChidren(titleName); - var back = new Button + var clickBtn = new Button { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), - X = Application.GetRealWidth(20), - Gravity = Gravity.CenterVertical, - UnSelectedImagePath = "ZigeeLogic/Back.png", + Width = Application.GetRealWidth(81 + 51), + Height = Application.GetRealHeight(58 + 40), + Y = Application.GetRealHeight(98 - 40), }; - topFrameLayout.AddChidren(back); - back.MouseDownEventHandler += (sender, e) => { + topRowLayout.AddChidren(clickBtn); + clickBtn.MouseDownEventHandler += (sender, e) => + { RemoveFromParent(); }; + var back = new Button + { + Width = Application.GetRealWidth(30), + Height = Application.GetRealHeight(51), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(98), + //Gravity = Gravity.CenterVertical; + UnSelectedImagePath = "ZigeeLogic/back.png", + }; + topRowLayout.AddChidren(back); + back.MouseDownEventHandler += (sender, e) => { + RemoveFromParent(); + }; + #endregion - var middle = new VerticalScrolViewLayout(); - middle.Y = topFrameLayout.Bottom; - middle.Height = Application.GetRealHeight(1920 - 220); - middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; + + var middle = new FrameLayout + { + Y = topRowLayout.Bottom, + Height = Application.GetRealHeight(1920 - 184), + BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + }; this.AddChidren(middle); #region ----- 璁惧------ - var deviceRowLayout = new RowLayout + var deviceframelayout = new FrameLayout { - Height = Application.GetRealHeight(180), - //BackgroundColor = 0xff323232, + Height = Application.GetRealHeight(160), + BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, }; - middle.AddChidren(deviceRowLayout); + middle.AddChidren(deviceframelayout); - var device = new Button + var deviceiconBtn = new Button { - Width = Application.GetRealWidth(400), - TextID = MyInternationalizationString.device, - //Text = "璁惧", - TextSize = 16, - TextAlignment = TextAlignment.CenterLeft, - X = Application.GetRealWidth(40), - TextColor = ZigbeeColor.Current.LogicTextBlackColor, + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(55), + UnSelectedImagePath = "ZigeeLogic/function.png", + }; - deviceRowLayout.AddChidren(device); + deviceframelayout.AddChidren(deviceiconBtn); + + var devicerow = new RowLayout + { + Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(850), + Height = Application.GetRealHeight(130), + X = Application.GetRealWidth(176), + LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, + }; + deviceframelayout.AddChidren(devicerow); + + + var btndevice = new Button + { + TextID = MyInternationalizationString.device, + TextAlignment = TextAlignment.CenterLeft, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextSize=15, + }; + devicerow.AddChidren(btndevice); var btndeviceback = new Button { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), - UnSelectedImagePath = "ZigeeLogic/next.png", - SelectedImagePath = "ZigeeLogic/NextSelecte.png", - X = Application.GetRealWidth(1080 - 140),//550 + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(789), Gravity = Gravity.CenterVertical, - }; - deviceRowLayout.AddChidren(btndeviceback); + UnSelectedImagePath = "ZigeeLogic/next.png", - EventHandler<MouseEventArgs> deviceclick = (sender, e) => { - Common.Logic.LogicDviceList.Clear(); - if (Common.Logic.LogicDviceList.Count == 0) - { - Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); - } + }; + devicerow.AddChidren(btndeviceback); + + EventHandler<MouseEventArgs> devicestateclick = (sender, e) => + { var logicDevicePage = new LogicDevicePage(); UserView.HomePage.Instance.AddChidren(logicDevicePage); UserView.HomePage.Instance.PageIndex += 1; logicDevicePage.Show(); }; - deviceRowLayout.MouseUpEventHandler += deviceclick; - device.MouseUpEventHandler += deviceclick; - btndeviceback.MouseUpEventHandler += deviceclick; + deviceframelayout.MouseUpEventHandler += devicestateclick; + btndevice.MouseUpEventHandler += devicestateclick; + btndeviceback.MouseUpEventHandler += devicestateclick; + deviceiconBtn.MouseUpEventHandler += devicestateclick; + devicerow.MouseUpEventHandler += devicestateclick; #endregion - #region ----- 鍦烘櫙------ - var sceneRowLayout = new RowLayout - { - Height = Application.GetRealHeight(180), - //BackgroundColor = 0xff323232, - Y = deviceRowLayout.Bottom, - }; - middle.AddChidren(sceneRowLayout); + #region ----- 鍦烘櫙------ - var scene = new Button + + var sceneframelayout = new FrameLayout { - Width = Application.GetRealWidth(400), + Height = Application.GetRealHeight(160), + BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, + Y= deviceframelayout.Bottom, + }; + middle.AddChidren(sceneframelayout); + + var sceneiconBtn = new Button + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(55), + UnSelectedImagePath = "ZigeeLogic/scene.png", + + }; + sceneframelayout.AddChidren(sceneiconBtn); + + + var sceneRowLayout = new RowLayout { + Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(850), + Height = Application.GetRealHeight(130), + X = Application.GetRealWidth(176), + LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, + }; + sceneframelayout.AddChidren (sceneRowLayout); + + var scene = new Button { TextID = MyInternationalizationString.scene, - //Text = "鍦烘櫙", - TextSize = 16, TextAlignment = TextAlignment.CenterLeft, - X = Application.GetRealWidth(40), TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextSize = 15, }; - sceneRowLayout.AddChidren(scene); + sceneRowLayout.AddChidren (scene); - var btnsceneback = new Button - { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), - UnSelectedImagePath = "ZigeeLogic/next.png", - SelectedImagePath = "ZigeeLogic/NextSelecte.png", - X = Application.GetRealWidth(1080 - 140),//550 + var btnsceneback = new Button { + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(789), Gravity = Gravity.CenterVertical, + UnSelectedImagePath = "ZigeeLogic/next.png", }; - sceneRowLayout.AddChidren(btnsceneback); + sceneRowLayout.AddChidren (btnsceneback); - EventHandler<MouseEventArgs> sceneclick = (sender, e) => { - CommonPage.Loading.Start(); - System.Threading.Tasks.Task.Run(() => { - Application.RunOnMainThread(() => { - CommonPage.Loading.Hide(); - var addScenePage = new AddScenePage(); - UserView.HomePage.Instance.AddChidren(addScenePage); - UserView.HomePage.Instance.PageIndex += 1; - addScenePage.Show(); - - }); - }); + EventHandler<MouseEventArgs> sceneclick = (sender, e) => + { + var addScenePage = new AddScenePage(); + UserView.HomePage.Instance.AddChidren(addScenePage); + UserView.HomePage.Instance.PageIndex += 1; + addScenePage.Show(); }; - sceneRowLayout.MouseUpEventHandler += sceneclick; - scene.MouseUpEventHandler += sceneclick; - btnsceneback.MouseUpEventHandler += sceneclick; + sceneRowLayout.MouseUpEventHandler += sceneclick; + scene.MouseUpEventHandler += sceneclick; + btnsceneback.MouseUpEventHandler += sceneclick; + sceneframelayout.MouseUpEventHandler += sceneclick; + sceneiconBtn.MouseUpEventHandler += sceneclick; #endregion #region ----- 瀹夐槻妯″紡------ - ///瀹夐槻妯″紡 - var securityRowLayout = new RowLayout + var securityframelayout = new FrameLayout { - Height = Application.GetRealHeight(180), - //BackgroundColor = 0xff323232, - Y = sceneRowLayout.Bottom, + Height = Application.GetRealHeight(160), + Y = sceneframelayout.Bottom, + BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, }; - middle.AddChidren(securityRowLayout); + middle.AddChidren(securityframelayout); - var security = new Button + var securityiconBtn = new Button { - Width = Application.GetRealWidth(400), - TextID = MyInternationalizationString.securitymode, - //Text = "瀹夐槻妯″紡", - TextSize = 16, - TextAlignment = TextAlignment.CenterLeft, - X = Application.GetRealWidth(40), - TextColor = ZigbeeColor.Current.LogicTextBlackColor, + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + UnSelectedImagePath = "ZigeeLogic/security.png", + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(55), }; - securityRowLayout.AddChidren(security); + securityframelayout.AddChidren(securityiconBtn); + + var securityrow = new RowLayout + { + Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(850), + Height = Application.GetRealHeight(130), + X = Application.GetRealWidth(176), + LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, + }; + securityframelayout.AddChidren(securityrow); + + + var btnsecurity = new Button + { + TextAlignment = TextAlignment.CenterLeft, + TextID = MyInternationalizationString.securitymode, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextSize = 15, + }; + securityrow.AddChidren(btnsecurity); var btnsecurityback = new Button { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), UnSelectedImagePath = "ZigeeLogic/next.png", - SelectedImagePath = "ZigeeLogic/NextSelecte.png", - X = Application.GetRealWidth(1080 - 140),//550 + X = Application.GetRealWidth(789), Gravity = Gravity.CenterVertical, }; - securityRowLayout.AddChidren(btnsecurityback); + securityrow.AddChidren(btnsecurityback); EventHandler<MouseEventArgs> securityclick = (sender, e) => { var securityMode = new SecurityMode(); @@ -195,9 +261,11 @@ securityMode.Show(); }; - securityRowLayout.MouseUpEventHandler += securityclick; - security.MouseUpEventHandler += securityclick; + securityframelayout.MouseUpEventHandler += securityclick; + btnsecurity.MouseUpEventHandler += securityclick; btnsecurityback.MouseUpEventHandler += securityclick; + securityiconBtn.MouseUpEventHandler += securityclick; + securityrow.MouseUpEventHandler += securityclick; #endregion #region ----- 宸叉湁鑷姩鍖�------ @@ -207,7 +275,7 @@ { Height = Application.GetRealHeight(180), //BackgroundColor = 0xff323232, - Y = securityRowLayout.Bottom, + Y = securityframelayout.Bottom, }; //middle.AddChidren(existenceRowLayout); @@ -216,7 +284,7 @@ Width = Application.GetRealWidth(400), TextID = MyInternationalizationString.Alreadyautomated, //Text = "宸叉湁鑷姩鍖�", - TextSize = 16, + TextSize = 15, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth(40), TextColor = ZigbeeColor.Current.LogicTextBlackColor, @@ -246,101 +314,72 @@ btnexistenceback.MouseUpEventHandler += existenceclick; #endregion - #region ----- 寤舵椂------ + #region ----- 寤舵椂------ + + var delayedframelayout = new FrameLayout + { + Height = Application.GetRealHeight(160), + BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, + Y = securityframelayout.Bottom, + }; + middle.AddChidren(delayedframelayout); + + var delayediconBtn = new Button + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(55), + UnSelectedImagePath = "ZigeeLogic/delay.png", + + }; + delayedframelayout.AddChidren(delayediconBtn); + var delayedRowLayout = new RowLayout { - Height = Application.GetRealHeight(180), - //BackgroundColor = 0xff323232, - Y = securityRowLayout.Bottom, + Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(850), + Height = Application.GetRealHeight(130), + X = Application.GetRealWidth(176), + LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor, }; - //middle.AddChidren(delayedRowLayout); + delayedframelayout.AddChidren(delayedRowLayout); var delayed = new Button { - Width = Application.GetRealWidth(400), - TextID = MyInternationalizationString.delayed, - //Text = "寤舵椂", - TextSize = 16, TextAlignment = TextAlignment.CenterLeft, - X = Application.GetRealWidth(40), + TextID = MyInternationalizationString.delayed, TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextSize = 15, }; delayedRowLayout.AddChidren(delayed); var btndelayedback = new Button { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), + Width = Application.GetRealWidth(58), + Height = Application.GetRealHeight(58), UnSelectedImagePath = "ZigeeLogic/next.png", - SelectedImagePath = "ZigeeLogic/NextSelecte.png", - X = Application.GetRealWidth(1080 - 140),//550 + X = Application.GetRealWidth(789), Gravity = Gravity.CenterVertical, }; delayedRowLayout.AddChidren(btndelayedback); EventHandler<MouseEventArgs> delayedclick = (sender, e) => { - //var delayTime = new DelayTime(); - //UserView.HomePage.Instance.AddChidren(delayTime); - //UserView.HomePage.Instance.PageIndex += 1; - //delayTime.Show(); - DelayTimeView(); + var delayTime = new DelayTime(); + UserView.HomePage.Instance.AddChidren(delayTime); + UserView.HomePage.Instance.PageIndex += 1; + delayTime.Show(); }; delayedRowLayout.MouseUpEventHandler += delayedclick; delayed.MouseUpEventHandler += delayedclick; btndelayedback.MouseUpEventHandler += delayedclick; + delayedframelayout.MouseUpEventHandler += delayedclick; + delayediconBtn.MouseUpEventHandler += delayedclick; #endregion } - public static void DelayTimeView(Dictionary<string, object> delayactionsInfo = null) - { - var listValues = new List<string>(); - for (int i = 0; i < 60; i++) - { - listValues.Add(i.ToString() + " " + Language.StringByID(MyInternationalizationString.second)); - } - var list = new List<KeyValuePair<string, string[]>> { }; - for (int i = 0; i <= 60; i++) - { - list.Add(new KeyValuePair<string, string[]>(i.ToString() + " " + Language.StringByID(MyInternationalizationString.minute), listValues.ToArray())); - } - - /* - PickerView.Show(list, (obj) => - { - var minute = obj.Split(',')[0].Split(' ')[0]; - var second = obj.Split(',')[1].Split(' ')[0]; - int value = int.Parse(minute) * 60 + int.Parse(second); - if (value == 0) - { - var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), - "鏃堕棿涓嶈兘涓�0", - Language.StringByID(MyInternationalizationString.complete)); - alert.Show(); - return; - } - if (delayactionsInfo == null) - { - Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); - actionsInfo.Add("LinkType", 10); - actionsInfo.Add("DelayTime", value); - Common.Logic.CurrentLogic.Actions.Add(actionsInfo); - } - else - { - if (delayactionsInfo.ContainsKey("DelayTime")) - { - delayactionsInfo.Remove("DelayTime"); - } - delayactionsInfo.Add("DelayTime", value); - } - var logicCommunalPage = new LogicCommunalPage { }; - UserView.HomePage.Instance.AddChidren(logicCommunalPage); - UserView.HomePage.Instance.PageIndex += 1; - logicCommunalPage.Show(() => { }); - }, Language.StringByID(MyInternationalizationString.complete), ""); - */ - } + } } -- Gitblit v1.8.0