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/TimePage.cs | 285 +++++++++++++++++++++++---------------------------------- 1 files changed, 115 insertions(+), 170 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs index f38c40f..444f69b 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs @@ -14,256 +14,183 @@ { Tag = "Logic"; } - public bool IsEditor; + public bool IsDeviceEditor1; public string str1; Dictionary<string, string> timeBucketConditionsInfo = new Dictionary<string, string>(); public void Show() { - - #region 鏈�涓婇潰鐨勫竷灞�浠g爜 - var topRowLayout = new RowLayout + this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor; + this.AddChidren(new Button { - BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor, - Height = Application.GetRealHeight(184), - LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor, + Height = Application.GetRealHeight(80), + }); + + var topFrameLayout = new FrameLayout + { + Height = Application.GetRealHeight(140), + Y = Application.GetRealHeight(80), }; - this.AddChidren(topRowLayout); + AddChidren(topFrameLayout); var titleName = new Button { - TextSize = 16, + Text = Language.StringByID(MyInternationalizationString.addtime), + TextSize = 17, 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.addtime, + X = Application.GetRealWidth(150), }; - topRowLayout.AddChidren(titleName); + topFrameLayout.AddChidren(titleName); - var clickBtn = new Button - { - Width = Application.GetRealWidth(81 + 51), - Height = Application.GetRealHeight(58 + 40), - Y = Application.GetRealHeight(98 - 40), - }; - 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", + 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) => { - RemoveFromParent(); - }; - #endregion - - - - - #region 鏈�涓嬮潰鐨勫竷灞�浠g爜 - var middle = new FrameLayout + topFrameLayout.AddChidren(back); + back.MouseDownEventHandler += (sender, e) => { - Y = topRowLayout.Bottom, - Height = Application.GetRealHeight(1920 - 184-260), - BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + RemoveFromParent(); + IsDeviceEditor1 = false; }; + + + var middle = new VerticalScrolViewLayout(); + middle.Y = topFrameLayout.Bottom; + middle.Height = Application.GetRealHeight(1920- 220 - 200); + middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; this.AddChidren(middle); - var fra = new FrameLayout + + #region -----绔嬪嵆鎵ц + var row = new RowLayout { - Y = middle.Bottom, - Height = Application.GetRealHeight(260), - BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, + Height = Application.GetRealHeight(250), }; - this.AddChidren(fra); - var btnsave = new Button + middle.AddChidren(row); + + var btnTextTitle = 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, + Height = Application.GetRealHeight(50), + Width = Application.GetRealWidth(800), + Y = Application.GetRealHeight(20), + X = Application.GetRealWidth(40), + // Text = "璇烽�夋嫨鏃堕棿绫诲瀷", + TextAlignment = TextAlignment.CenterLeft, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextID = MyInternationalizationString.Selectedtimetype, }; - fra.AddChidren(btnsave); - #endregion - - #region -----鏃堕棿鑼冨洿 寮�濮嬫椂闂� 缁撴潫鏃堕棿 - #region -----鏃堕棿鑼冨洿 - - - var typeFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - }; - middle.AddChidren(typeFramelayout); - - - var typeRowlayout = new RowLayout - { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(965), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(58), - LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, - }; - typeFramelayout.AddChidren(typeRowlayout); + row.AddChidren(btnTextTitle); var btnTypeTextTitle = new Button { - Text = Language.StringByID(MyInternationalizationString.type), + Y = Application.GetRealHeight(20 + 50), + // Text = "绫诲瀷", + X = Application.GetRealWidth(40), TextAlignment = TextAlignment.CenterLeft, + Height = Application.GetRealHeight(180), + Width = Application.GetRealWidth(400), TextColor = ZigbeeColor.Current.LogicTextBlackColor, - Width = Application.GetRealWidth(265) + TextID = MyInternationalizationString.type, }; - typeRowlayout.AddChidren(btnTypeTextTitle); - - - var btnimmediateexecution = new Button + row.AddChidren(btnTypeTextTitle); + + var btnTypeText = new Button { - X = btnTypeTextTitle.Right, - Gravity = Gravity.CenterVertical, - Width = Application.GetRealWidth(630), + Y = Application.GetRealHeight(20 + 50), + X = Application.GetRealWidth(1080 - 500 - 40), + //Text = "鏃堕棿鑼冨洿", TextAlignment = TextAlignment.CenterRight, + Height = Application.GetRealHeight(180), + Width = Application.GetRealWidth(500), TextColor = ZigbeeColor.Current.LogicTextBlackColor, TextID = MyInternationalizationString.timeframe, }; - typeRowlayout.AddChidren(btnimmediateexecution); - - - var btnimmediateexecutionBack = new Button - { - Width = Application.GetRealWidth(58), - Height = Application.GetRealHeight(58), - UnSelectedImagePath = "ZigeeLogic/next.png", - X = btnimmediateexecution.Right + Application.GetRealWidth(12), - Gravity = Gravity.CenterVertical, - }; - typeRowlayout.AddChidren(btnimmediateexecutionBack); - - + row.AddChidren(btnTypeText); #endregion - - #region -----寮�濮嬫椂闂� - var timestarFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - Y= typeFramelayout.Bottom, - }; - middle.AddChidren(timestarFramelayout); var timestartrow = new RowLayout { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(965), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(58), - LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, + Height = Application.GetRealHeight(180), }; - timestarFramelayout.AddChidren(timestartrow); + middle.AddChidren(timestartrow); var btnstarttimetext = new Button { - Text = Language.StringByID(MyInternationalizationString.starttime), TextAlignment = TextAlignment.CenterLeft, + Width = Application.GetRealWidth(300), + X = Application.GetRealWidth(30), + TextID = MyInternationalizationString.starttime, TextColor = ZigbeeColor.Current.LogicTextBlackColor, - Width = Application.GetRealWidth(265) - }; timestartrow.AddChidren(btnstarttimetext); var btnstarttime = new Button { - X = btnstarttimetext.Right, + X = Application.GetRealWidth(330), Gravity = Gravity.CenterVertical, - Width = Application.GetRealWidth(630), - TextAlignment = TextAlignment.CenterRight, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, + Width = Application.GetRealWidth(600), + TextAlignment = TextAlignment.CenterLeft, Tag = "0", + TextColor = ZigbeeColor.Current.LogicTextBlackColor, }; timestartrow.AddChidren(btnstarttime); var btnstartback = new Button { - Width = Application.GetRealWidth(58), - Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(110), + Height = Application.GetRealHeight(110), UnSelectedImagePath = "ZigeeLogic/next.png", - X = btnstarttime.Right + Application.GetRealWidth(12), + SelectedImagePath = "ZigeeLogic/NextSelecte.png", + X = Application.GetRealWidth(1080-140), Gravity = Gravity.CenterVertical, }; timestartrow.AddChidren(btnstartback); - #endregion - - #region -----缁撴潫鏃堕棿 - var timeendFramelayout = new FrameLayout - { - Height = Application.GetRealHeight(160), - BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - Y = timestarFramelayout.Bottom, - }; - middle.AddChidren(timeendFramelayout); - var timeendrow = new RowLayout { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(965), - Height = Application.GetRealHeight(130), - X = Application.GetRealWidth(58), - LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor, + Height = Application.GetRealHeight(180), }; - timeendFramelayout.AddChidren(timeendrow); + middle.AddChidren(timeendrow); var btnendtimetext = new Button { - Text = Language.StringByID(MyInternationalizationString.endtime), TextAlignment = TextAlignment.CenterLeft, + Width = Application.GetRealWidth(300), + X = Application.GetRealWidth(30), + TextID = MyInternationalizationString.endtime, TextColor = ZigbeeColor.Current.LogicTextBlackColor, - Width = Application.GetRealWidth(265), - }; timeendrow.AddChidren(btnendtimetext); var btnendtime = new Button { - X = btnendtimetext.Right, + X = Application.GetRealWidth(330), Gravity = Gravity.CenterVertical, - Width = Application.GetRealWidth(630), - TextAlignment = TextAlignment.CenterRight, - TextColor = ZigbeeColor.Current.LogicTextBlackColor, + Width = Application.GetRealWidth(600), + TextAlignment = TextAlignment.CenterLeft, Tag = "0", + TextColor = ZigbeeColor.Current.LogicTextBlackColor, }; timeendrow.AddChidren(btnendtime); var btnendtimeback = new Button { - Width = Application.GetRealWidth(58), - Height = Application.GetRealHeight(58), + Width = Application.GetRealWidth(110), + Height = Application.GetRealHeight(110), UnSelectedImagePath = "ZigeeLogic/next.png", - X = btnendtime.Right + Application.GetRealWidth(12), + SelectedImagePath = "ZigeeLogic/NextSelecte.png", + X = Application.GetRealWidth(1080-140), Gravity = Gravity.CenterVertical, }; timeendrow.AddChidren(btnendtimeback); - #endregion - #endregion - if (IsEditor) + if (IsDeviceEditor1) { if (str1 != null) { @@ -318,10 +245,11 @@ } } + EventHandler<MouseEventArgs> stattimeclick = (sender, e) => { - var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; + var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; AddChidren(flMain); flMain.MouseUpEventHandler += (sender11, e11) => { @@ -391,11 +319,11 @@ btnstarttimetext.MouseUpEventHandler += stattimeclick; btnstarttime.MouseUpEventHandler += stattimeclick; btnstartback.MouseUpEventHandler += stattimeclick; - timestarFramelayout.MouseUpEventHandler += stattimeclick; + EventHandler<MouseEventArgs> endtimeclick = (sender, e) => { - var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; + var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; AddChidren(flMain); flMain.MouseUpEventHandler += (sender11, e11) => { @@ -466,14 +394,30 @@ btnendtimetext.MouseUpEventHandler += endtimeclick; btnendtime.MouseUpEventHandler += endtimeclick; btnendtimeback.MouseUpEventHandler += endtimeclick; - timeendFramelayout.MouseUpEventHandler += endtimeclick; + var fra = new FrameLayout + { + Y = middle.Bottom, + Height = Application.GetRealHeight(200), + BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, + }; + this.AddChidren(fra); + var btncomplete = new Button + { + X = Application.GetRealWidth(290), + Height = Application.GetRealHeight(150),//194 + Width = Application.GetRealWidth(500), + Radius = (uint)Application.GetRealHeight(50), + BackgroundColor = ZigbeeColor.Current.LogicButtonBlueColor, + TextID = MyInternationalizationString.Save, + }; + fra.AddChidren(btncomplete); + + timeBucketConditionsInfo.Add("Type","5"); + timeBucketConditionsInfo.Add("IsValid", "1"); ///瀹屾垚鐐瑰嚮浜嬩欢 EventHandler<MouseEventArgs>completeclick=(sender, e) => { - - timeBucketConditionsInfo.Add("Type", "5"); - timeBucketConditionsInfo.Add("IsValid", "1"); if (string.IsNullOrEmpty(btnstarttime.Text) || string.IsNullOrEmpty(btnendtime.Text)) { @@ -492,7 +436,7 @@ return; } - if (IsEditor) + if (IsDeviceEditor1) { for (int i = 0; i < Common.Logic.CurrentLogic.Conditions.Count; i++) { @@ -522,8 +466,9 @@ UserView.HomePage.Instance.PageIndex += 1; logicCommunalPage.Show(() => { }); }; + fra.MouseUpEventHandler += completeclick; - btnsave.MouseUpEventHandler += completeclick; + btncomplete.MouseUpEventHandler += completeclick; } } -- Gitblit v1.8.0