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/DoorLockCommonInfo.cs | 2
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs | 63 +---
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 75 +++++-
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs | 97 +++++++
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs | 89 ++++++
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs | 105 +++++---
ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml | 38 +-
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 62 ++++-
ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide | 0
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs | 159 +++++++------
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs | 18 +
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs | 9
12 files changed, 498 insertions(+), 219 deletions(-)
diff --git a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
index 8d8ad9d..9e33756 100644
--- a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
+++ b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
@@ -1,29 +1,27 @@
锘�<Properties StartupConfiguration="{28EDE1FF-20EF-476B-8AF8-24A3EEB69F45}|Default">
<MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.5c86e4357d63" />
- <MonoDevelop.Ide.ItemProperties.GateWay.Ios PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.B2DE3886-169F-4A06-8F62-51254112D190" />
+ <MonoDevelop.Ide.ItemProperties.GateWay.Ios PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.39ab2514bebabc070f31fc17888b031af9b437ba" />
<MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.M7BBB18B19152766" />
- <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/ZigBee/Device/ZbGateway.cs">
- <Files>
- <File FileName="Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs" Line="189" Column="41" />
- <File FileName="Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs" Line="64" Column="10" />
- <File FileName="Shared/Phone/UserCenter/DoorLock/UnLockMethod.cs" Line="69" Column="24" />
- <File FileName="Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs" Line="169" Column="42" />
- <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1466" Column="1" />
- <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1468" Column="26" />
- <File FileName="Shared/Phone/ZigBee/Device/ZbGateway.cs" Line="3347" Column="16" />
- </Files>
+ <MonoDevelop.Ide.Workbench>
<Pads>
<Pad Id="ProjectPad">
<State name="__root__">
<Node name="GateWay" expanded="True">
+ <Node name="GateWay.Droid" expanded="True">
+ <Node name="Assets" expanded="True" />
+ </Node>
<Node name="Shared" expanded="True">
<Node name="Phone" expanded="True">
- <Node name="Device" expanded="True" />
- <Node name="UserCenter" expanded="True" />
- <Node name="ZigBee" expanded="True">
- <Node name="Device" expanded="True">
- <Node name="ZbGateway.cs" selected="True" />
+ <Node name="Device" expanded="True">
+ <Node name="Light" expanded="True" />
+ </Node>
+ <Node name="UserCenter" expanded="True">
+ <Node name="DoorLock" expanded="True">
+ <Node name="UndistributeDoorlockUserPage.cs" selected="True" />
</Node>
+ </Node>
+ <Node name="ZigBee" expanded="True">
+ <Node name="Device" expanded="True" />
</Node>
</Node>
</Node>
@@ -38,13 +36,9 @@
</Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
- <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhoneSimulator" />
+ <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
- <BreakpointStore>
- <Breakpoint file="/Users/hdl/Desktop/git/HomeApp20191118/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs" relfile="Shared/Phone/ZigBee/Device/ZbGateway.cs" line="3352" column="1" />
- <Breakpoint file="/Users/hdl/Desktop/git/HomeApp20191118/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs" relfile="Shared/Phone/ZigBee/Device/ZbGateway.cs" line="3350" column="1" />
- <Breakpoint file="/Users/hdl/Desktop/git/HomeApp20191118/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs" relfile="Shared/Phone/ZigBee/Device/ZbGateway.cs" line="3292" column="1" />
- </BreakpointStore>
+ <BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MultiItemStartupConfigurations />
</Properties>
\ No newline at end of file
diff --git a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
index e1e206c..3658b3c 100644
--- a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
+++ b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
Binary files differ
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
index 2d57e62..e1c92a4 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs
@@ -115,7 +115,6 @@
{
return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<Dictionary<int, LocaDoorLockObj>>>)(async () =>
{
- doorLock.localDoorLockUserList.Clear();
//1銆佽鍙栭棬閿佷俊鎭�
var getDoorLockInfo = await doorLock.GetDoorlockUserInfoAsync();
@@ -134,6 +133,7 @@
// 鐢ㄦ埛淇℃伅澶勭悊
if (getDoorLockInfo != null && getDoorLockInfo.doorLockUserDetailData != null)
{
+ doorLock.localDoorLockUserList.Clear();
var dataList = getDoorLockInfo.doorLockUserDetailData.UserObjList;
foreach (var doorData in dataList)
{
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
index 407d640..0e5251a 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs
@@ -411,7 +411,7 @@
/// <param name="action">浜屾楠岃瘉鐨勭粨鏋滄垚鍔熷悗鐨勯�氱煡</param>
/// <param name="progressButton">闂ㄩ攣寮�鎴栧叧鏃惰繘搴︽樉绀�</param>
/// <param name="btnDoorLockPic">闂ㄩ攣鍥剧墖寮�/鍏虫樉绀�</param>
- public void RemoteUnlockRequest(ZigBee.Device.DoorLock doorLock, Action action, Button progressButton = null, Button btnDoorLockPic = null, Button btnStatus = null)
+ public void RemoteUnlockRequest(ZigBee.Device.DoorLock doorLock, Action action, Button progressButton = null, Button btnDoorLockPic = null, Button btnStatus = null, Button btnDoorLockTitle = null)
{
if (doorLock.RemoteUnlockPassword == "")
{
@@ -434,18 +434,41 @@
{
if (UserCenterResourse.UserInfo.AuthorityNo == 1)
{
- var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
+ var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
+ functionSetting.Show();
+ functionSetting.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ if (btnDoorLockTitle != null)
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ }
+ }
+ };
dialog.Close();
}
else
{
- var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
+ var functionSettingSub = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSettingSub);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
+ functionSettingSub.Show();
+ functionSettingSub.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ if (btnDoorLockTitle != null)
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ }
+ }
+ }
+ };
dialog.Close();
}
};
@@ -631,18 +654,40 @@
if (UserCenterResourse.UserInfo.AuthorityNo == 1)
{
- var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
+ var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
-
+ functionSetting.Show();
+ functionSetting.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ if (btnDoorLockTitle != null)
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ }
+ }
+ };
}
else
{
- var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
+ var functionSettingSub = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSettingSub);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
+ functionSettingSub.Show();
+ functionSettingSub.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ if (btnDoorLockTitle != null)
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ }
+ }
+ }
+ };
}
}
}
@@ -684,5 +729,7 @@
dialog3.Close();
};
}
+ // 鑾峰彇鍒板埌鍚嶇О鏇存敼鍥炶皟閫氱煡
+ public Action<string> devicNameSecAction;
}
}
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
index c29c406..a25457b 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -39,6 +39,7 @@
Action action;
string modifyDeviceName = "";
bool IsModifyName = true;
+ public Action<string> devicNameAction;
#endregion
/// <summary>
@@ -165,47 +166,49 @@
btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58);
btnNextFrameLayout.X = Application.GetRealWidth(233);
btnNext.Text = doorLock.DeviceName;
- var btnDeviceNameEditText = new Button()
+ var btnDeviceNameEditText = new EditText()
{
- Width = Application.GetRealWidth(789 - 58),
- Height = Application.GetRealHeight(58),
X = Application.GetRealWidth(46),
+ Width = Application.GetRealWidth(731),
+ Height = Application.GetRealHeight(58),
+ TextColor = ZigbeeColor.Current.XMGray3,
+ PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
- Text = doorLock.DeviceName
+ Text = string.IsNullOrEmpty(doorLock.DeviceName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : doorLock.DeviceName,
};
btnNextFrameLayout.AddChidren(btnDeviceNameEditText);
- //btnDeviceNameEditText.TextChangeEventHandler += (sender, e) =>
- //{
- // modifyDeviceName = btnDeviceNameEditText.Text;
- //};
- //Action<Shared.View> actionEdit = async (obj) =>
- // {
- // try
- // {
- // Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
- // var doorLockDeviceList = new List<CommonDevice> { };
- // doorLockDeviceList.Add(doorLock);
- // var result = await Common.LocalDevice.Current.ReMacName(doorLockDeviceList, btnDeviceNameEditText.Text);
- // if (result)
- // {
- // IsModifyName = false;
- // }
- // else
- // {
- // IsModifyName = true;
- // }
- // }
- // catch { }
- // finally
- // {
- // Application.RunOnMainThread(() =>
- // {
- // CommonPage.Loading.Hide();
- // });
- // }
- // };
- // btnDeviceNameEditText.EditorEnterAction += actionEdit;
+
+ btnDeviceNameEditText.TextChangeEventHandler += (sender, e) =>
+ {
+ modifyDeviceName = btnDeviceNameEditText.Text;
+ };
+ Action<Shared.View> actionEdit = async (obj) =>
+ {
+ try
+ {
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
+ var doorLockDeviceList = new List<CommonDevice> { };
+ doorLockDeviceList.Add(doorLock);
+ var result = await Common.LocalDevice.Current.ReMacName(doorLockDeviceList, btnDeviceNameEditText.Text);
+ if (result)
+ {
+ IsModifyName = false;
+ }
+ else
+ {
+ IsModifyName = true;
+ }
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Hide();
+ });
+ }
+ };
+ btnDeviceNameEditText.EditorEnterAction += actionEdit;
btnLine.Visible = true;
btnLine.Y = Application.GetRealHeight(303);
@@ -379,43 +382,53 @@
}
//淇濆瓨
- //var btnFinifh = new Button()
- //{
- // Width = Application.GetRealWidth(907),
- // Height = Application.GetRealHeight(127),
- // Y = Application.GetRealHeight(1472),
- // Gravity = Gravity.CenterHorizontal,
- // Radius = (uint)Application.GetRealHeight(127) / 2,
- // TextID = R.MyInternationalizationString.Save,
- // BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
- // TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
- // TextSize = 16,
- //};
- //this.midFrameLayout.AddChidren(btnFinifh);
- //btnFinish.MouseUpEventHandler += (sender, e) =>
- //{
- // System.Threading.Tasks.Task.Run(async () =>
- // {
- // Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
- // try
- // {
- // if (IsModifyName)
- // {
- // var doorLockDeviceList = new List<CommonDevice> { };
- // doorLockDeviceList.Add(doorLock);
- // await Common.LocalDevice.Current.ReMacName(doorLockDeviceList, modifyDeviceName);
- // }
- // }
- // catch { }
- // finally
- // {
- // Application.RunOnMainThread(() =>
- // {
- // CommonPage.Loading.Hide();
- // });
- // }
- // });
- //};
+ var btnFinifh = new Button()
+ {
+ Width = Application.GetRealWidth(907),
+ Height = Application.GetRealHeight(127),
+ Y = Application.GetRealHeight(1472),
+ Gravity = Gravity.CenterHorizontal,
+ Radius = (uint)Application.GetRealHeight(127) / 2,
+ TextID = R.MyInternationalizationString.Save,
+ BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
+ TextSize = 16,
+ };
+ this.midFrameLayout.AddChidren(btnFinifh);
+ btnFinifh.MouseUpEventHandler += (sender, e) =>
+ {
+ System.Threading.Tasks.Task.Run(async () =>
+ {
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
+ try
+ {
+ if (IsModifyName)
+ {
+ var doorLockDeviceList = new List<CommonDevice> { };
+ doorLockDeviceList.Add(doorLock);
+ var result = await Common.LocalDevice.Current.ReMacName(doorLockDeviceList, modifyDeviceName);
+ if (result)
+ {
+ if (devicNameAction != null)
+ {
+ devicNameAction(modifyDeviceName);
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ var mess = ex.Message;
+ }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Hide();
+ });
+ }
+ });
+ };
}
#region 鈼� 鎺ュ彛瀹炵幇__________________________
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs
old mode 100755
new mode 100644
index 39efc60..03a5d1a
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSettingSub.cs
@@ -20,6 +20,9 @@
#region 鈼� 鍙橀噺鐢虫槑__________________________
ZigBee.Device.DoorLock doorLock;
+ public Action<string> devicNameAction;
+ bool IsModifyName = true;
+ string modifyDeviceName = "";
#endregion
/// <summary>
@@ -142,12 +145,54 @@
if (i == 0)
{
bottomRowLayout.Y = Application.GetRealHeight(220);
- btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm) + ":";
+ btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm);
btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58);
btnNextFrameLayout.X = Application.GetRealWidth(233);
- btnNext.TextAlignment = TextAlignment.CenterLeft;
- btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
btnNext.Text = doorLock.DeviceName;
+ var btnDeviceNameEditText = new EditText()
+ {
+ X = Application.GetRealWidth(46),
+ Width = Application.GetRealWidth(731),
+ Height = Application.GetRealHeight(58),
+ TextColor = ZigbeeColor.Current.XMGray3,
+ PlaceholderTextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor2,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = string.IsNullOrEmpty(doorLock.DeviceName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : doorLock.DeviceName,
+ };
+ btnNextFrameLayout.AddChidren(btnDeviceNameEditText);
+
+ btnDeviceNameEditText.TextChangeEventHandler += (sender, e) =>
+ {
+ modifyDeviceName = btnDeviceNameEditText.Text;
+ };
+ Action<Shared.View> actionEdit = async (obj) =>
+ {
+ try
+ {
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
+ var doorLockDeviceList = new List<CommonDevice> { };
+ doorLockDeviceList.Add(doorLock);
+ var result = await Common.LocalDevice.Current.ReMacName(doorLockDeviceList, btnDeviceNameEditText.Text);
+ if (result)
+ {
+ IsModifyName = false;
+ }
+ else
+ {
+ IsModifyName = true;
+ }
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Hide();
+ });
+ }
+ };
+ btnDeviceNameEditText.EditorEnterAction += actionEdit;
+
btnLine.Visible = true;
btnLine.Y = Application.GetRealHeight(303);
}
@@ -248,6 +293,52 @@
btnNextFrameLayout.MouseDownEventHandler += eHandler;
#endregion
}
+
+ //淇濆瓨
+ var btnFinifh = new Button()
+ {
+ Width = Application.GetRealWidth(907),
+ Height = Application.GetRealHeight(127),
+ Y = Application.GetRealHeight(1472),
+ Gravity = Gravity.CenterHorizontal,
+ Radius = (uint)Application.GetRealHeight(127) / 2,
+ TextID = R.MyInternationalizationString.Save,
+ BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
+ TextSize = 16,
+ };
+ this.midFrameLayout.AddChidren(btnFinifh);
+ btnFinifh.MouseUpEventHandler += (sender, e) =>
+ {
+ System.Threading.Tasks.Task.Run(async () =>
+ {
+ Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
+ try
+ {
+ if (IsModifyName)
+ {
+ var doorLockDeviceList = new List<CommonDevice> { };
+ doorLockDeviceList.Add(doorLock);
+ var result = await Common.LocalDevice.Current.ReMacName(doorLockDeviceList, modifyDeviceName);
+ if (result)
+ {
+ if (devicNameAction != null)
+ {
+ devicNameAction(modifyDeviceName);
+ }
+ }
+ }
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Hide();
+ });
+ }
+ });
+ };
}
#region 鈼� 鎺ュ彛瀹炵幇__________________________
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
old mode 100755
new mode 100644
index 22e94a7..0987e21
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs
@@ -428,6 +428,15 @@
{
if (curIndex == 0)
{
+ if (string.IsNullOrEmpty(doorLock.LocalTempPassword))
+ {
+ //璇�"鐐瑰嚮鐢熸垚"涓存椂瀵嗙爜锛�
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip1), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ });
+ return;
+ }
var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "ValidTime");
Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
@@ -439,6 +448,15 @@
}
if (curIndex == 1)
{
+ if (string.IsNullOrEmpty(doorLock.LocalTempPassword))
+ {
+ //璇�"鐐瑰嚮鐢熸垚"涓存椂瀵嗙爜锛�
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.SetTempPasswordTip1), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ });
+ return;
+ }
var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "InValidTime");
Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
old mode 100755
new mode 100644
index 496c79a..745b8ef
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
@@ -29,6 +29,7 @@
CurentDoorLockTime = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocalTime(dataReport.AttriButeData);
Application.RunOnMainThread(() =>
{
+ waitGetDoorLockTime = DateTime.MaxValue;
textDisplayDate.Text = CurentDoorLockTime.Year + Language.StringByID(R.MyInternationalizationString.Year) + CurentDoorLockTime.Month + Language.StringByID(R.MyInternationalizationString.Month) + CurentDoorLockTime.Day + Language.StringByID(R.MyInternationalizationString.Day);
if (CurentDoorLockTime.Minute < 10)
{
@@ -38,6 +39,7 @@
{
textDisplayTime.Text = CurentDoorLockTime.Hour + ":" + CurentDoorLockTime.Minute;
}
+ CommonPage.Loading.Hide();
});
}
}
@@ -71,6 +73,7 @@
int curMin = 0;
int curSec = 0;
public Action timeSetAction;
+ DateTime waitGetDoorLockTime = DateTime.MaxValue;
#endregion
/// <summary>
@@ -114,12 +117,23 @@
{
if (setTimeType == "DoorLockTime")
{
+ CommonPage.Loading.Start("");
// 鍙湁閲嶆柊鍚姩鏃朵細鎱紝鐒跺悗鍏朵粬鏃跺埢閮芥槸鏈夊�肩殑
new System.Threading.Thread(() =>
{
while (this.Parent != null)
{
+ if (DateTime.Now > waitGetDoorLockTime)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance);
+ CommonPage.Loading.Hide();
+ });
+ }
//璇婚棬閿佹椂闂�
+ //绛夊緟10绉掞紝娌℃湁鏀跺埌鎻愮ず瓒呮椂閫�鍑�
+ waitGetDoorLockTime = DateTime.Now.AddSeconds(+5);
doorLock.ReadAttri(ZigBee.Device.Cluster_ID.DoorLock, ZigBee.Device.AttriButeId.DoorLock);
System.Threading.Thread.Sleep(5 * 1000);
}
@@ -187,11 +201,6 @@
};
MidTopFrameLayout.AddChidren(btnLine);
- if (setTimeType != "DoorLockTime")
- {
- textDisplayDateFrameLayout.Width = 0;
- }
-
if (i == 0)
{
btnDateTime.Y = textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = Application.GetRealHeight(50);
@@ -205,11 +214,30 @@
Text = "_" + Language.StringByID(R.MyInternationalizationString.Year) + "_" + Language.StringByID(R.MyInternationalizationString.Month) + "_" + Language.StringByID(R.MyInternationalizationString.Day),
};
textDisplayDateFrameLayout.AddChidren(textDisplayDate);
- //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y;
if (setTimeType != "DoorLockTime")
{
btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.Date);
+ if (setTimeType == "ValidTime")
+ {
+ //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth == 0)
+ //{
+ // var cur = DateTime.Now;
+ // Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth = cur.Month;
+ // Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay = cur.Day;
+ //}
+ textDisplayDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateDay + Language.StringByID(R.MyInternationalizationString.Day);
+ }
+ else if (setTimeType == "InValidTime")
+ {
+ //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth == 0)
+ //{
+ // var cur = DateTime.Now;
+ // Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth = cur.Month;
+ // Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateDay = cur.Day;
+ //}
+ textDisplayDate.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMonth + Language.StringByID(R.MyInternationalizationString.Month) + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateDay + Language.StringByID(R.MyInternationalizationString.Day);
+ }
}
else
{
@@ -229,11 +257,44 @@
Text = "00:00",
};
textDisplayDateFrameLayout.AddChidren(textDisplayTime);
- //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y;
if (setTimeType != "DoorLockTime")
{
btnDateTime.Text = Language.StringByID(R.MyInternationalizationString.Time);
+ if (setTimeType == "ValidTime")
+ {
+ //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour == 100)
+ //{
+ // var cur = DateTime.Now;
+ // Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour = cur.Hour;
+ // Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute = cur.Minute;
+ //}
+ if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute < 10)
+ {
+ textDisplayTime.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour + ":" + "0" + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute;
+ }
+ else
+ {
+ textDisplayTime.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateHour + ":" + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.ValidDateMinute;
+ }
+ }
+ else if (setTimeType == "InValidTime")
+ {
+ //if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour == 100)
+ //{
+ // var cur = DateTime.Now;
+ // Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour = cur.Hour;
+ // Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute = cur.Minute;
+ //}
+ if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute < 10)
+ {
+ textDisplayTime.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour + ":" + "0" + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute;
+ }
+ else
+ {
+ textDisplayTime.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateHour + ":" + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InValidDateMinute;
+ }
+ }
}
else
{
@@ -336,6 +397,7 @@
timeSetAction();
}
this.shadowRadiusFrameLayout.RemoveFromParent();
+ MidFrameLayoutContent();
};
}
else
@@ -508,6 +570,7 @@
timeSetAction();
}
this.shadowRadiusFrameLayout.RemoveFromParent();
+ MidFrameLayoutContent();
};
}
}
@@ -562,10 +625,14 @@
this.shadowRadiusFrameLayout.RemoveFromParent();
};
- //绛夊緟浠庨棬閿佷笂闈㈠姞杞藉嚭鐨勬椂闂�
- //System.Threading.Thread.Sleep(1500);
- //CommonPage.Loading.Hide();
-
+ if (setTimeType == "DoorLockTime")
+ {
+ if (CurentDoorLockTime != null && CurentDoorLockTime.Year != 1)
+ {
+ waitGetDoorLockTime = DateTime.MaxValue;
+ CommonPage.Loading.Hide();
+ }
+ }
}
#region 鈼� 鎺ュ彛瀹炵幇__________________________
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>
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
index 5ea8018..a0f8318 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UndistributeDoorlockUserPage.cs
@@ -49,7 +49,7 @@
{
Application.RunOnMainThread(() =>
{
- RefreshList();
+ TypeRefresh();
CommonPage.Loading.Hide();
});
}
@@ -580,27 +580,7 @@
var d = uList.Find((value) => { return value == curDoorLockUser.UserID; });
if (d != null)
{
- // 绫诲瀷鍖哄垎
- if (doorLock.currentUserDisplayMethod == Language.StringByID(R.MyInternationalizationString.AllMethod))
- {
- RefreshList();
- }
- else 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 if (doorLock.currentUserDisplayMethod == "")
- {
- RefreshList();
- }
+ TypeRefresh();
flMain.RemoveFromParent();
bottomFrameLayout.RemoveAll();
}
@@ -705,24 +685,7 @@
doorLock.currentUserDisplayMethod = btnMethodText.Text;
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();
};
@@ -792,6 +755,26 @@
}
}
+ //绫诲瀷鍖哄垎
+ 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();
+ }
+ }
#region 鈼� 鎺ュ彛瀹炵幇__________________________
/// <summary>
/// 澶勭悊鍙樺寲浜嬩欢 --灏嗗純鐢� 鏀圭敤DeviceInfoChange()
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
index f6f6f0b..c5a27c8 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -22,6 +22,7 @@
Shared.Common.Room currentRoom;
DeviceUI deviceUI;
Action action;
+ Button btnDoorLockTitle;
#endregion
/// <summary>
@@ -29,7 +30,7 @@
/// </summary>
public void Show()
{
- this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.DoorLock));
+ this.TopFrameLayout(this, "");
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
{
@@ -37,8 +38,8 @@
};
this.btnBack.MouseUpEventHandler += eHandlerBack;
this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
- this.MidFrameLayout(this);
+ this.MidFrameLayout(this);
var btnShare = new Button
{
X = Application.GetRealWidth(850 - 116),
@@ -67,17 +68,34 @@
{
if (UserCenterResourse.UserInfo.AuthorityNo == 1)
{
- var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
+ var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
+ functionSetting.Show();
+ functionSetting.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ //鏀规埧闂�
+ Shared.Common.Room.CurrentRoom.ChangedRoom(deviceUI.CommonDevice, currentRoom.Id);
+ deviceUI.CommonDevice.ReSave();
+ }
+ };
}
else
{
- var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
- Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
+ var functionSettingSub = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
+ Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSettingSub);
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
- userDoorLockPage.Show();
+ functionSettingSub.Show();
+ functionSettingSub.devicNameAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ }
+ };
}
};
@@ -102,14 +120,14 @@
};
this.midFrameLayout.AddChidren(midTopFrameLayout);
- var btnDoorLockTitle = new Button()
+ btnDoorLockTitle = new Button()
{
Width = Application.GetRealWidth(250),
Height = Application.GetRealHeight(60),
X = Application.GetRealWidth(372),
Y = Application.GetRealHeight(46),
TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
- Text = Language.StringByID(R.MyInternationalizationString.SmartDoorLock),
+ Text = string.IsNullOrEmpty(doorLock.DeviceName) ? Language.StringByID(R.MyInternationalizationString.UNKnown) : doorLock.DeviceName,
TextSize = 15,
TextAlignment = TextAlignment.Center,
};
@@ -311,7 +329,17 @@
var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid);
if (result1 == true)
{
- RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus);
+ RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus, btnDoorLockTitle);
+ devicNameSecAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ //鏀规埧闂�
+ Shared.Common.Room.CurrentRoom.ChangedRoom(deviceUI.CommonDevice, currentRoom.Id);
+ deviceUI.CommonDevice.ReSave();
+ }
+ };
}
else
{
@@ -325,7 +353,17 @@
}
else
{
- RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus);
+ RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus, btnDoorLockTitle);
+ devicNameSecAction += (deviceRename) =>
+ {
+ if (!string.IsNullOrEmpty(deviceRename))
+ {
+ btnDoorLockTitle.Text = deviceRename;
+ //鏀规埧闂�
+ Shared.Common.Room.CurrentRoom.ChangedRoom(deviceUI.CommonDevice, currentRoom.Id);
+ deviceUI.CommonDevice.ReSave();
+ }
+ };
}
};
openFrameLayout.MouseUpEventHandler += hander1;
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
index cbf0a66..0e978d9 100644
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserManagement.cs
@@ -34,6 +34,9 @@
VerticalRefreshLayout midVerticalScrolViewLayout;
#endregion
+ /// <summary>
+ /// 鏁版嵁鍒锋柊
+ /// </summary>
void ReadAccountDoorLockInfoList()
{
System.Threading.Tasks.Task.Run(async () =>
@@ -88,6 +91,9 @@
});
}
+ /// <summary>
+ /// 鏄剧ず鐣岄潰
+ /// </summary>
public void Show()
{
this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.UserManagement));
@@ -155,6 +161,9 @@
ReadAccountDoorLockInfoList();
}
+ /// <summary>
+ /// 涓儴甯冨眬鏄剧ず
+ /// </summary>
async void MidFrameLayoutContent()
{
midVerticalScrolViewLayout.RemoveAll();
--
Gitblit v1.8.0