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/UserDoorLockPage.cs | 245 ++++++++++++++++++++++--------------------------
1 files changed, 112 insertions(+), 133 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
index 0562afe..67009a0 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -25,14 +25,9 @@
ZbGateway.StatusList.Add(this);
Application.RunOnMainThread(() =>
{
- ControlCommonResourse.UpdateDoorLockStatusAction = (obj) =>
- {
- UpdateNomallyOpenStatus();
- };
-
UserCenter.DoorLock.DoorLockCommonInfo.UpdateCurrentDoorlockAction += (DoorlockKey, status) =>
{
- var key = doorLock.DeviceAddr + doorLock.DeviceEpoint;
+ var key = doorLock.DeviceAddr;
if (DoorlockKey == key)
{
DoorLockCommonInfo.NormallyOpenModeValue(this.doorLock, status);
@@ -56,9 +51,9 @@
/// </summary>
DateTime waitGetDoorLockPower = DateTime.MaxValue;
/// <summary>
- /// 閫昏緫涓槸鍚︽湁甯稿紑妯″紡
+ /// 閫昏緫涓槸鍚︽湁甯稿紑妯″紡
/// </summary>
- private bool haveLogicNormallyOpenMode = false;
+ private bool haveLogicNormallyOpenMode = false;
/// <summary>
/// 褰撳墠鐢甸噺
@@ -199,11 +194,11 @@
bool IsClick = true;
#endregion
- /// <summary>
- /// UI鏄剧ず
+ /// <summary>
+ /// UI鏄剧ず
/// </summary>
public void Show()
- {
+ {
this.TopFrameLayout(this, "");
this.MidFrameLayout(this);
@@ -226,8 +221,8 @@
btnFuncSet = new Button
{
X = Application.GetRealWidth(103),
- Height = Application.GetMinReal(69),
- Width = Application.GetMinReal(69),
+ Height = Application.GetMinRealAverage(69),
+ Width = Application.GetMinRealAverage(69),
UnSelectedImagePath = "DoorLock/SettingIcon.png",
};
btnFuncSetFrameLayout.AddChidren(btnFuncSet);
@@ -260,7 +255,7 @@
Height = Application.GetRealHeight(1238),
Width = Application.GetRealWidth(965),
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
- Radius = 6,
+ Radius = (uint)Application.GetRealHeight(17),
};
this.midFrameLayout.AddChidren(midTopFrameLayout);
@@ -271,6 +266,8 @@
btnDoorLockTitle.IsBold = true;
btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
btnDoorLockTitle.Width = btnDoorLockTitle.GetRealWidthByText();
+ btnDoorLockTitle.Width = Application.GetRealWidth(500);
+
btnDoorLockTitle.TextAlignment = TextAlignment.Center;
btnDoorLockTitle.Gravity = Gravity.CenterHorizontal;
midTopFrameLayout.AddChidren(btnDoorLockTitle);
@@ -285,8 +282,8 @@
midTopFrameLayout.AddChidren(btnRecordFrameLayout);
btnRecord = new Button()
{
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
+ Width = Application.GetMinRealAverage(69),
+ Height = Application.GetMinRealAverage(69),
X = Application.GetRealWidth(46),
Y = Application.GetRealHeight(46),
UnSelectedImagePath = "DoorLock/RecordIcon.png",
@@ -303,16 +300,16 @@
midTopFrameLayout.AddChidren(btnCollectFrameLayout);
btnCollect = new Button()
{
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
+ Width = Application.GetMinRealAverage(69),
+ Height = Application.GetMinRealAverage(69),
X = Application.GetRealWidth(15),
Y = Application.GetRealHeight(46),
UnSelectedImagePath = "Item/Collection.png",
SelectedImagePath = "Item/CollectionSelected.png"
};
- btnCollectFrameLayout.AddChidren(btnCollect);
-
- //褰撳墠鐘舵��
+ btnCollectFrameLayout.AddChidren(btnCollect);
+
+ //褰撳墠鐘舵��
btnStatus = new Button()
{
Width = Application.GetRealWidth(132 + 351),
@@ -337,16 +334,16 @@
TextSize = 10,
TextAlignment = TextAlignment.CenterLeft,
};
- midTopFrameLayout.AddChidren(btnCurrentPowerText);
-#if Android
- btnCurrentPowerText.X = btnStatus.Right + Application.GetRealWidth(20);
+ midTopFrameLayout.AddChidren(btnCurrentPowerText);
+#if Android
+ btnCurrentPowerText.X = btnStatus.Right + Application.GetRealWidth(20);
#endif
//闂ㄩ攣寮�/鍏冲浘鐗�
btnDoorLockPic = new Button()
{
- Width = Application.GetMinReal(383),
- Height = Application.GetMinReal(343),
+ Width = Application.GetMinRealAverage(383),
+ Height = Application.GetMinRealAverage(343),
X = Application.GetRealWidth(161),
Y = Application.GetRealHeight(415),
UnSelectedImagePath = "DoorLock/DoorLockPicClose.png",
@@ -385,7 +382,7 @@
progressFrameLayoutMatch = new FrameLayout()
{
Width = Application.GetRealHeight(84),//639-35
- Height = Application.GetRealHeight(446),
+ Height = Application.GetRealHeight(446 + 30),
X = Application.GetMinReal(51),
BackgroundColor = ZigbeeColor.Current.XMWhite,
};
@@ -393,7 +390,9 @@
var progressFrameLayout = new FrameLayout()
{
- Width = Application.GetRealHeight(17),//639-35
+ Width = Application.GetRealHeight(15),//639-35
+ Height = Application.GetRealHeight(440),
+ Radius = (uint)Application.GetRealHeight(17),
Gravity = Gravity.CenterHorizontal,
BackgroundColor = ZigbeeColor.Current.XMVerticalSeekBar,
};
@@ -401,8 +400,8 @@
progressButton = new Button()
{
- Width = Application.GetMinReal(84),//639-35
- Height = Application.GetMinReal(93),
+ Width = Application.GetMinRealAverage(84),//639-35
+ Height = Application.GetMinRealAverage(93),
Gravity = Gravity.CenterHorizontal,
Y = Application.GetRealHeight(347),
UnSelectedImagePath = "DoorLock/UnLockButton.png",
@@ -411,8 +410,8 @@
btnDoorOpenPic = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(164),
Y = Application.GetRealHeight(6),
UnSelectedImagePath = "DoorLock/DoorLockOpen.png",
@@ -421,8 +420,8 @@
btnDoorClosePic = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(164),
Y = Application.GetRealHeight(117),
UnSelectedImagePath = "DoorLock/DoorLockClose.png",
@@ -433,8 +432,8 @@
//鐢甸噺
btnPower = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(253),
Y = Application.GetRealHeight(994),
UnSelectedImagePath = "DoorLock/PowerOffline.png",
@@ -452,8 +451,8 @@
midTopFrameLayout.AddChidren(btnVolumeFrameLayout);
btnVolume = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(40),
Y = Application.GetRealHeight(40),
UnSelectedImagePath = "DoorLock/VolumeIcon.png",
@@ -464,16 +463,16 @@
//甯稿紑
btnNormallyOpenFrameLayout = new FrameLayout()
{
- Width = Application.GetRealWidth(81 + 80),
- Height = Application.GetRealHeight(81 + 80),
+ Width = Application.GetMinRealAverage(81 + 80),
+ Height = Application.GetMinRealAverage(81 + 80),
X = Application.GetRealWidth(631 - 40),
Y = Application.GetRealHeight(994 - 40),
};
midTopFrameLayout.AddChidren(btnNormallyOpenFrameLayout);
btnNormallyOpen = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(40),
Y = Application.GetRealHeight(40),
UnSelectedImagePath = "DoorLock/NormallyOpen.png",
@@ -497,7 +496,7 @@
Height = Application.GetRealHeight(138),
Y = Application.GetRealHeight(1100),
BackgroundColor = ZigbeeColor.Current.XMBlack,
- Radius = 6,
+ Radius = (uint)Application.GetRealHeight(17),
};
midTopFrameLayout.AddChidren(btnCurrentFrameLayout);
#endregion
@@ -505,8 +504,8 @@
#region 褰撳墠鎴块棿
var btnCurrentRoomPic = new Button()
{
- Width = Application.GetMinReal(81),
- Height = Application.GetMinReal(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(58),
Y = Application.GetRealHeight(29),
UnSelectedImagePath = "DoorLock/RoomPic.png",
@@ -517,7 +516,7 @@
{
Width = Application.GetRealWidth(172),
Height = Application.GetRealHeight(49),
- X = Application.GetRealWidth(150),
+ X = btnCurrentRoomPic.Right + Application.GetRealWidth(12),
Y = Application.GetRealHeight(46),
Text = currentRoom.Name,
TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
@@ -525,7 +524,7 @@
TextAlignment = TextAlignment.CenterLeft,
};
btnCurrentFrameLayout.AddChidren(btnCurrentRoomName);
- #endregion
+ #endregion
}
#region 闊抽噺寮圭獥
@@ -551,8 +550,8 @@
var progressBackground = new FrameLayout()
{
- Width = Application.GetRealWidth(271),
- Height = Application.GetRealHeight(700),
+ Width = Application.GetMinRealAverage(271),
+ Height = Application.GetMinRealAverage(700),
X = Application.GetRealWidth(403),
Y = Application.GetRealHeight(582),
BackgroundImagePath = "DoorLock/ProgressBackground.png",
@@ -571,8 +570,8 @@
diyImageVerticalSeekBar = new DiyImageVerticalSeekBar()
{
- Width = Application.GetRealWidth(271),
- Height = Application.GetRealHeight(447 + 63),
+ Width = Application.GetMinRealAverage(271),
+ Height = Application.GetMinRealAverage(447 + 63),
Y = Application.GetRealHeight(155),
IsProgressTextShow = false,//鏄剧ず鐧惧垎姣�
ProgressBarColor = ZigbeeColor.Current.XMProgressBarColor,//閫変腑杩涘害鏉¢鑹�
@@ -616,12 +615,12 @@
if (tempDoor.doorLockOperatingEventNotificationCommand != null)
{
//闈炰富浜轰笉寮硅繖涓獥鍙�
- if (UserCenterResourse.UserInfo.AuthorityNo != 1)
- {
- return;
+ if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+ {
+ return;
}
- if (doorLock.IsDoorLockNormallyMode)
- {
+ if (doorLock.IsDoorLockNormallyMode)
+ {
if (canOpenNormallyMode)
{
Application.RunOnMainThread(() =>
@@ -637,35 +636,6 @@
}
}
}
-
- //缃戝叧鎵ц閫昏緫锛屽父寮�妯″紡澶辨晥涓婃姤
- //if (typeTag == "DoorLockAlarmsSendAlarmInform" && tempDevice != null)
- //{
- // var doorL = (ZigBee.Device.DoorLock)tempDevice;
-
- // if (doorL.DeviceAddr + doorL.DeviceEpoint == doorLock.DeviceAddr + doorLock.DeviceEpoint)
- // {
- // //闈炰富浜轰笉寮硅繖涓獥鍙�
- // if (UserCenterResourse.UserInfo.AuthorityNo != 1)
- // {
- // return;
- // }
- // if (doorLock.IsDoorLockNormallyMode)
- // {
- // if (canOpenNormallyMode)
- // {
- // Application.RunOnMainThread(() =>
- // {
- // Action<bool> action = (obj) =>
- // {
- // UpdateNomallyOpenStatus();
- // };
- // DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.ServicePush, haveLogicNormallyOpenMode, action);
- // });
- // }
- // }
- // }
- //}
if (typeTag == "DeviceStatusReport" && tempDevice != null)
{
@@ -734,18 +704,18 @@
}
DoorLockCommonInfo.NormallyOpenModeValue(doorLock, tempRes);
- //Application.RunOnMainThread(async () =>
- //{
- //var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3, doorLock);
- //if (resTemp == 1)
- //{
- // haveLogicNormallyOpenMode = true;
- //}
- //else if (resTemp == 0)
- //{
- // haveLogicNormallyOpenMode = false;
- //}
- //});
+ Application.RunOnMainThread(async () =>
+ {
+ var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(2, doorLock);
+ if (resTemp == 0)
+ {
+ haveLogicNormallyOpenMode = false;
+ }
+ else
+ {
+ haveLogicNormallyOpenMode = true;
+ }
+ });
}
}
else
@@ -767,7 +737,7 @@
var listDevice = new List<CommonDevice> { };
listDevice.Add(doorLock);
var devTemp = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
- if (devTemp.ConcreteType == DeviceConcreteType.IntelligentLocks_Sone)
+ if (devTemp.ConcreteType != DeviceConcreteType.IntelligentLocks_H06C)
{
Application.RunOnMainThread(() =>
{
@@ -897,8 +867,8 @@
{
if (doorLock.IsDoorLockNormallyMode)
{
- if (canOpenNormallyMode)
- {
+ if (canOpenNormallyMode)
+ {
Application.RunOnMainThread(() =>
{
Action<bool> action = (obj) =>
@@ -912,7 +882,7 @@
{
OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus);
}
- }
+ }
else
{
OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus);
@@ -1102,37 +1072,49 @@
action = () =>
{
- //绯荤粺瀵嗙爜鏀寔鎿嶄綔闂ㄩ攣鍚庯紝璋冪敤娓╁眳鍩庣殑鐣岄潰銆愬父寮�鑷姩鍖栥��
- if (doorLock == null)
- {
+ //WJC鐨勪唬鐮侊細绯荤粺瀵嗙爜鏀寔鎿嶄綔闂ㄩ攣鍚庯紝璋冪敤娓╁眳鍩庣殑鐣岄潰銆愬父寮�鑷姩鍖栥��
+ if (doorLock == null)
+ {
///闃叉鎶涘紓甯�
- return;
- }
- ///澶囨敞锛歐JC鐨�
- Shared.Phone.Device.Logic.Send.CurrentDoorLock = doorLock;
- ///杩涙潵鍒锋柊涓�娆¤澶囧垪琛紱
- Common.Logic.LogicDviceList.Clear();
- if (Common.Logic.LogicDviceList.Count == 0)
- {
- Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
- }
- var addLogicPage = new Shared.Phone.Device.Logic.SoneLogicList();
- UserView.HomePage.Instance.AddChidren(addLogicPage);
- UserView.HomePage.Instance.PageIndex += 1;
- addLogicPage.Show();
- addLogicPage.action += (w) =>
- {
- doorLock.IsDoorLockNormallyMode = w;
- UpdateNomallyOpenStatus();
- //杩斿洖鎸夐敭娓呯┖褰撳墠閫昏緫瀹氫箟鐨凩ogicAction
- UserCenter.DoorLock.DoorLockCommonInfo.LogicAction = null;
- };
+ return;
+ }
+ ///澶囨敞锛歐JC鐨�
+ Shared.Phone.Device.Logic.Send.CurrentDoorLock = doorLock;
+ ///杩涙潵鍒锋柊涓�娆¤澶囧垪琛紱
+ Common.Logic.LogicDviceList.Clear();
+ if (Common.Logic.LogicDviceList.Count == 0)
+ {
+ Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
+ }
+ var addLogicPage = new Shared.Phone.Device.Logic.SoneLogicList();
+ UserView.HomePage.Instance.AddChidren(addLogicPage);
+ UserView.HomePage.Instance.PageIndex += 1;
+ addLogicPage.Show();
+ addLogicPage.action += async (w) =>
+ {
+ DoorLockCommonInfo.NormallyOpenModeValue(doorLock, w);
+ UpdateNomallyOpenStatus();
+ //杩斿洖鎸夐敭娓呯┖褰撳墠閫昏緫瀹氫箟鐨凩ogicAction
+ UserCenter.DoorLock.DoorLockCommonInfo.LogicAction = null;
+ //鏄惁瀛樺湪甯稿紑妯″紡
+ var resTemp = Shared.Common.Logic.SoneLogicList;
+ if (resTemp.Count == 0)
+ {
+ haveLogicNormallyOpenMode = false;
+ }
+ else
+ {
+ haveLogicNormallyOpenMode = true;
+ }
+
+ UserCenter.DoorLock.DoorLockCommonInfo.UpdateCurrentDoorlockAction -= addLogicPage.updateCurrentDoorlockActionTemp;
+ };
};
HdlCheckLogic.Current.CheckSecondarySecurity(action);
- }
-
- /// <summary>
+ }
+
+ /// <summary>
/// 甯稿紑妯″紡鐘舵�佹洿鏂�
/// </summary>
private void UpdateNomallyOpenStatus()
@@ -1214,8 +1196,8 @@
{
if (!string.IsNullOrEmpty(deviceRename))
{
- btnDoorLockTitle.Text = deviceRename;
- //鏀规埧闂�
+ btnDoorLockTitle.Text = deviceRename;
+ //鏀规埧闂�
HdlRoomLogic.Current.ChangedRoom(deviceUI, currentRoom.Id);
deviceUI.ReSave();
}
@@ -1232,9 +1214,6 @@
/// </summary>
public override void RemoveFromParent()
{
- //寰愭鐨勯棬閿佺晫闈㈠叧闂�(缃戝叧鍏ㄥ眬鎺ユ敹鏃朵娇鐢�)
- //ControlCommonResourse.IsDoorLockPageOpen = false;
- ControlCommonResourse.UpdateDoorLockStatusAction = null;
UserCenter.DoorLock.DoorLockCommonInfo.UpdateCurrentDoorlockAction = null;
if (IsDrawerLockMode)
{
--
Gitblit v1.8.0