From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs | 224 +++++++++++++++++--------------------------------------
1 files changed, 69 insertions(+), 155 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
index dfa00d7..158d0a8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs
@@ -103,8 +103,12 @@
{
Application.RunOnMainThread(() =>
{
- // 绫诲瀷鍖哄垎
- TypeRefresh();
+ // 绫诲瀷鍖哄垎
+ UndateUnlockMethodAction += (obj) =>
+ {
+ RefreshList(obj);
+ };
+ TypeRefresh(doorLock);
CommonPage.Loading.Hide();
bodyView.EndHeaderRefreshing();
});
@@ -112,8 +116,8 @@
});
}
- /// <summary>
- /// UI鏄剧ず
+ /// <summary>
+ /// UI鏄剧ず
/// </summary>
public void Show()
{
@@ -225,6 +229,14 @@
{
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);
@@ -243,7 +255,11 @@
EventHandler<MouseEventArgs> handerSideLip = (sender, e) =>
{
- SideslipFramelayout();
+ SideslipFramelayout(doorLock);
+ UndateUnlockMethodAction += (obj) =>
+ {
+ RefreshList(obj);
+ };
};
btnNext.MouseUpEventHandler += handerSideLip;
btnAllMethod.MouseUpEventHandler += handerSideLip;
@@ -388,6 +404,18 @@
continue;
}
break;
+ case 13:
+ if (curDoorLockUser.UnlockType != unlockMethod)
+ {
+ continue;
+ }
+ break;
+ case 14:
+ if (curDoorLockUser.UnlockType != unlockMethod)
+ {
+ continue;
+ }
+ break;
case 15:
if (curDoorLockUser.UnlockType != unlockMethod)
{
@@ -474,7 +502,11 @@
localDoorLockObj.UserID = curDoorLockUser.UserID;
doorLock.localDoorLockUserList.Remove(curUserId);
doorLock.ReSave();
- TypeRefresh();
+ UndateUnlockMethodAction += (obj) =>
+ {
+ RefreshList(obj);
+ };
+ TypeRefresh(doorLock);
}
}
else
@@ -518,7 +550,11 @@
var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
localDoorLockObj.UserID = curDoorLockUser.UserID;
doorLock.localDoorLockUserList.Remove(curUserId);
- TypeRefresh();
+ UndateUnlockMethodAction += (obj) =>
+ {
+ RefreshList(obj);
+ };
+ TypeRefresh(doorLock);
}
}
else
@@ -588,6 +624,26 @@
btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.IcCard) + "ID" + curDoorLockUser.UserID;
}
break;
+ case 13:
+ if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
+ {
+ btnDoorlockUser.Text = curDoorLockUser.UserName;
+ }
+ else
+ {
+ btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.CalmFingerprintMark) + "ID" + +curDoorLockUser.UserID;
+ }
+ break;
+ case 14:
+ if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
+ {
+ btnDoorlockUser.Text = curDoorLockUser.UserName;
+ }
+ else
+ {
+ btnDoorlockUser.Text = Language.StringByID(R.MyInternationalizationString.FaceIDMark) + "ID" + +curDoorLockUser.UserID;
+ }
+ break;
case 15:
if (!string.IsNullOrEmpty(curDoorLockUser.UserName))
{
@@ -628,11 +684,16 @@
var localDoorLockObj = new ZigBee.Device.DoorLock.LocaDoorLockObj() { };
localDoorLockObj.UserID = curDoorLockUser.UserID;
localDoorLockObj.UnlockType = curDoorLockUser.UnlockType;
+ localDoorLockObj.PrimaryId = curDoorLockUser.PrimaryId;
localDoorLockObj.EntryTime = curDoorLockUser.EntryTime;
localDoorLockObj.UserName = refreshDoorLockData.UserIdRemarks;
localDoorLockObj.ConnectedAccount = curAccountObj.SubAccountDistributedMark;
doorLock.localDoorLockUserList.Add(curDoorLockUser.UserID, localDoorLockObj);
- TypeRefresh();
+ UndateUnlockMethodAction += (obj1) =>
+ {
+ RefreshList(obj1);
+ };
+ TypeRefresh(doorLock);
}
}
else
@@ -649,153 +710,6 @@
#endregion
i++;
}
- }
- }
-
- /// <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;
- doorLock.ReSave();
- 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();
}
}
--
Gitblit v1.8.0