From a2d26f15b940c853faaf6d6959b16a6d919cb800 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 27 十一月 2019 19:26:30 +0800
Subject: [PATCH] 请合并最新的代码(完成门锁功能)

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs |  105 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 62 insertions(+), 43 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
index 2ee625c..b5c8250 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
+++ b/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>

--
Gitblit v1.8.0