From fa6bcb2e9907772480f99205f36ec2a1ce735a22 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 09 一月 2020 14:11:07 +0800
Subject: [PATCH] 合并代码
---
ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs | 90 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 68 insertions(+), 22 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
index edb61d2..a962515 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,37 @@
};
#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();
+ }
+ /// <summary>
+ /// 璇诲彇褰撳墠闂ㄩ攣鐨勪簯绔暟鎹紱
+ /// </summary>
+ public void Read()
+ {
bool d = false;
string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
@@ -94,22 +119,36 @@
}
}
+
CommonPage.Loading.Start();
- if (!d)
- {
- var allMemberslist = await Send.AllMembers(common.DeviceAddr);
- Send.LockList.AddRange(allMemberslist);
- }
- UserList(macport, common, editdeviceConditionsInfo);
- CommonPage.Loading.Hide();
+ middle.RemoveAll();
+ System.Threading.Tasks.Task.Run(async () =>
+ {
+ try
+ {
+ if (!d)
+ {
+ var allMemberslist = await Send.AllMembers(macport);
+ Send.LockList.AddRange(allMemberslist);
+ }
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ 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)
{
-
foreach (var user in Send.LockList)
{
if (user.DoorLockMacPort != macport)
@@ -156,7 +195,7 @@
EventHandler<MouseEventArgs> useridclick = (sender, e) =>
{
- User(user, common, editdeviceConditionsInfo);
+ User(user);
};
userBtn.MouseUpEventHandler += useridclick;
@@ -167,12 +206,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);
@@ -257,6 +296,13 @@
string SelectedDeviceStatuscondition = "";
lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * user.UserIdMode.Count) - 20 - 50);
lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * user.UserIdMode.Count) + 20 + 50);
+ if (user.UserIdMode.Count > 9)
+ {
+ ///鍏冪礌瓒呭嚭10涓紝鏆傛椂榛樿鏄剧ず10;
+ lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * 9) - 20 - 50);
+ lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * 9) + 20 + 50);
+ }
+
for (int i = 0; i < user.UserIdMode.Count; i++)
{
var userifon = user.UserIdMode[i];
@@ -404,9 +450,9 @@
{
if (!edit)
{
- var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
- Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
- Language.StringByID(MyInternationalizationString.complete));
+ var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+ Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
+ Language.StringByID(MyInternationalizationString.confrim));
alert.Show();
return;
}
--
Gitblit v1.8.0