| | |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="doorLock"></param> |
| | | public UndistributeDoorlockUserPage(ZigBee.Device.DoorLock doorLock, List<Shared.Phone.UserCenter.MemberInfoRes> localAccountList) |
| | | public UndistributeDoorlockUserPage(ZigBee.Device.DoorLock doorLock, List<MemberInfoRes> localAccountList) |
| | | { |
| | | this.doorLock = doorLock; |
| | | this.localAccountList = localAccountList; |
| | |
| | | /// <summary> |
| | | /// 本地账户列表 |
| | | /// </summary> |
| | | List<Shared.Phone.UserCenter.MemberInfoRes> localAccountList; |
| | | List<MemberInfoRes> localAccountList; |
| | | /// <summary> |
| | | /// 滑动布局View |
| | | /// </summary> |
| | | VerticalListRefreshControl bodyView; |
| | | /// <summary> |
| | | /// 是否二次删除 |
| | | /// </summary> |
| | | bool isSecondDel; |
| | | VerticalRefreshLayout bodyView; |
| | | /// <summary> |
| | | /// 保存之前搜索到本地门锁用户列表 |
| | | /// </summary> |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | UndateUnlockMethodAction += (obj) => |
| | | { |
| | | RefreshList(obj); |
| | | }; |
| | | TypeRefresh(doorLock); |
| | | TypeRefresh(); |
| | | CommonPage.Loading.Hide(); |
| | | bodyView.EndHeaderRefreshing(); |
| | | }); |
| | |
| | | { |
| | | btnAllMethod.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock); |
| | | } |
| | | else if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FaceIDUnlock)) |
| | | { |
| | | btnAllMethod.Text = Language.StringByID(R.MyInternationalizationString.FaceIDUnlock); |
| | | } |
| | | else if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.CalmFingerprintUnlock)) |
| | | { |
| | | btnAllMethod.Text = Language.StringByID(R.MyInternationalizationString.CalmFingerprintUnlock); |
| | | } |
| | | else |
| | | { |
| | | btnAllMethod.Text = Language.StringByID(R.MyInternationalizationString.AllMethod); |
| | |
| | | midTopFrameLayout.AddChidren(btnNext); |
| | | EventHandler<MouseEventArgs> handerSideLip = (sender, e) => |
| | | { |
| | | SideslipFramelayout(doorLock); |
| | | UndateUnlockMethodAction += (obj) => |
| | | { |
| | | RefreshList(obj); |
| | | }; |
| | | SideslipFramelayout(); |
| | | }; |
| | | btnNext.MouseUpEventHandler += handerSideLip; |
| | | btnAllMethod.MouseUpEventHandler += handerSideLip; |
| | | |
| | | var btnLine = new Button |
| | | { |
| | | Y = midTopFrameLayout.Bottom, |
| | |
| | | }; |
| | | this.midFrameLayout.AddChidren(btnLine); |
| | | |
| | | bodyView = new VerticalListRefreshControl() |
| | | bodyView = new VerticalRefreshLayout() |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Height = Application.GetRealHeight(1921 - 184 - 115 - 1), |
| | |
| | | continue; |
| | | } |
| | | break; |
| | | case 13: |
| | | if (curDoorLockUser.UnlockType != unlockMethod) |
| | | { |
| | | continue; |
| | | } |
| | | break; |
| | | case 14: |
| | | if (curDoorLockUser.UnlockType != unlockMethod) |
| | | { |
| | | continue; |
| | | } |
| | | break; |
| | | case 15: |
| | | if (curDoorLockUser.UnlockType != unlockMethod) |
| | | { |
| | |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | var rowFrameLayout = new RowLayoutControl(bodyView.rowSpace / 2); |
| | | rowFrameLayout.BackgroundColor = ZigbeeColor.Current.XMWhite; |
| | | bodyView.AddChidren(rowFrameLayout); |
| | | rowFrameLayout.frameTable.UseClickStatu = false; |
| | | var btnicon = rowFrameLayout.frameTable.AddLeftIcon(); |
| | | btnicon.UnSelectedImagePath = "DoorLock/DistributeUnlockIcon.png"; |
| | | |
| | | string cText = ""; |
| | | switch (curDoorLockUser.UnlockType) |
| | | var rowFrameLayout = new FrameLayout() |
| | | { |
| | | case 0: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | cText = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | cText = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 3: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | cText = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | cText = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 13: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | cText = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | cText = Language.StringByID(R.MyInternationalizationString.CalmFingerprintMark) + "ID" + +curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 14: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | cText = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | cText = Language.StringByID(R.MyInternationalizationString.FaceIDMark) + "ID" + +curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 15: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | cText = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | cText = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | } |
| | | var btnText = rowFrameLayout.frameTable.AddLeftCaption(cText, 800); |
| | | |
| | | //删除 |
| | | var btndelete = rowFrameLayout.AddDeleteControl(); |
| | | btndelete.ButtonClickEvent += (sender, e) => |
| | | { |
| | | string msg = Language.StringByID(R.MyInternationalizationString.SureToDelUnlockMethod); |
| | | var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); |
| | | alert.Show(); |
| | | //使用确认型弹框时,的回调函数 |
| | | alert.ConfirmClickEvent += async () => |
| | | { |
| | | try |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | var passData = doorLock.SetUserAccessData(curDoorLockUser.UserID, ZigBee.Device.DoorLock.AccessType.DelCurrentUser); |
| | | var resultData = await doorLock.DefaultControlAsync(passData); |
| | | if (resultData != null && resultData.defaultControlResponseData != null) |
| | | { |
| | | if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2) |
| | | { |
| | | var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | deleteDoorLockData.IsOtherAccountCtrl = true; |
| | | } |
| | | if (doorLock.DeviceAddr != null) |
| | | { |
| | | deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; |
| | | } |
| | | deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); |
| | | deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; |
| | | deleteDoorLockData.DelDoorLockDelType = 2; |
| | | var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData); |
| | | if (result != null) |
| | | { |
| | | if (result.StateCode == "Success") |
| | | { |
| | | isSecondDel = false; |
| | | if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) |
| | | { |
| | | doorLock.localDoorLockAccountList.Remove(curDoorLockUser.ConnectedAccount); |
| | | var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; |
| | | localDoorLockObj.UserID = curDoorLockUser.UserID; |
| | | doorLock.localDoorLockUserList.Remove(curUserId); |
| | | doorLock.ReSave(); |
| | | UndateUnlockMethodAction += (obj) => |
| | | { |
| | | RefreshList(obj); |
| | | }; |
| | | TypeRefresh(doorLock); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //开关图标 |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnText); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | isSecondDel = true; |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnText); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (isSecondDel) |
| | | { |
| | | var deleteDoorLockData = new ZigBee.Device.DoorLock.DeleteDoorLockData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | { |
| | | deleteDoorLockData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | deleteDoorLockData.IsOtherAccountCtrl = true; |
| | | } |
| | | if (doorLock.DeviceAddr != null) |
| | | { |
| | | deleteDoorLockData.DoorLockId = doorLock.DeviceAddr + "_" + doorLock.DeviceEpoint; |
| | | } |
| | | deleteDoorLockData.DoorLockLocalUserId = curDoorLockUser.UserID.ToString(); |
| | | deleteDoorLockData.PrimaryId = curDoorLockUser.PrimaryId; |
| | | deleteDoorLockData.DelDoorLockDelType = 2; |
| | | var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLock", deleteDoorLockData); |
| | | if (result != null) |
| | | { |
| | | if (result.StateCode == "Success") |
| | | { |
| | | isSecondDel = false; |
| | | if (doorLock.localDoorLockUserList.ContainsKey(curDoorLockUser.UserID)) |
| | | { |
| | | doorLock.localDoorLockUserList.Remove(curDoorLockUser.UserID); |
| | | var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { }; |
| | | localDoorLockObj.UserID = curDoorLockUser.UserID; |
| | | doorLock.localDoorLockUserList.Remove(curUserId); |
| | | UndateUnlockMethodAction += (obj) => |
| | | { |
| | | RefreshList(obj); |
| | | }; |
| | | TypeRefresh(doorLock); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnText); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | isSecondDel = true; |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnText); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (curDoorLockUser.UserID < 10) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OnlyBeDeletedOnTheDevice), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnText); |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnText); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(CommonPage.Instance); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | }; |
| | | Height = Application.GetRealHeight(127 + 23), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | bodyView.AddChidren(rowFrameLayout); |
| | | |
| | | var btnDistributeUnlockIconFrameLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(84), |
| | | Width = Application.GetRealWidth(84), |
| | | X = Application.GetRealWidth(58), |
| | | Y = Application.GetRealHeight(43), |
| | | }; |
| | | rowFrameLayout.AddChidren(btnDistributeUnlockIconFrameLayout); |
| | | |
| | | var btnDistributeUnlockIcon = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(84), |
| | | Width = Application.GetRealWidth(84), |
| | | UnSelectedImagePath = "DoorLock/DistributeUnlockIcon.png", |
| | | }; |
| | | btnDistributeUnlockIconFrameLayout.AddChidren(btnDistributeUnlockIcon); |
| | | |
| | | var btnText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(176), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(300), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextSize = 15, |
| | | }; |
| | | rowFrameLayout.AddChidren(btnText); |
| | | |
| | | var line2 = new Button() |
| | | { |
| | |
| | | { |
| | | line2.Visible = false; |
| | | } |
| | | |
| | | switch (curDoorLockUser.UnlockType) |
| | | { |
| | | case 0: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | btnText.Text = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | btnText.Text = Language.StringByID(R.MyInternationalizationString.Password) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 3: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | btnText.Text = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | btnText.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 15: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | btnText.Text = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | btnText.Text = Language.StringByID(R.MyInternationalizationString.Fingerprint) + "ID" + +curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | MatchUsersFrameLayout(curDoorLockUser); |
| | | }; |
| | | btnDistributeUnlockIcon.MouseUpEventHandler += eHandler; |
| | | btnDistributeUnlockIconFrameLayout.MouseUpEventHandler += eHandler; |
| | | rowFrameLayout.MouseUpEventHandler += eHandler; |
| | | btnText.MouseUpEventHandler += eHandler; |
| | | #endregion |
| | |
| | | btnLine.Visible = false; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(currentAccount.UserName)) |
| | | { |
| | | btnUserName.Text = currentAccount.UserName; |
| | | } |
| | | else |
| | | { |
| | | btnUserName.Text = currentAccount.Account; |
| | | } |
| | | btnUserName.Text = currentAccount.ShowName; |
| | | |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | if (doorLock.IsFreezeAccount[currentAccount.SubAccountDistributedMark] == true) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = btnUserName.Text + Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | }); |
| | | return; |
| | | } |
| | | //☆マーク☆ |
| | | //if (doorLock.IsFreezeAccount[currentAccount.SubAccountDistributedMark] == true) |
| | | //{ |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // new Tip() { MaxWidth = 150, Text = btnUserName.Text + Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | // }); |
| | | // return; |
| | | //} |
| | | |
| | | if (!btnChoose.IsSelected) |
| | | { |
| | |
| | | oldbuttonChoose.IsSelected = true; |
| | | oldbuttonChoose.Visible = true; |
| | | oldUserName.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | curAccountId = currentAccount.SubAccountDistributedMark; |
| | | //☆マーク☆ |
| | | //curAccountId = currentAccount.SubAccountDistributedMark; |
| | | } |
| | | }; |
| | | btnChoose.MouseUpEventHandler += eHandler; |
| | |
| | | else |
| | | { |
| | | var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData(); |
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1) |
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 1) |
| | | { |
| | | addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | //☆マーク☆ |
| | | //addLockInfo.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); |
| | | addLockInfo.IsOtherAccountCtrl = true; |
| | | } |
| | | addLockInfo.CloudAccountId = curAccountId; |
| | |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 13: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | addLockInfo.UserIdRemarks = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.CalmFingerprintMark) + "ID" + +curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 14: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | | addLockInfo.UserIdRemarks = curDoorLockUser.UserName; |
| | | } |
| | | else |
| | | { |
| | | addLockInfo.UserIdRemarks = Language.StringByID(R.MyInternationalizationString.FaceIDMark) + "ID" + +curDoorLockUser.UserID; |
| | | } |
| | | break; |
| | | case 15: |
| | | if (!string.IsNullOrEmpty(curDoorLockUser.UserName)) |
| | | { |
| | |
| | | var result = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/AddDoorLock", addLockInfo); |
| | | if (result != null) |
| | | { |
| | | if (result.StateCode == "Success") |
| | | if (result.Code == HttpMessageEnum.A成功) |
| | | { |
| | | //存门锁信息 |
| | | var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountId); |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.DistributeSuccess), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | UndateUnlockMethodAction += (obj) => |
| | | { |
| | | RefreshList(obj); |
| | | }; |
| | | TypeRefresh(doorLock); |
| | | TypeRefresh(); |
| | | CommonPage.Loading.Hide(); |
| | | flMain.RemoveFromParent(); |
| | | bottomFrameLayout.RemoveAll(); |
| | | |
| | | }); |
| | | } |
| | | else |
| | |
| | | }); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 侧边导航栏搜索 |
| | | /// </summary> |
| | | void SideslipFramelayout() |
| | | { |
| | | #region sidelipFrameLayout UI |
| | | var dialog = new Dialog |
| | | { |
| | | }; |
| | | dialog.Show(); |
| | | |
| | | var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; |
| | | dialog.AddChidren(flMain); |
| | | flMain.MouseUpEventHandler += (sender11, e11) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var sidelipFrameLayout = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(625), |
| | | Width = Application.GetRealWidth(449), |
| | | Y = Application.GetRealHeight(115 + 160), |
| | | X = Application.GetRealWidth(596), |
| | | BackgroundImagePath = "DoorLock/SideslipPic.png", |
| | | }; |
| | | flMain.AddChidren(sidelipFrameLayout); |
| | | |
| | | var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(600), |
| | | Y = Application.GetRealHeight(28), |
| | | }; |
| | | sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout); |
| | | #endregion |
| | | |
| | | Button oldbutton = null; |
| | | Button oldbuttonText = null; |
| | | for (var i = 0; i < 4; i++) |
| | | { |
| | | #region rowFrameLayout UI |
| | | var rowFrameLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(150), |
| | | LineColor = Shared.Common.ZigbeeColor.Current.XMRowLine, |
| | | X = Application.GetRealWidth(81), |
| | | }; |
| | | sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); |
| | | |
| | | var btnAllMethod = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(81), |
| | | Height = Application.GetRealHeight(81), |
| | | Y = Application.GetRealHeight(35), |
| | | }; |
| | | rowFrameLayout.AddChidren(btnAllMethod); |
| | | |
| | | var btnMethodText = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(311), |
| | | Height = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(92), |
| | | Y = Application.GetRealHeight(49), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | TextSize = 14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | rowFrameLayout.AddChidren(btnMethodText); |
| | | #endregion |
| | | |
| | | #region 数据处理 |
| | | EventHandler<MouseEventArgs> hander = (sender, e) => |
| | | { |
| | | if (!btnAllMethod.IsSelected) |
| | | { |
| | | if (oldbutton != null) |
| | | { |
| | | oldbutton.IsSelected = false; |
| | | } |
| | | if (oldbuttonText != null) |
| | | { |
| | | oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; |
| | | } |
| | | oldbutton = btnAllMethod; |
| | | oldbuttonText = btnMethodText; |
| | | doorLock.currentUserDisplayMethod = btnMethodText.Text; |
| | | btnAllMethod.IsSelected = true; |
| | | oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | oldbuttonText.IsBold = true; |
| | | TypeRefresh(); |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | | rowFrameLayout.MouseUpEventHandler += hander; |
| | | btnAllMethod.MouseUpEventHandler += hander; |
| | | btnMethodText.MouseUpEventHandler += hander; |
| | | DisplayAllUnlockMethod(i, btnAllMethod, btnMethodText); |
| | | |
| | | if (string.IsNullOrEmpty(doorLock.currentUserDisplayMethod) && i == 0) |
| | | { |
| | | CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText); |
| | | } |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod) && i == 0) |
| | | { |
| | | CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText); |
| | | } |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock) && i == 1) |
| | | { |
| | | CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText); |
| | | } |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock) && i == 2) |
| | | { |
| | | CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText); |
| | | } |
| | | if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock) && i == 3) |
| | | { |
| | | CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 类型区分 |
| | | /// </summary> |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | } |