| | |
| | | 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 MidTopFrameLayout = new FrameLayout() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | this.midFrameLayout.AddChidren(MidTopFrameLayout); |
| | | |
| | | var dtNow = DateTime.Now; |
| | | for (int i = 0; i < 2; i++) |
| | | { |
| | | var rowLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(127 + 23), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | 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() |
| | | { |
| | |
| | | var btnLine = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(965), |
| | | Height = Application.GetRealHeight(5), |
| | | Height = 1, |
| | | X = Application.GetRealWidth(58), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | |
| | | }; |
| | | MidTopFrameLayout.AddChidren(btnLine); |
| | | |
| | |
| | | |
| | | if (i == 0) |
| | | { |
| | | btnDateTime.Y = Application.GetRealHeight(50); |
| | | btnDateTime.Y = textDisplayDateFrameLayout.Y = btnNextFrameLayout.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 = 1 + Application.GetRealHeight(150); |
| | | btnDateTime.Y = textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = Application.GetRealHeight(50); |
| | | 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") |
| | | { |
| | |
| | | { |
| | | btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.CurrentTime); |
| | | } |
| | | btnLine.Visible = false; |
| | | } |
| | | int curIndex = i; |
| | | EventHandler<MouseEventArgs> hander = (sender, e) => |
| | |
| | | mList2.Add(m.ToString()); |
| | | } |
| | | } |
| | | // mUIPickerView.setNPicker(mList1, mList2, new List<string> { }); |
| | | mUIPickerView.setNPicker(mList1, mList2, null); |
| | | mUIPickerView.setCurrentItems(dtNow.Hour, dtNow.Minute, 0); |
| | | if (CurentDoorLockTime != null) |
| | |
| | | } |
| | | } |
| | | }; |
| | | 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 { } |