| | |
| | | Button btnPicTip; |
| | | Button btnPicTip1; |
| | | bool isSecondDel; |
| | | FrameLayout blankFrameLayout; |
| | | #endregion |
| | | |
| | | void ReadDoorLockUserInfo() |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | RefreshList(); |
| | | // 类型区分 |
| | | TypeRefresh(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | } |
| | |
| | | this.midFrameLayout.AddChidren(btnLine); |
| | | #endregion |
| | | |
| | | bodyView = new VerticalRefreshLayout() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Height = Application.GetRealHeight(1921 - 184 - 116), |
| | | }; |
| | | this.midFrameLayout.AddChidren(bodyView); |
| | | bodyView.BeginHeaderRefreshingAction += () => |
| | | { |
| | | bodyView.BeginHeaderRefreshing(); |
| | | ReadDoorLockUserInfo(); |
| | | bodyView.EndHeaderRefreshing(); |
| | | }; |
| | | BlankPicUI(); |
| | | } |
| | | |
| | | void BlankPicUI() |
| | | { |
| | | blankFrameLayout = new FrameLayout |
| | | { |
| | | }; |
| | | bodyView.AddChidren(blankFrameLayout); |
| | | |
| | | entryStatusPic = new Button |
| | | { |
| | | X = Application.GetRealWidth(164), |
| | | Y = Application.GetRealHeight(377), |
| | | Height = Application.GetRealHeight(435), |
| | | Width = Application.GetRealHeight(757), |
| | | Visible = false, |
| | | UnSelectedImagePath = "DoorLock/UnLockBlankPic.png", |
| | | }; |
| | | this.midFrameLayout.AddChidren(entryStatusPic); |
| | | blankFrameLayout.AddChidren(entryStatusPic); |
| | | |
| | | #region 空图片 |
| | | btnPicTip = new Button |
| | | { |
| | | X = Application.GetRealWidth(397), |
| | | Y = Application.GetRealHeight(844), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoPasswordInformation), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Visible = false, |
| | | Y = Application.GetRealHeight(844), |
| | | }; |
| | | this.midFrameLayout.AddChidren(btnPicTip); |
| | | blankFrameLayout.AddChidren(btnPicTip); |
| | | |
| | | btnPicTip1 = new Button |
| | | { |
| | |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Visible = false, |
| | | BackgroundColor = 0xff00ff00, |
| | | }; |
| | | this.midFrameLayout.AddChidren(btnPicTip1); |
| | | #endregion |
| | | |
| | | bodyView = new VerticalRefreshLayout() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | }; |
| | | this.midFrameLayout.AddChidren(bodyView); |
| | | bodyView.BeginHeaderRefreshingAction += () => |
| | | { |
| | | bodyView.BeginHeaderRefreshing(); |
| | | ReadDoorLockUserInfo(); |
| | | bodyView.EndHeaderRefreshing(); |
| | | }; |
| | | blankFrameLayout.AddChidren(btnPicTip1); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="key"></param> |
| | | public void RefreshList(int unlockMethod = -1) |
| | | { |
| | | bodyView.RemoveAll(); |
| | | this.midFrameLayout.RemoveAll(); |
| | | MidFrameLayoutContent(); |
| | | bodyView.RemoveAll(); |
| | | var curAccountDoorLockUserList = new Dictionary<int, ZigBee.Device.DoorLock.LocaDoorLockObj>(); |
| | | foreach (var curUserId in doorLock.localDoorLockUserList.Keys) |
| | | { |
| | |
| | | entryStatusPic.Visible = true; |
| | | btnPicTip.Visible = true; |
| | | btnPicTip1.Visible = true; |
| | | blankFrameLayout.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); |
| | | blankFrameLayout.Height = bodyView.Height; |
| | | } |
| | | else |
| | | { |
| | | bodyView.Height = Application.GetRealHeight(1921 - 184 - 116); |
| | | entryStatusPic.Visible = false; |
| | | btnPicTip.Visible = false; |
| | | btnPicTip1.Visible = false; |
| | | blankFrameLayout.Visible = false; |
| | | entryStatusPic.Height = Application.GetRealHeight(0); |
| | | entryStatusPic.Width = Application.GetRealHeight(0); |
| | | btnPicTip.Height = Application.GetRealHeight(0); |
| | | btnPicTip1.Height = Application.GetRealHeight(0); |
| | | blankFrameLayout.Height = Application.GetRealHeight(0); |
| | | var frameLayoutRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetMinRealAverage(0), |
| | |
| | | localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks; |
| | | localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark; |
| | | doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj); |
| | | RefreshList(); |
| | | TypeRefresh(); |
| | | } |
| | | } |
| | | else |
| | |
| | | localDoorLockObj.UserID = curDoorLockUser.UserID; |
| | | doorLock.localDoorLockUserList.Remove(curUserId); |
| | | doorLock.ReSave(); |
| | | RefreshList(); |
| | | TypeRefresh(); |
| | | } |
| | | } |
| | | else |
| | |
| | | var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; |
| | | localDoorLockObj.UserID = curDoorLockUser.UserID; |
| | | doorLock.localDoorLockUserList.Remove(curUserId); |
| | | RefreshList(); |
| | | TypeRefresh(); |
| | | } |
| | | } |
| | | else |
| | |
| | | doorLock.ReSave(); |
| | | btnAllMethod.IsSelected = true; |
| | | oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | |
| | | // 类型区分 |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod)) |
| | | { |
| | | RefreshList(); |
| | | } |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock)) |
| | | { |
| | | RefreshList(0); |
| | | } |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock)) |
| | | { |
| | | RefreshList(15); |
| | | } |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock)) |
| | | { |
| | | RefreshList(3); |
| | | } |
| | | TypeRefresh(); |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | |
| | | } |
| | | } |
| | | |
| | | //类型区分 |
| | | void TypeRefresh() |
| | | { |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock)) |
| | | { |
| | | RefreshList(0); |
| | | } |
| | | else if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock)) |
| | | { |
| | | RefreshList(15); |
| | | } |
| | | else if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock)) |
| | | { |
| | | RefreshList(3); |
| | | } |
| | | else |
| | | { |
| | | RefreshList(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重写移除方法 |
| | | /// </summary> |