| | |
| | | |
| | | namespace Shared.Phone.UserCenter.DoorLock |
| | | { |
| | | public class AddUnLockMethod : DoorLockCommonLayout, ZigBee.Common.IStatus |
| | | public class AddUnLockMethod : DoorLockCommonLayout |
| | | { |
| | | /// 构造函数 |
| | | /// </summary> |
| | |
| | | |
| | | MidFrameLayoutContent(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 中部布局 |
| | | /// </summary> |
| | |
| | | }; |
| | | this.midFrameLayout.AddChidren(bodyView); |
| | | |
| | | for (int i = 0; i < 3; i++) |
| | | int count = GetSupportType(doorLock); |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | var RowView = new FrameLayout() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextSize=14, |
| | | TextSize = 14, |
| | | }; |
| | | RowView.AddChidren(btnText); |
| | | |
| | |
| | | }; |
| | | RowView.AddChidren(line2); |
| | | |
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(doorLock.DeviceAddr); |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice); |
| | | if (i == 0) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddPassword; |
| | | } |
| | | else if (i == 1) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddFingerprint; |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1F) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddDoorLockCalmFingerprint; |
| | | } |
| | | else if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_HAT1B) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddDoorLockCalmFingerprint; |
| | | } |
| | | else |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddFingerprint; |
| | | } |
| | | } |
| | | else if (i == 2) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddIcCard; |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1F) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddDoorLockFaceID; |
| | | } |
| | | else if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1TF) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddIcCard; |
| | | } |
| | | else |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddIcCard; |
| | | } |
| | | } |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.IntelligentLocks_AT1TF) |
| | | { |
| | | if (i == 3) |
| | | { |
| | | btnText.TextID = R.MyInternationalizationString.AddDoorLockFaceID; |
| | | } |
| | | } |
| | | if (i == count - 1) |
| | | { |
| | | line2.Visible = false; |
| | | } |
| | | |
| | | int currentIndex = i; |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | string unlockTypeStr = ""; |
| | | if (currentIndex == 0) |
| | | { |
| | | var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "password"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethodTip.Show(); |
| | | unlockTypeStr = "password"; |
| | | } |
| | | else if (currentIndex == 1) |
| | | { |
| | | var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "fingerprint"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethodTip.Show(); |
| | | unlockTypeStr = "fingerprint"; |
| | | } |
| | | else if (currentIndex == 2) |
| | | { |
| | | var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, "proximity"); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethodTip.Show(); |
| | | unlockTypeStr = "proximity"; |
| | | } |
| | | else if (currentIndex == 3) |
| | | { |
| | | unlockTypeStr = "faceID"; |
| | | } |
| | | else if (currentIndex == 4) |
| | | { |
| | | unlockTypeStr = "calmFingerprint"; |
| | | } |
| | | var addUnLockMethodTip = new AddUnLockMethodTip(doorLock, curAccountObj, unlockTypeStr); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addUnLockMethodTip); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addUnLockMethodTip.Show(); |
| | | }; |
| | | btnRight.MouseUpEventHandler += eHandler; |
| | | RowView.MouseUpEventHandler += eHandler; |
| | | btnText.MouseUpEventHandler += eHandler; |
| | | } |
| | | } |
| | | |
| | | #region 接口实现 |
| | | /// <summary> |
| | | /// 处理变化事件 --将弃用 改用DeviceInfoChange() |
| | | /// </summary> |
| | | /// <returns>The changed.</returns> |
| | | /// <param name="common">Common.</param> |
| | | public void Changed(CommonDevice common) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// 处理变化事件 |
| | | /// </summary> |
| | | /// <param name="common"></param> |
| | | /// <param name="typeTag"></param> |
| | | public void DeviceInfoChange(CommonDevice common, string typeTag) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// Changeds the IL ogic status. |
| | | /// </summary> |
| | | /// <param name="logic">Logic.</param> |
| | | public void ChangedILogicStatus(ZigBee.Device.Logic logic) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// Changeds the IS cene status. |
| | | /// </summary> |
| | | /// <param name="scene">Scene.</param> |
| | | public void ChangedISceneStatus(Scene scene) |
| | | { |
| | | } |
| | | #endregion |
| | | } |
| | | } |