From cc11e3b15baa258c35085a7cbdb2b350950b6202 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 24 十月 2019 15:37:15 +0800
Subject: [PATCH] 2019-10-24-4
---
ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs | 66 +++++++++++++++++++++++++--------
1 files changed, 50 insertions(+), 16 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
index 67c2a14..cb9097a 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
@@ -87,7 +87,8 @@
Width = Application.GetRealWidth(400),
Height = Application.GetRealHeight(69),
Y = Application.GetRealHeight(92),
- TextID = MyInternationalizationString.customroom,
+ //TextID = MyInternationalizationString.customroom,
+ Text = Config.Instance.Home.GetCurrentFloorName,
};
topRowLayout.AddChidren(foolrname);
var dropdown = new Button
@@ -162,7 +163,7 @@
///妤煎眰鐐瑰嚮浜嬩欢
- foolrname.MouseUpEventHandler += (sender, e) =>
+ EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
{
var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
@@ -173,6 +174,7 @@
};
var foolrbj = new VerticalScrolViewLayout
{
+
Width = Application.GetRealWidth(400),
Height = Application.GetRealHeight(600),
X = Application.GetRealWidth(1080 - 400 - 60),
@@ -181,11 +183,9 @@
Radius = (uint)Application.GetRealHeight(30),
};
flMain.AddChidren(foolrbj);
- ///榛樿璋冭瘯
- List<string> foolrlist = new List<string> { "涓�妤�", "浜屾ゼ", "涓夋ゼ" };
-
- foreach (var foolr in foolrlist)
+ foreach (var foolr in Config.Instance.Home.FloorDics)
{
+
var foolrRowLayout = new FrameLayout
{
Height = Application.GetRealHeight(150),
@@ -196,34 +196,60 @@
{
Width = Application.GetRealWidth(250),
Height = Application.GetRealHeight(160),
- Text = foolr,
+ Text = foolr.Value,
TextAlignment = TextAlignment.Center,
TextColor = ZigbeeColor.Current.LogicTextBlackColor,
//SelectedTextColor=0xfffc744b,
+ Tag = foolr.Key,
};
foolrRowLayout.AddChidren(btnfoolrname);
- EventHandler<MouseEventArgs> foolrclick = (sender13, e13) =>
+ EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
{
roomhorizontalScrol.RemoveAll();
+ devicetypehorizontalScrol.RemoveAll();
+ middle.RemoveAll();
foolrname.Text = btnfoolrname.Text;
flMain.RemoveFromParent();
- ///澶囨敞锛氭樉绀洪�変腑妤煎眰鐨勬墍鏈夋埧闂�
- AllRoomView(Common.Room.Lists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
+ var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
+ AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
};
- foolrRowLayout.MouseUpEventHandler += foolrclick;
- btnfoolrname.MouseUpEventHandler += foolrclick;
+ foolrRowLayout.MouseUpEventHandler += foolrnameclick;
+ btnfoolrname.MouseUpEventHandler += foolrnameclick;
}
-
-
};
+ foolrname.MouseUpEventHandler += foorlclick;
+ dropdown.MouseUpEventHandler += foorlclick;
///绗竴娆¤繘鏉�
- AllRoomView(Common.Room.Lists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
+ var roomlists = new List<Common.Room>();
+ roomlists.Clear();
+ if (Config.Instance.Home.FloorDics.Count < 2)
+ {
+ foolrname.Visible = false;
+ dropdown.Visible = false;
+ if (Config.Instance.Home.FloorDics.Count == 0)
+ {
+ roomlists.AddRange(Common.Room.Lists);
+ }
+ else
+ {
+ roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
+ }
+ }
+ else
+ {
+ roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
+
+ }
+
+
+ AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
+
+
}
/// <summary>
/// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
@@ -275,6 +301,10 @@
var list = new List<DeviceUI>();
foreach (var device in room.DeviceUIList)
{
+ if (device.CommonDevice == null)
+ {
+ continue;
+ }
if (!deviceTypeList.Contains(device.CommonDevice.Type))
{
continue;
@@ -298,6 +328,10 @@
var list = new List<DeviceUI>();
foreach (var device in room.DeviceUIList)
{
+ if (device.CommonDevice == null)
+ {
+ continue;
+ }
if (!deviceTypeList.Contains(device.CommonDevice.Type))
{
continue;
--
Gitblit v1.8.0