| | |
| | | this.btnBack.MouseUpEventHandler += eHandlerBack; |
| | | this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; |
| | | this.MidFrameLayout(this); |
| | | |
| | | MidFrameLayoutContent(); |
| | | } |
| | | |
| | |
| | | { |
| | | 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); |
| | | } |
| | |
| | | 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), |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 12, |
| | | }; |
| | | MidTopFrameLayout.AddChidren(btnDateTime); |
| | | rowLayout.AddChidren(btnDateTime); |
| | | |
| | | var textDisplayDateFrameLayout = new FrameLayout() |
| | | { |
| | |
| | | Height = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(620), |
| | | }; |
| | | MidTopFrameLayout.AddChidren(textDisplayDateFrameLayout); |
| | | rowLayout.AddChidren(textDisplayDateFrameLayout); |
| | | |
| | | var btnNextFrameLayout = new FrameLayout() |
| | | { |
| | |
| | | Height = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(956), |
| | | }; |
| | | MidTopFrameLayout.AddChidren(btnNextFrameLayout); |
| | | rowLayout.AddChidren(btnNextFrameLayout); |
| | | |
| | | var btnNext = new Button() |
| | | { |
| | |
| | | |
| | | if (i == 0) |
| | | { |
| | | btnDateTime.Y = Application.GetRealHeight(50); |
| | | rowLayout.Y = Application.GetRealHeight(50); |
| | | btnLine.Y = Application.GetRealHeight(23 + 127); |
| | | |
| | | textDisplayDate = new Button() |
| | |
| | | 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") |
| | | { |
| | |
| | | } |
| | | else if (i == 1) |
| | | { |
| | | btnDateTime.Y = Application.GetRealHeight(200); |
| | | rowLayout.Y = Application.GetRealHeight(200); |
| | | btnLine.Y = Application.GetRealHeight(40 + 127 + 127); |
| | | textDisplayTime = new Button() |
| | | { |
| | |
| | | Text = "00:00", |
| | | }; |
| | | textDisplayDateFrameLayout.AddChidren(textDisplayTime); |
| | | textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y; |
| | | //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y; |
| | | |
| | | if (setTimeType != "DoorLockTime") |
| | | { |
| | |
| | | } |
| | | } |
| | | }; |
| | | rowLayout.MouseDownEventHandler += hander; |
| | | btnDateTime.MouseDownEventHandler += hander; |
| | | textDisplayDateFrameLayout.MouseDownEventHandler += hander; |
| | | btnNextFrameLayout.MouseDownEventHandler += hander; |
| | |
| | | { |
| | | 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 { } |