From 8b9ce384b26c414db32f98e94e088f5334869c2d Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 13 十一月 2019 15:36:28 +0800 Subject: [PATCH] 全部合并了代码,安卓和 IOS 都测试通过了 --- ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs | 38 ++++++++++++++++++++++++++------------ 1 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs index 7108033..1ab6e14 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs @@ -107,7 +107,6 @@ this.btnBack.MouseUpEventHandler += eHandlerBack; this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; this.MidFrameLayout(this); - MidFrameLayoutContent(); } @@ -115,10 +114,12 @@ { if (setTimeType == "DoorLockTime") { + // 鍙湁閲嶆柊鍚姩鏃朵細鎱紝鐒跺悗鍏朵粬鏃跺埢閮芥槸鏈夊�肩殑 new System.Threading.Thread(() => { while (this.Parent != null) { + //璇婚棬閿佹椂闂� doorLock.ReadAttri(ZigBee.Device.Cluster_ID.DoorLock, ZigBee.Device.AttriButeId.DoorLock); System.Threading.Thread.Sleep(5 * 1000); } @@ -135,6 +136,12 @@ var dtNow = DateTime.Now; for (int i = 0; i < 2; i++) { + var rowLayout = new FrameLayout() + { + Height = Application.GetRealHeight(58), + }; + MidTopFrameLayout.AddChidren(rowLayout); + var btnDateTime = new Button() { Width = Application.GetRealWidth(560), @@ -144,7 +151,7 @@ TextAlignment = TextAlignment.CenterLeft, TextSize = 12, }; - MidTopFrameLayout.AddChidren(btnDateTime); + rowLayout.AddChidren(btnDateTime); var textDisplayDateFrameLayout = new FrameLayout() { @@ -152,7 +159,7 @@ Height = Application.GetRealHeight(58), X = Application.GetRealWidth(620), }; - MidTopFrameLayout.AddChidren(textDisplayDateFrameLayout); + rowLayout.AddChidren(textDisplayDateFrameLayout); var btnNextFrameLayout = new FrameLayout() { @@ -160,7 +167,7 @@ Height = Application.GetRealHeight(58), X = Application.GetRealWidth(956), }; - MidTopFrameLayout.AddChidren(btnNextFrameLayout); + rowLayout.AddChidren(btnNextFrameLayout); var btnNext = new Button() { @@ -188,7 +195,7 @@ if (i == 0) { - btnDateTime.Y = Application.GetRealHeight(50); + rowLayout.Y = Application.GetRealHeight(50); btnLine.Y = Application.GetRealHeight(23 + 127); textDisplayDate = new Button() @@ -199,7 +206,7 @@ Text = "_" + Language.StringByID(R.MyInternationalizationString.Year) + "_" + Language.StringByID(R.MyInternationalizationString.Month) + "_" + Language.StringByID(R.MyInternationalizationString.Day), }; textDisplayDateFrameLayout.AddChidren(textDisplayDate); - textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y; + //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y; if (setTimeType != "DoorLockTime") { @@ -212,7 +219,7 @@ } else if (i == 1) { - btnDateTime.Y = Application.GetRealHeight(200); + rowLayout.Y = Application.GetRealHeight(200); btnLine.Y = Application.GetRealHeight(40 + 127 + 127); textDisplayTime = new Button() { @@ -222,7 +229,7 @@ Text = "00:00", }; textDisplayDateFrameLayout.AddChidren(textDisplayTime); - textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y; + //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y; if (setTimeType != "DoorLockTime") { @@ -503,6 +510,7 @@ } } }; + rowLayout.MouseDownEventHandler += hander; btnDateTime.MouseDownEventHandler += hander; textDisplayDateFrameLayout.MouseDownEventHandler += hander; btnNextFrameLayout.MouseDownEventHandler += hander; @@ -523,14 +531,20 @@ { CommonPage.Loading.Start(""); var rectifyResult = await doorLock.RectifyDoorLockTimeAsync(int.Parse(setTimestamp)); - if (rectifyResult != null && rectifyResult.setWritableValueResponData != null && rectifyResult.setWritableValueResponData.Status == 0) + if (rectifyResult != null && rectifyResult.setWritableValueResponData != null) { - this.shadowRadiusFrameLayout.RemoveFromParent(); - // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RectifySuccess), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + if (rectifyResult.setWritableValueResponData.Status == 0) + { + this.shadowRadiusFrameLayout.RemoveFromParent(); + } + else + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RectifyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + } } else { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RectifyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish); } } catch { } -- Gitblit v1.8.0