From 8adaa664b3f4a1f5e05434dc245cc5d168ad718c Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期一, 23 三月 2020 14:15:56 +0800 Subject: [PATCH] 2020-03-23-1 --- ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs | 116 ++++++++++++++++------------------------------------------ 1 files changed, 32 insertions(+), 84 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs b/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs index f139eba..1dcfe21 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs @@ -33,79 +33,51 @@ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; this.AddChidren(middle); + LogicView.SaveView saveView = new LogicView.SaveView(); + saveView.frameLayout.Y = middle.Bottom; + this.AddChidren(saveView.Show()); + int selectetimedvalue = 0; var timestrlist = new List<string> { "2", "5", "10", "20", "30", Language.StringByID(MyInternationalizationString.logiccustom) }; - foreach (var intvalue in timestrlist) + foreach (var intValue in timestrlist) { + FunView monView = new FunView(); + monView.iconBtn.UnSelectedImagePath = "ZigeeLogic/point.png"; + monView.funnameBtn.Text = intValue + Language.StringByID(MyInternationalizationString.Minute); + monView.funnameBtn.Tag = intValue; + monView.funnextBtn.Width = Application.GetMinRealAverage(60); + monView.funnextBtn.Height = Application.GetMinRealAverage(60); + monView.funnextBtn.UnSelectedImagePath = "ZigeeLogic/selected.png"; + monView.funnextBtn.Visible = false; + middle.AddChidren(monView.FunFrameView()); - - var timeframelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - }; - middle.AddChidren(timeframelayout); - - var timeniconBtn = new Button - { - Width = Application.GetRealWidth(81), - Height = Application.GetRealHeight(81), - X = Application.GetRealWidth(58), - Y = Application.GetRealHeight(55), - UnSelectedImagePath = "ZigeeLogic/point.png", - - }; - timeframelayout.AddChidren(timeniconBtn); - - var timeRow = new RowLayout - { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(850), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(176), - LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, - }; - timeframelayout.AddChidren(timeRow); - - var timeBtn = new Button - { - Text = intvalue.ToString() + Language.StringByID(MyInternationalizationString.Minute), - TextAlignment = TextAlignment.CenterLeft, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - Tag = intvalue, - TextSize = 14, - }; - timeRow.AddChidren(timeBtn); - - - var selected = new SelectedButton(789); - timeRow.AddChidren(selected); //鍒ゆ柇涓�涓瓧绗︽槸瀛楃涓茶繕鏄暟瀛� - if (intvalue.Length < 3) + if (intValue.Length < 3) { - if (timevalue== int.Parse(intvalue) * 60) + if (timevalue == int.Parse(intValue) * 60) { selectedIcon.Visible = false; - selectedIcon = selected; - selected.Visible = true; + selectedIcon = monView.funnextBtn; + monView.funnextBtn.Visible = true; } } else { - timeRow.LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor; + monView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害; + monView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///鏀瑰彉鏈�鍚庡姛鑳藉揩绾挎潯棰滆壊 } - EventHandler<MouseEventArgs> timeclick = (sender, e) => + monView.clickviewBtn.MouseUpEventHandler+= (sender, e) => { selectedIcon.Visible = false; - selectedIcon = selected; - selected.Visible = true; - if (Language.StringByID(MyInternationalizationString.logiccustom) == timeBtn.Tag.ToString()) + selectedIcon = monView.funnextBtn; + monView.funnextBtn.Visible = true; + if (Language.StringByID(MyInternationalizationString.logiccustom) == monView.funnameBtn.Tag.ToString()) { var secondList = new List<string>(); var minuteList = new List<string>(); - for (int i = 0; i < 61; i++) + for (int i = 0; i < 60; i++) { if (i < 10) { @@ -132,51 +104,27 @@ selectIndex1 = timevalue / 60; selectIndex2 = timevalue % 60; } - PickerView.ShowNormal(minuteList, secondList, new List<string>(), (Index1, Index2, Index3) => + PickerView.ShowNormal(minuteList, secondList, null, (Index1, Index2, Index3) => { selectetimedvalue = int.Parse(minuteList[Index1].Split(' ')[0]) * 60 + int.Parse(secondList[Index2].Split(' ')[0]); - timemethod(common, selectetimedvalue, timevalue, edit); + TimeMethod(common, selectetimedvalue, timevalue, edit); }, selectIndex1, selectIndex2, 0, Language.StringByID(MyInternationalizationString.logiccustom)); } else { - selectetimedvalue = int.Parse(timeBtn.Tag.ToString()) * 60; + selectetimedvalue = int.Parse(monView.funnameBtn.Tag.ToString()) * 60; } }; - timeframelayout.MouseUpEventHandler += timeclick; - timeniconBtn.MouseUpEventHandler += timeclick; - timeRow.MouseUpEventHandler += timeclick; - timeBtn.MouseUpEventHandler += timeclick; - selected.MouseUpEventHandler += timeclick; + } - var saveFrameLayout = new FrameLayout + saveView.clickviewBtn.MouseUpEventHandler += (sender, e) => { - Y = middle.Bottom, - Height = Application.GetRealHeight(260), - BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, - }; - this.AddChidren(saveFrameLayout); - - var btnsave = new Button - { - X = Application.GetRealWidth(85), - Height = Application.GetRealHeight(130),//194 - Width = Application.GetRealWidth(910), - Radius = (uint)Application.GetRealHeight(60), - BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, - TextID = MyInternationalizationString.Save, - TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, - TextSize = 16, - }; - saveFrameLayout.AddChidren(btnsave); - btnsave.MouseUpEventHandler += (sender, e) => - { - timemethod(common, selectetimedvalue, timevalue, edit); + TimeMethod(common, selectetimedvalue, timevalue, edit); }; } - public void timemethod(CommonDevice common, int selectetimedvalue, int timevalue, bool edit) + public void TimeMethod(CommonDevice common, int selectetimedvalue, int timevalue, bool edit) { var deviceConditionsInfo = new Dictionary<string, string>(); -- Gitblit v1.8.0