| | |
| | | |
| | | #region ◆ 变量申明__________________________ |
| | | ZigBee.Device.DoorLock doorLock; |
| | | VerticalScrolViewLayout bodyView; |
| | | VerticalRefreshLayout bodyView; |
| | | Button currentMethod;// 当前选择的方式 |
| | | Shared.Phone.UserCenter.MemberInfoRes curAccountObj; |
| | | Button entryStatusPic; |
| | |
| | | { |
| | | System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); |
| | | try |
| | | { |
| | | var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock); |
| | |
| | | { |
| | | btnAddFrameLayout.Width = Application.GetRealWidth(72); |
| | | } |
| | | |
| | | if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true) |
| | | { |
| | | CommonPage.Loading.Start("Loading..."); |
| | | ReadDoorLockUserInfo(); |
| | | } |
| | | else |
| | | { |
| | | MidFrameLayoutContent(); |
| | | RefreshList(); |
| | | } |
| | | } |
| | | //中部布局 |
| | | void MidFrameLayoutContent() |
| | | { |
| | | #region 开锁方式UI |
| | | var midTopFrameLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(115), |
| | |
| | | }; |
| | | midTopFrameLayout.AddChidren(btnNext); |
| | | |
| | | btnNext.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | SideslipFramelayout(); |
| | | }; |
| | | var btnLine = new Button |
| | | { |
| | | Y = midTopFrameLayout.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine, |
| | | }; |
| | | this.midFrameLayout.AddChidren(btnLine); |
| | | #endregion |
| | | |
| | | entryStatusPic = new Button |
| | | { |
| | | X = Application.GetRealWidth(164), |
| | | Y = Application.GetRealHeight(492), |
| | | Height = Application.GetRealHeight(435), |
| | | Width = Application.GetRealWidth(757), |
| | | Y = Application.GetRealHeight(377), |
| | | Visible = false, |
| | | UnSelectedImagePath = "DoorLock/UnLockBlankPic.png", |
| | | }; |
| | | this.midFrameLayout.AddChidren(entryStatusPic); |
| | | |
| | | #region 空图片 |
| | | btnPicTip = new Button |
| | | { |
| | | X = Application.GetRealWidth(397), |
| | | Y = Application.GetRealHeight(1143 - 184), |
| | | Height = Application.GetRealHeight(98 / 2), |
| | | Y = Application.GetRealHeight(844), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | { |
| | | X = Application.GetRealWidth(397), |
| | | Y = btnPicTip.Bottom, |
| | | Height = Application.GetRealHeight(98 / 2), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation1), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Visible = false, |
| | | }; |
| | | this.midFrameLayout.AddChidren(btnPicTip1); |
| | | #endregion |
| | | |
| | | var btnLine = new Button |
| | | { |
| | | Y = midTopFrameLayout.Bottom, |
| | | Height = 1, |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine, |
| | | }; |
| | | this.midFrameLayout.AddChidren(btnLine); |
| | | |
| | | bodyView = new VerticalScrolViewLayout() |
| | | bodyView = new VerticalRefreshLayout() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | this.midFrameLayout.AddChidren(bodyView); |
| | | |
| | | btnNext.MouseUpEventHandler += (sender, e) => |
| | | bodyView.BeginHeaderRefreshingAction += () => |
| | | { |
| | | SideslipFramelayout(); |
| | | }; |
| | | if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true) |
| | | { |
| | | bodyView.BeginHeaderRefreshing(); |
| | | ReadDoorLockUserInfo(); |
| | | } |
| | | else |
| | | { |
| | | RefreshList(); |
| | | } |
| | | bodyView.EndHeaderRefreshing(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="key"></param> |
| | | public void RefreshList() |
| | | { |
| | | if (doorLock.IsFailedToGetDoorLockInfo[curAccountObj.SubAccountDistributedMark] == true) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | return; |
| | | } |
| | | this.midFrameLayout.RemoveAll(); |
| | | MidFrameLayoutContent(); |
| | | bodyView.RemoveAll(); |
| | | var curAccountDoorLockUserList = new Dictionary<int, ZigBee.Device.DoorLock.LocaDoorLockObj>(); |
| | | |
| | | foreach (var curUserId in doorLock.localDoorLockUserList.Keys) |
| | | { |
| | | var curDoorLockUser = doorLock.localDoorLockUserList[curUserId]; |
| | |
| | | entryStatusPic.Visible = true; |
| | | btnPicTip.Visible = true; |
| | | btnPicTip1.Visible = true; |
| | | entryStatusPic.Height = Application.GetRealHeight(435); |
| | | entryStatusPic.Width = Application.GetRealHeight(757); |
| | | btnPicTip.Height = Application.GetRealHeight(98 / 2); |
| | | btnPicTip1.Height = Application.GetRealHeight(98 / 2); |
| | | bodyView.Height = Application.GetRealHeight(0); |
| | | } |
| | | else |
| | | { |
| | | bodyView.Height = Application.GetRealHeight(1921 - 184 - 116); |
| | | entryStatusPic.Visible = false; |
| | | btnPicTip.Visible = false; |
| | | btnPicTip1.Visible = false; |
| | | } |
| | | if (curAccountDoorLockUserList.Keys.Count == 0) |
| | | entryStatusPic.Height = Application.GetRealHeight(0); |
| | | entryStatusPic.Width = Application.GetRealHeight(0); |
| | | btnPicTip.Height = Application.GetRealHeight(0); |
| | | btnPicTip1.Height = Application.GetRealHeight(0); |
| | | var frameLayoutRow = new FrameLayout() |
| | | { |
| | | return; |
| | | } |
| | | bodyView.Height = curAccountDoorLockUserList.Keys.Count * Application.GetRealHeight(127 + 23); |
| | | Height = Application.GetMinRealAverage(0), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | bodyView.AddChidren(frameLayoutRow); |
| | | int i = 0; |
| | | foreach (var curUserId in curAccountDoorLockUserList.Keys) |
| | | { |
| | |
| | | { |
| | | Height = Application.GetRealHeight(127 + 23), |
| | | X = Application.GetRealWidth(58), |
| | | Y = i * Application.GetRealHeight(150), |
| | | Width = Application.GetRealWidth(965), |
| | | LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | bodyView.AddChidren(rowFrameLayout); |
| | | frameLayoutRow.AddChidren(rowFrameLayout); |
| | | |
| | | var btnPicFrameLayout = new FrameLayout() |
| | | { |
| | |
| | | |
| | | var btnDel = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(1080 - 173), |
| | | Height = Application.GetRealHeight(49), |
| | | X = Application.GetRealWidth(173), |
| | | Y = Application.GetRealHeight(95), |
| | | Width = Application.GetRealWidth(184), |
| | | Text = Language.StringByID(R.MyInternationalizationString.DelBindDevice), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | TextSize = 12, |
| | |
| | | #endregion |
| | | i++; |
| | | } |
| | | frameLayoutRow.Height = i * Application.GetRealHeight(150); |
| | | } |
| | | } |
| | | |
| | | // 侧边导航栏 |
| | |
| | | |
| | | if (curAccountDoorLockUserList.Count == 0) |
| | | { |
| | | bodyView.Height = Application.GetRealHeight(0); |
| | | entryStatusPic.Visible = true; |
| | | btnPicTip.Visible = true; |
| | | btnPicTip1.Visible = true; |
| | | entryStatusPic.Height = Application.GetRealHeight(435); |
| | | entryStatusPic.Width = Application.GetRealHeight(757); |
| | | btnPicTip.Height = Application.GetRealHeight(98 / 2); |
| | | btnPicTip1.Height = Application.GetRealHeight(98 / 2); |
| | | } |
| | | else |
| | | { |
| | | entryStatusPic.Visible = false; |
| | | btnPicTip.Visible = false; |
| | | btnPicTip1.Visible = false; |
| | | } |
| | | if (curAccountDoorLockUserList.Keys.Count == 0) |
| | | entryStatusPic.Height = Application.GetRealHeight(0); |
| | | entryStatusPic.Width = Application.GetRealHeight(0); |
| | | btnPicTip.Height = Application.GetRealHeight(0); |
| | | btnPicTip1.Height = Application.GetRealHeight(0); |
| | | bodyView.Height = Application.GetRealHeight(1921 - 184 - 116); |
| | | |
| | | var frameLayoutRow = new FrameLayout() |
| | | { |
| | | return; |
| | | } |
| | | Height = Application.GetMinRealAverage(0), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | bodyView.AddChidren(frameLayoutRow); |
| | | int i = 0; |
| | | foreach (var curUserId in curAccountDoorLockUserList.Keys) |
| | | { |
| | |
| | | { |
| | | Height = Application.GetRealHeight(127 + 23), |
| | | X = Application.GetRealWidth(58), |
| | | Y = i * Application.GetRealHeight(150), |
| | | Width = Application.GetRealWidth(965), |
| | | LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | }; |
| | | bodyView.AddChidren(rowFrameLayout); |
| | | frameLayoutRow.AddChidren(rowFrameLayout); |
| | | |
| | | var btnPicFrameLayout = new FrameLayout() |
| | | { |
| | |
| | | #endregion |
| | | i++; |
| | | } |
| | | |
| | | bodyView.Height = i * Application.GetRealHeight(127 + 23); |
| | | frameLayoutRow.Height = i * Application.GetRealHeight(127 + 23); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |