黄学彪
2020-01-17 4b378188ce972df432b23d9cb73babb6cc0679c6
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
@@ -17,15 +17,36 @@
            BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
        }
        #region ◆ 变量申明__________________________
        #region 变量申明
        /// <summary>
        /// 当前门锁
        /// </summary>
        ZigBee.Device.DoorLock doorLock;
        /// <summary>
        /// 底部白色布局
        /// </summary>
        FrameLayout bottomFrameLayout;
        /// <summary>
        /// 当前类型
        /// </summary>
        string currentType = string.Empty;
        /// <summary>
        /// 本地账户列表
        /// </summary>
        List<Shared.Phone.UserCenter.MemberInfoRes> localAccountList;
        /// <summary>
        /// 滑动布局View
        /// </summary>
        VerticalRefreshLayout bodyView;
        /// <summary>
        /// 保存之前搜索到本地门锁用户列表
        /// </summary>
        Dictionary<int, DoorLockCommonInfo.LocaDoorLockObj> oldLocalDoorLockUserList = new Dictionary<int, DoorLockCommonInfo.LocaDoorLockObj>();
        #endregion
        /// <summary>
        /// 获取所有账户的门锁用户列表
        /// </summary>
        void ReadDoorLockUserInfo()
        {
            System.Threading.Tasks.Task.Run(async () =>
@@ -35,6 +56,7 @@
                    var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock);
                    if (oldLocalDoorLockUserList.Count != 0)
                    {
                        //如果本次没有搜索到,提示网关没有回复
                        if (list.Count == 0)
                        {
                            Application.RunOnMainThread(() =>
@@ -84,6 +106,9 @@
            }
        }
        /// <summary>
        /// 中部布局
        /// </summary>
        public void MidFrameLayoutContent()
        {
            var midTopFrameLayout = new FrameLayout()
@@ -164,6 +189,9 @@
            };
        }
        /// <summary>
        /// 刷新列表
        /// </summary>
        void RefreshList(int unlockMethod = -1)
        {
            this.midFrameLayout.RemoveAll();
@@ -312,7 +340,9 @@
            }
        }
        //本地账户
        /// <summary>
        /// 分配本地账户
        /// </summary>
        void MatchUsersFrameLayout(ZigBee.Device.DoorLock.LocaDoorLockObj curDoorLockUser)
        {
            #region  UI
@@ -641,9 +671,12 @@
           };
        }
        // 侧边导航栏
        /// <summary>
        /// 侧边导航栏搜索
        /// </summary>
        void SideslipFramelayout()
        {
            #region sidelipFrameLayout UI
            var dialog = new Dialog
            {
            };
@@ -672,10 +705,13 @@
                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),
@@ -703,7 +739,9 @@
                    TextAlignment = TextAlignment.CenterLeft,
                };
                rowFrameLayout.AddChidren(btnMethodText);
                #endregion
                #region 数据处理
                EventHandler<MouseEventArgs> hander = (sender, e) =>
                {
                    if (!btnAllMethod.IsSelected)
@@ -729,75 +767,35 @@
                rowFrameLayout.MouseUpEventHandler += hander;
                btnAllMethod.MouseUpEventHandler += hander;
                btnMethodText.MouseUpEventHandler += hander;
                switch (i)
                {
                    case 0:
                        btnAllMethod.UnSelectedImagePath = "DoorLock/AllMethod.png";
                        btnAllMethod.SelectedImagePath = "DoorLock/AllMethodOn.png";
                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.AllMethod);
                        break;
                    case 1:
                        btnAllMethod.UnSelectedImagePath = "DoorLock/Password.png";
                        btnAllMethod.SelectedImagePath = "DoorLock/PasswordOn.png";
                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.PasswordUnlock);
                        break;
                    case 2:
                        btnAllMethod.UnSelectedImagePath = "DoorLock/Fingerprint.png";
                        btnAllMethod.SelectedImagePath = "DoorLock/FingerprintOn.png";
                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.FingerprintUnlock);
                        break;
                    case 3:
                        btnAllMethod.UnSelectedImagePath = "DoorLock/proximityCard.png";
                        btnAllMethod.SelectedImagePath = "DoorLock/proximityCardOn.png";
                        btnMethodText.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock);
                        break;
                }
                DisplayAllUnlockMethod(i, btnAllMethod, btnMethodText);
                if (string.IsNullOrEmpty(doorLock.currentUserDisplayMethod) && i == 0)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod) && i == 0)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock) && i == 1)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.FingerprintUnlock) && i == 2)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock) && i == 3)
                {
                    btnAllMethod.IsSelected = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    btnMethodText.IsBold = true;
                    oldbutton = btnAllMethod;
                    oldbuttonText = btnMethodText;
                    CurrentSelectUnlockMethod(btnAllMethod, btnMethodText, oldbutton, oldbuttonText);
                }
                #endregion
            }
        }
        //类型区分
        /// <summary>
        /// 类型区分
        /// </summary>
        void TypeRefresh()
        {
            if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.PasswordUnlock))
@@ -817,7 +815,7 @@
                RefreshList();
            }
        }
        #region ◆ 接口实现__________________________
        #region 接口实现
        /// <summary>
        /// 处理变化事件 --将弃用 改用DeviceInfoChange()
        /// </summary>