HDL Home App 第二版本 旧平台金堂用 正在使用
xm
2019-11-27 a2d26f15b940c853faaf6d6959b16a6d919cb800
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -54,6 +54,7 @@
        Button btnPicTip;
        Button btnPicTip1;
        bool isSecondDel;
        FrameLayout blankFrameLayout;
        #endregion
        void ReadDoorLockUserInfo()
@@ -77,7 +78,8 @@
                {
                    Application.RunOnMainThread(() =>
                    {
                        RefreshList();
                        // 类型区分
                        TypeRefresh();
                        CommonPage.Loading.Hide();
                    });
                }
@@ -221,26 +223,49 @@
            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
            {
@@ -250,21 +275,9 @@
                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>
@@ -274,9 +287,9 @@
        /// <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)
            {
@@ -297,22 +310,24 @@
                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),
@@ -494,7 +509,7 @@
                                     localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
                                     localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
                                     doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
                                     RefreshList();
                                     TypeRefresh();
                                 }
                             }
                             else
@@ -553,7 +568,7 @@
                                                        localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                        doorLock.localDoorLockUserList.Remove(curUserId);
                                                        doorLock.ReSave();
                                                        RefreshList();
                                                        TypeRefresh();
                                                    }
                                                }
                                                else
@@ -597,7 +612,7 @@
                                                            var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
                                                            localDoorLockObj.UserID = curDoorLockUser.UserID;
                                                            doorLock.localDoorLockUserList.Remove(curUserId);
                                                            RefreshList();
                                                            TypeRefresh();
                                                        }
                                                    }
                                                    else
@@ -724,24 +739,7 @@
                        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();
                };
@@ -811,6 +809,27 @@
            }
        }
        //类型区分
        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>