From 74a9ba8e9a2df9c39f9c2eb212a5ac889a055cd4 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 03 十二月 2019 10:47:51 +0800
Subject: [PATCH] 优化UI细节(请合并最新代码)
---
ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs | 42 ++++++++++++++++++++++++++++++++----------
1 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
index ae5cd7d..790e4e2 100755
--- a/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/LightControl.cs
@@ -62,6 +62,10 @@
private Button StatuBtn;
+ /// <summary>
+ /// IsDrawerLockMode
+ /// </summary>
+ public bool IsDrawerLockMode;
#endregion
#region 鈼� 鎺ュ彛__________________________
@@ -145,7 +149,30 @@
}
else if (typeTag == "OnlineStatusChange")
{
-
+ Application.RunOnMainThread(() =>
+ {
+ try
+ {
+ var deviceUI = device;
+ //璁惧涓虹┖
+ if (deviceUI.CommonDevice == null)
+ {
+ return;
+ }
+ //鏄惁涓哄綋鍓嶈澶�
+ if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
+ {
+ return;
+ }
+ deviceUI.CommonDevice.IsOnline = common.IsOnline;
+ deviceIMG.IsSelected = switchBtn.IsSelected = deviceUI.CommonDevice.IsOnline == 1;
+ deviceUI.CommonDevice.LastDateTime = DateTime.Now;
+ }
+ catch (Exception ex)
+ {
+ System.Console.WriteLine($"Error:{ex.Message}");
+ }
+ });
}
}
#endregion
@@ -159,6 +186,10 @@
ZbGateway.StatusList.Remove(this);
//action();
//action = null;
+ if (IsDrawerLockMode)
+ {
+ CommonPage.Instance.IsDrawerLockMode = false;
+ }
RemoveUpdateControlDeviceStatuAction();
base.RemoveFromParent();
}
@@ -243,15 +274,6 @@
RemoveFromParent();
};
- var sharedBtn = new Button
- {
- X = Application.GetRealWidth(850),
- Width = Application.GetMinReal(69),
- Height = Application.GetMinReal(69),
- Gravity = Gravity.CenterVertical,
- UnSelectedImagePath = "Item/Shared.png"
- };
- top.topView.AddChidren(sharedBtn);
var moreBtn = new Button
{
--
Gitblit v1.8.0