From 1c4904d77f484c075080942d87785481b52b6fb2 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期一, 28 十月 2019 14:58:46 +0800 Subject: [PATCH] Revert "Merge branch 'dev-tzy' into DEV_GXC" --- ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs | 570 +++++++++++++++++--------------------------------------- 1 files changed, 171 insertions(+), 399 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs index f257172..159b1eb 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs @@ -9,441 +9,213 @@ { public class Cycle : FrameLayout { - Action action; public Cycle(Action action) { this.action = action; } - - public void Show() + public Cycle() { Tag = "Logic"; - - #region 鏈�涓婇潰鐨勫竷灞�浠g爜 - var topRowLayout = new RowLayout + } + /// <summary> + /// 閫変腑 + /// </summary> + Button beforeClickButton = new Button(); + + public void Show() + { + + this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor; + var topFrameLayout = new FrameLayout { - BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor, - Height = Application.GetRealHeight(184), - LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor, + Height = Application.GetRealHeight(140), + Y = Application.GetRealHeight(80), }; - this.AddChidren(topRowLayout); + AddChidren(topFrameLayout); var titleName = new Button { - TextSize = 16, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - TextAlignment = TextAlignment.CenterLeft, - X = Application.GetRealWidth(176), - Width = Application.GetRealWidth(400), - Height = Application.GetRealHeight(69), - Y = Application.GetRealHeight(92), TextID = MyInternationalizationString.cycle, + TextSize = 17, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, }; - topRowLayout.AddChidren(titleName); + topFrameLayout.AddChidren(titleName); - var clickBtn = new Button + var hdl = new Button { - Width = Application.GetRealWidth(81 + 51), - Height = Application.GetRealHeight(58 + 40), - Y = Application.GetRealHeight(98 - 40), + Width = Application.GetRealWidth(154), + Height = Application.GetRealHeight(90), + X = Application.GetRealWidth(1080 - 170), + Gravity = Gravity.CenterVertical, + UnSelectedImagePath = "Logo/Logo.png", }; - topRowLayout.AddChidren(clickBtn); - clickBtn.MouseDownEventHandler += (sender, e) => - { - RemoveFromParent(); - //if (action != null) - // action(); - }; + //topFrameLayout.AddChidren(hdl); 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", + Width = Application.GetRealWidth(110), + Height = Application.GetRealHeight(110), + X = Application.GetRealWidth(20), + Gravity = Gravity.CenterVertical, + UnSelectedImagePath = "ZigeeLogic/Back.png", }; - topRowLayout.AddChidren(back); - back.MouseDownEventHandler += (sender, e) => { - //if (action != null) - // action(); + topFrameLayout.AddChidren(back); + back.MouseDownEventHandler += (sender, e) => + { RemoveFromParent(); - + if (action != null) + action(); }; - #endregion - - - - - var middle = new FrameLayout + var titlerl = new RowLayout { - Y = topRowLayout.Bottom, - Height = Application.GetRealHeight(1920 - 184), - BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + Height = Application.GetRealHeight(180), + // BackgroundColor = 0xff0f0f0f, + Y = Application.GetRealHeight(220), }; + AddChidren(titlerl); + + titlerl.AddChidren( + new Button + { + X = Application.GetRealWidth(40), + //Text = "璇烽�夋嫨閲嶅鎵ц鍛ㄦ湡", + TextID = MyInternationalizationString.repeat, + TextSize = 17, + TextAlignment = TextAlignment.CenterLeft, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + } + ); + + var middle = new VerticalScrolViewLayout(); + middle.Y = titlerl.Bottom; + middle.Height = Application.GetRealHeight(1920 - 220 - 180 - 174); + middle.BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor; this.AddChidren(middle); - - var btnsave = new Button + + + + var cyclelist = new List<string>(); + cyclelist.AddRange(new string[] { + Language.StringByID(MyInternationalizationString.executeonce), + Language.StringByID(MyInternationalizationString.everyday), + //"浠婂勾", + //Language.StringByID(MyInternationalizationString.workingday), + //Language.StringByID(MyInternationalizationString.weekend), + Language.StringByID(MyInternationalizationString.monthly), + Language.StringByID(MyInternationalizationString.everyyear), + Language.StringByID(MyInternationalizationString.logicminute), + }); + + foreach (var name in cyclelist) { - 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, - }; - middle.AddChidren(btnsave); - - - - #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, - }; - onceRow.AddChidren(onceTextBtn); - - var onceBackBtn = new SelectedButton(789); - onceRow.AddChidren(onceBackBtn); - - - - #endregion - - #region ----姣忓ぉ---- - var everydayFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - Y = onceFramelayout.Bottom, - }; - middle.AddChidren(everydayFramelayout); - - 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, - }; - 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, - }; - 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); - - #endregion - - #region ----姣忔湀---- - var monthlyFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - Y = weekFramelayout.Bottom, - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - }; - middle.AddChidren(monthlyFramelayout); - - 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, - }; - 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); - - 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, - }; - 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) => - { - 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) => - { - onceBackBtn.Visible = true; - everydayBack.Visible = false; - }; - onceTextBtn.MouseUpEventHandler += onceclick; - onceBackBtn.MouseUpEventHandler += onceclick; - onceFramelayout.MouseUpEventHandler += onceclick; - onceIconBtn.MouseUpEventHandler += onceclick; - onceRow.MouseUpEventHandler += onceclick; - - EventHandler<MouseEventArgs> everydayclick = (sender, e) => - { - onceBackBtn.Visible = false; - everydayBack.Visible = true; - - }; - everydayFramelayout.MouseUpEventHandler += everydayclick; - everydayTxetBtn.MouseUpEventHandler += everydayclick; - everydayBack.MouseUpEventHandler += everydayclick; - everydayIconBtn.MouseUpEventHandler += everydayclick; - everydayRow.MouseUpEventHandler += everydayclick; - - EventHandler<MouseEventArgs> weekclick = (sender, e) => - { - onceBackBtn.Visible = false; - everydayBack.Visible = false; - var weekPage = new WeekPage(); - UserView.HomePage.Instance.AddChidren(weekPage); - UserView.HomePage.Instance.PageIndex += 1; - weekPage.Show(weekTextBtn.Text); - - }; - weekFramelayout.MouseUpEventHandler += weekclick; - weekTextBtn.MouseUpEventHandler += weekclick; - weekBack.MouseUpEventHandler += weekclick; - weekIconBtn.MouseUpEventHandler += weekclick; - weekRow.MouseUpEventHandler += weekclick; - - EventHandler<MouseEventArgs> monthlyclick = (sender, e) => - { - onceBackBtn.Visible = false; - everydayBack.Visible = false; - var everymonthPage = new EverymonthPage(); - UserView.HomePage.Instance.AddChidren(everymonthPage); - UserView.HomePage.Instance.PageIndex += 1; - everymonthPage.Show(monthlyTextBtn.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; - } - else if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 2) - { - onceBackBtn.Visible = false; - everydayBack.Visible = true; - } - else - { - onceBackBtn.Visible = false; - everydayBack.Visible = false; - } - - btnsave.MouseUpEventHandler += (sedder, e) => - { - if (!onceBackBtn.Visible && !everydayBack.Visible) + var cyclerwLayout = new RowLayout { - var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), - Language.StringByID(MyInternationalizationString.selectweek), - Language.StringByID(MyInternationalizationString.complete)); + Height = Application.GetRealHeight(180), + }; + middle.AddChidren(cyclerwLayout); - alert.Show(); - return; - } - if (onceBackBtn.Visible) + var btn = new Button { - Common.Logic.CurrentLogic.TimeAttribute.Repeat = 0; + Height = Application.GetRealHeight(180), + Width = LayoutParams.MatchParent, + SelectedBackgroundColor = 0xfffe5e00, + }; + cyclerwLayout.AddChidren(btn); - } - if (everydayBack.Visible) + var btnName = new Button { - Common.Logic.CurrentLogic.TimeAttribute.Repeat = 2; + Gravity = Gravity.CenterVertical, + Text = name, + Width = Application.GetRealWidth(400), + Height = Application.GetRealHeight(100), + X = Application.GetRealWidth(30), + TextSize = 16, + TextAlignment = TextAlignment.CenterLeft, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + }; + cyclerwLayout.AddChidren(btnName); + + var btntimeback = new Button + { + Width = Application.GetRealWidth(110), + Height = Application.GetRealHeight(110), + //UnSelectedImagePath = "MusicIcon/Next.png", + SelectedImagePath = "ZigeeLogic/next.png", + X = Application.GetRealWidth(1080 - 140), + }; + if (name == Language.StringByID(MyInternationalizationString.monthly) || name == Language.StringByID(MyInternationalizationString.everyyear) || name == Language.StringByID(MyInternationalizationString.logiccustom)) + { + cyclerwLayout.AddChidren(btntimeback); } + + //if (timename == name) { + // beforeClickButton.IsSelected = false; + // beforeClickButton = btn; + // btn.IsSelected = true; + //} + + EventHandler<MouseEventArgs> timeclick = (sender, e) => + { + if (btnName.Text == Language.StringByID(MyInternationalizationString.logiccustom)) + { + var weekPage = new WeekPage(); + UserView.HomePage.Instance.AddChidren(weekPage); + UserView.HomePage.Instance.PageIndex += 1; + weekPage.Show(); + } + else if (btnName.Text == Language.StringByID(MyInternationalizationString.monthly)) + { + var everymonthPage = new EverymonthPage(); + UserView.HomePage.Instance.AddChidren(everymonthPage); + UserView.HomePage.Instance.PageIndex += 1; + everymonthPage.Show(); + } + else if (btnName.Text == Language.StringByID(MyInternationalizationString.everyyear)) + { + var everyyearPage = new EveryyearPage(); + UserView.HomePage.Instance.AddChidren(everyyearPage); + UserView.HomePage.Instance.PageIndex += 1; + everyyearPage.Show(); + } + else + { + beforeClickButton.IsSelected = false; + beforeClickButton = btn; + btn.IsSelected = true; + if (btnName.Text == Language.StringByID(MyInternationalizationString.everyday)) + { + Common.Logic.CurrentLogic.TimeAttribute.Repeat = 2; + } + else if (btnName.Text == Language.StringByID(MyInternationalizationString.executeonce)) + { + Common.Logic.CurrentLogic.TimeAttribute.Repeat = 0; + } + } + }; + cyclerwLayout.MouseUpEventHandler += timeclick; + btn.MouseUpEventHandler += timeclick; + btnName.MouseUpEventHandler += timeclick; + btntimeback.MouseUpEventHandler += timeclick; + + }; + + var btncomplete = new Button + { + Y = middle.Bottom, + Height = Application.GetRealHeight(174), + TextID = MyInternationalizationString.complete, + //BackgroundColor = 0xff1f1f1f, + TextSize = 16, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + }; + AddChidren(btncomplete); + + btncomplete.MouseUpEventHandler += (sedder, e) => + { RemoveFromParent(); action(); - }; } -- Gitblit v1.8.0