From 133ca903ae9c4df6ff037f5223d5abcd0df926f4 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期五, 20 三月 2020 17:55:32 +0800 Subject: [PATCH] 2020-03-20-1 --- ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs | 359 +++++++++++------------------------------------------------ 1 files changed, 66 insertions(+), 293 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs old mode 100755 new mode 100644 index 4a0de72..5f733d0 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs @@ -15,11 +15,11 @@ { this.action = action; } - + public void Show() { Tag = "Logic"; - + #region 涓婇潰鐨勫竷灞�浠g爜 TopView view = new TopView(); this.AddChidren(view.TopRowView()); @@ -35,354 +35,127 @@ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; this.AddChidren(middle); - - - var btnsave = new Button - { - Y= middle.Height-Application.GetRealHeight(260), - X = Application.GetRealWidth(85), - Height = Application.GetRealHeight(130), - Width = Application.GetRealWidth(910), - Radius = (uint)Application.GetRealHeight(60), - BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, - TextID = MyInternationalizationString.Save, - TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, - TextSize = 16, - }; - middle.AddChidren(btnsave); + LogicView.SaveView saveView = new LogicView.SaveView(); + saveView.frameLayout.Y = middle.Height - Application.GetRealHeight(260); + middle.AddChidren(saveView.Show()); #region ----鎵ц涓�娆�---- - var onceFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - }; - middle.AddChidren(onceFramelayout); - - var onceIconBtn = new Button - { - Width = Application.GetRealWidth(81), - Height = Application.GetRealHeight(81), - X = Application.GetRealWidth(58), - Y = Application.GetRealHeight(55), - UnSelectedImagePath = "ZigeeLogic/point.png", - - }; - onceFramelayout.AddChidren(onceIconBtn); - - var onceRow = new RowLayout - { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(850), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(176), - LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, - }; - onceFramelayout.AddChidren(onceRow); - var onceTextBtn = new Button - { - Text = Language.StringByID(MyInternationalizationString.executeonce), - TextAlignment = TextAlignment.CenterLeft, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - TextSize = 15, - }; - onceRow.AddChidren(onceTextBtn); - - var onceBackBtn = new SelectedButton(789); - onceRow.AddChidren(onceBackBtn); - - + FunView onceView = new FunView(); + onceView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png"; + onceView.funnameBtn.TextID = MyInternationalizationString.executeonce; + onceView.funnextBtn.Width = Application.GetMinRealAverage(60); + onceView.funnextBtn.Height = Application.GetMinRealAverage(60); + onceView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png"; + onceView.funnextBtn.Visible = false; + middle.AddChidren(onceView.FunFrameView()); #endregion #region ----姣忓ぉ---- - var everydayFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - Y = onceFramelayout.Bottom, - }; - middle.AddChidren(everydayFramelayout); + FunView dayView = new FunView(); + dayView.funFrameLayout.Y = onceView.funFrameLayout.Bottom; + dayView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png"; + dayView.funnameBtn.TextID = MyInternationalizationString.everyday; + dayView.funnextBtn.Width = Application.GetMinRealAverage(60); + dayView.funnextBtn.Height = Application.GetMinRealAverage(60); + dayView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png"; + dayView.funnextBtn.Visible = false; + middle.AddChidren(dayView.FunFrameView()); - var everydayIconBtn = new Button - { - Width = Application.GetRealWidth(81), - Height = Application.GetRealHeight(81), - X = Application.GetRealWidth(58), - Y = Application.GetRealHeight(55), - UnSelectedImagePath = "ZigeeLogic/point.png", - - }; - everydayFramelayout.AddChidren(everydayIconBtn); - - var everydayRow = new RowLayout - { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(850), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(176), - LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, - }; - everydayFramelayout.AddChidren(everydayRow); - - - var everydayTxetBtn = new Button - { - TextID = MyInternationalizationString.everyday, - TextAlignment = TextAlignment.CenterLeft, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - TextSize = 15, - }; - everydayRow.AddChidren(everydayTxetBtn); - - var everydayBack = new SelectedButton(789); - everydayRow.AddChidren(everydayBack); - - #endregion #region ----姣忓懆---- - var weekFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - Y = everydayFramelayout.Bottom, - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - }; - middle.AddChidren(weekFramelayout); - var weekIconBtn = new Button - { - Width = Application.GetRealWidth(81), - Height = Application.GetRealHeight(81), - UnSelectedImagePath = "ZigeeLogic/point.png", - X = Application.GetRealWidth(58), - Y = Application.GetRealHeight(55), - }; - weekFramelayout.AddChidren(weekIconBtn); - - var weekRow = new RowLayout - { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(850), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(176), - LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, - }; - weekFramelayout.AddChidren(weekRow); - - - var weekTextBtn = new Button - { - TextAlignment = TextAlignment.CenterLeft, - TextID = MyInternationalizationString.weekly, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - TextSize = 15, - }; - weekRow.AddChidren(weekTextBtn); - - var weekBack = new Button - { - Width = Application.GetRealWidth(58), - Height = Application.GetRealHeight(58), - UnSelectedImagePath = "ZigeeLogic/next.png", - X = Application.GetRealWidth(789), - Gravity = Gravity.CenterVertical, - }; - weekRow.AddChidren(weekBack); + FunView weekView = new FunView(); + weekView.funFrameLayout.Y = dayView.funFrameLayout.Bottom; + weekView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png"; + weekView.funnameBtn.TextID = MyInternationalizationString.weekly; + middle.AddChidren(weekView.FunFrameView()); #endregion #region ----姣忔湀---- - var monthlyFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - Y = weekFramelayout.Bottom, - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - }; - middle.AddChidren(monthlyFramelayout); + FunView monView = new FunView(); + monView.funFrameLayout.Y = weekView.funFrameLayout.Bottom; + monView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害; + monView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊 + monView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png"; + monView.funnameBtn.TextID = MyInternationalizationString.monthly; + middle.AddChidren(monView.FunFrameView()); - var monthlyIconBtn = new Button - { - Width = Application.GetRealWidth(81), - Height = Application.GetRealHeight(81), - UnSelectedImagePath = "ZigeeLogic/point.png", - X = Application.GetRealWidth(58), - Y = Application.GetRealHeight(55), - }; - monthlyFramelayout.AddChidren(monthlyIconBtn); - - var monthlyRow = new RowLayout - { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(850), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(176), - LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - }; - monthlyFramelayout.AddChidren(monthlyRow); - - var monthlyTextBtn = new Button - { - TextAlignment = TextAlignment.CenterLeft, - TextID = MyInternationalizationString.monthly, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - TextSize = 15, - }; - monthlyRow.AddChidren(monthlyTextBtn); - - var monthlyBack = new Button - { - Width = Application.GetRealWidth(58), - Height = Application.GetRealHeight(58), - UnSelectedImagePath = "ZigeeLogic/next.png", - X = Application.GetRealWidth(789), - Gravity = Gravity.CenterVertical, - }; - monthlyRow.AddChidren(monthlyBack); #endregion #region ----姣忓勾---- - var yearFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - Y = monthlyFramelayout.Bottom, - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - }; - //middle.AddChidren(yearFramelayout); + FunView yearView = new FunView(); + yearView.funFrameLayout.Y = monView.funFrameLayout.Bottom; + yearView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png"; + yearView.funnameBtn.TextID = MyInternationalizationString.everyyear; + //middle.AddChidren(yearView.FunFrameView()); - var yearIconBtn = new Button - { - Width = Application.GetRealWidth(81), - Height = Application.GetRealHeight(81), - UnSelectedImagePath = "ZigeeLogic/point.png", - X = Application.GetRealWidth(58), - Y = Application.GetRealHeight(55), - }; - yearFramelayout.AddChidren(yearIconBtn); - - var yearRow = new RowLayout - { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(850), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(176), - LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, - }; - yearFramelayout.AddChidren(yearRow); - - - var yearTextBtn = new Button - { - TextAlignment = TextAlignment.CenterLeft, - TextID = MyInternationalizationString.everyyear, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - TextSize = 15, - }; - yearRow.AddChidren(yearTextBtn); - - var yearBack = new Button - { - Width = Application.GetRealWidth(58), - Height = Application.GetRealHeight(58), - UnSelectedImagePath = "ZigeeLogic/next.png", - X = Application.GetRealWidth(789), - Gravity = Gravity.CenterVertical, - }; - yearRow.AddChidren(yearBack); - - EventHandler<MouseEventArgs> yearclick = (sender, e) => + yearView.clickviewBtn.MouseUpEventHandler += (sender, e) => { var everyyearPage = new EveryyearPage(); UserView.HomePage.Instance.AddChidren(everyyearPage); UserView.HomePage.Instance.PageIndex += 1; everyyearPage.Show(); - }; - yearFramelayout.MouseUpEventHandler += yearclick; - yearTextBtn.MouseUpEventHandler += yearclick; - yearBack.MouseUpEventHandler += yearclick; - yearIconBtn.MouseUpEventHandler += yearclick; - yearRow.MouseUpEventHandler += yearclick; + #endregion - EventHandler<MouseEventArgs> onceclick = (sender, e) => + onceView.clickviewBtn.MouseUpEventHandler += (sender, e) => { - onceBackBtn.Visible = true; - everydayBack.Visible = false; + onceView.funnextBtn.Visible = true; + dayView.funnextBtn.Visible = false; }; - onceTextBtn.MouseUpEventHandler += onceclick; - onceBackBtn.MouseUpEventHandler += onceclick; - onceFramelayout.MouseUpEventHandler += onceclick; - onceIconBtn.MouseUpEventHandler += onceclick; - onceRow.MouseUpEventHandler += onceclick; - - EventHandler<MouseEventArgs> everydayclick = (sender, e) => + dayView.clickviewBtn.MouseUpEventHandler += (sender, e) => { - onceBackBtn.Visible = false; - everydayBack.Visible = true; + onceView.funnextBtn.Visible = false; + dayView.funnextBtn.Visible = true; }; - everydayFramelayout.MouseUpEventHandler += everydayclick; - everydayTxetBtn.MouseUpEventHandler += everydayclick; - everydayBack.MouseUpEventHandler += everydayclick; - everydayIconBtn.MouseUpEventHandler += everydayclick; - everydayRow.MouseUpEventHandler += everydayclick; - - EventHandler<MouseEventArgs> weekclick = (sender, e) => + weekView.clickviewBtn.MouseUpEventHandler += (sender, e) => { - onceBackBtn.Visible = false; - everydayBack.Visible = false; + onceView.funnextBtn.Visible = false; + dayView.funnextBtn.Visible = false; var weekPage = new WeekPage(); UserView.HomePage.Instance.AddChidren(weekPage); UserView.HomePage.Instance.PageIndex += 1; - weekPage.Show(weekTextBtn.Text); + weekPage.Show(weekView.funnameBtn.Text); }; - weekFramelayout.MouseUpEventHandler += weekclick; - weekTextBtn.MouseUpEventHandler += weekclick; - weekBack.MouseUpEventHandler += weekclick; - weekIconBtn.MouseUpEventHandler += weekclick; - weekRow.MouseUpEventHandler += weekclick; - - EventHandler<MouseEventArgs> monthlyclick = (sender, e) => + monView.clickviewBtn.MouseUpEventHandler += (sender, e) => { - onceBackBtn.Visible = false; - everydayBack.Visible = false; + onceView.funnextBtn.Visible = false; + dayView.funnextBtn.Visible = false; var everymonthPage = new EverymonthPage(); UserView.HomePage.Instance.AddChidren(everymonthPage); UserView.HomePage.Instance.PageIndex += 1; - everymonthPage.Show(monthlyTextBtn.Text); + everymonthPage.Show(monView.funnameBtn.Text); }; - monthlyFramelayout.MouseUpEventHandler += monthlyclick; - monthlyIconBtn.MouseUpEventHandler += monthlyclick; - monthlyRow.MouseUpEventHandler += monthlyclick; - monthlyTextBtn.MouseUpEventHandler += monthlyclick; - monthlyBack.MouseUpEventHandler += monthlyclick; if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 0) { - onceBackBtn.Visible = true; - everydayBack.Visible = false; + onceView.funnextBtn.Visible = true; + dayView.funnextBtn.Visible = false; } else if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 2) { - onceBackBtn.Visible = false; - everydayBack.Visible = true; + onceView.funnextBtn.Visible = false; + dayView.funnextBtn.Visible = true; } else { - onceBackBtn.Visible = false; - everydayBack.Visible = false; + onceView.funnextBtn.Visible = false; + dayView.funnextBtn.Visible = false; } - - btnsave.MouseUpEventHandler += (sedder, e) => + saveView.clickviewBtn.MouseUpEventHandler += (sedder, e) => { - if (!onceBackBtn.Visible && !everydayBack.Visible) + if (!onceView.funnextBtn.Visible && !dayView.funnextBtn.Visible) { - + var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, Language.StringByID(MyInternationalizationString.selectweek), @@ -390,12 +163,12 @@ alert.Show(); return; } - if (onceBackBtn.Visible) + if (onceView.funnextBtn.Visible) { Common.Logic.CurrentLogic.TimeAttribute.Repeat = 0; } - if (everydayBack.Visible) + if (dayView.funnextBtn.Visible) { Common.Logic.CurrentLogic.TimeAttribute.Repeat = 2; } -- Gitblit v1.8.0