From 23fb45dd846ed8b62304c408c6bbe64265d4ac8b Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 20 十二月 2019 18:57:16 +0800
Subject: [PATCH] 代码合并
---
ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs | 64 ++++++++++++++++++++++++-------
1 files changed, 49 insertions(+), 15 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
index edb61d2..312084c 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
@@ -15,12 +15,13 @@
}
Button selectedIcon = new Button();
public static bool edit = false;
- VerticalScrolViewLayout middle;
-
- public async void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo = null)
+ VerticalRefreshLayout middle;
+ CommonDevice common;
+ Dictionary<string, string> editdeviceConditionsInfo;
+ public void Show(CommonDevice commondevice, Dictionary<string, string> editdeviceConditions = null)
{
-
-
+ common = commondevice;
+ editdeviceConditionsInfo = editdeviceConditions;
UserView.HomePage.Instance.ScrollEnabled = false;
this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
#region 鏈�涓婇潰鐨勫竷灞�浠g爜
@@ -42,6 +43,7 @@
Height = Application.GetRealHeight(69),
Y = Application.GetRealHeight(92),
TextID = MyInternationalizationString.userlist,
+ IsBold = true,
};
topRowLayout.AddChidren(titleName);
@@ -73,14 +75,48 @@
};
#endregion
- middle = new VerticalScrolViewLayout
+ middle = new VerticalRefreshLayout
{
Y = topRowLayout.Bottom,
Height = Application.GetRealHeight(1920 - 184),
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
this.AddChidren(middle);
+ middle.BeginHeaderRefreshingAction += () =>
+ {
+ //閲嶆柊鍒锋柊logic鍒楄〃
+ string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
+ for (int i = 0; i < Send.LockList.Count; i++)
+ {
+ if (Send.LockList[i].DoorLockMacPort == macport)
+ {
+ ///浠庡垪琛ㄧЩ闄ゅ綋鍓嶉棬閿佸叏閮ㄧ殑鏃ф暟鎹紱
+ Send.LockList.Remove(Send.LockList[i]);
+ i--;
+ }
+ }
+ Read();
+ //鍏抽棴鍒锋柊View锛�
+ middle.EndHeaderRefreshing();
+ };
+ //Read();
+ CommonPage.Loading.Start();
+ new System.Threading.Thread(() =>
+ {
+ Application.RunOnMainThread(() =>
+ {
+ Read();
+ CommonPage.Loading.Hide();
+ });
+ })
+ { IsBackground = true }.Start();
+ }
+ /// <summary>
+ /// 璇诲彇褰撳墠闂ㄩ攣鐨勪簯绔暟鎹紱
+ /// </summary>
+ public async void Read()
+ {
bool d = false;
string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
@@ -94,22 +130,20 @@
}
}
- CommonPage.Loading.Start();
if (!d)
{
- var allMemberslist = await Send.AllMembers(common.DeviceAddr);
+ var allMemberslist = await Send.AllMembers(macport);
Send.LockList.AddRange(allMemberslist);
}
- UserList(macport, common, editdeviceConditionsInfo);
- CommonPage.Loading.Hide();
+ UserList(macport);
}
/// <summary>
/// 鎴愬憳鍒楄〃鐨勬柟娉�
/// </summary>
/// <param name="macport"></param>
- void UserList(string macport, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo)
+ public void UserList(string macport)
{
-
+ middle.RemoveAll();
foreach (var user in Send.LockList)
{
if (user.DoorLockMacPort != macport)
@@ -156,7 +190,7 @@
EventHandler<MouseEventArgs> useridclick = (sender, e) =>
{
- User(user, common, editdeviceConditionsInfo);
+ User(user);
};
userBtn.MouseUpEventHandler += useridclick;
@@ -167,12 +201,12 @@
}
- }
+ }
/// <summary>
/// 褰撳墠鎴愬憳淇℃伅鐨勬柟娉�
/// </summary>
/// <param name="user"></param>
- void User(Send.MembershipIfon user, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo)
+ public void User(Send.MembershipIfon user)
{
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
this.AddChidren(flMain);
--
Gitblit v1.8.0