From 427d1c7ecd04b03419eae157e32fe3367d8dffea Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 28 十一月 2019 09:53:25 +0800
Subject: [PATCH] 2019.11.28
---
ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs | 85 ++++++++++++++++++++++++++++--------------
1 files changed, 57 insertions(+), 28 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
index e88eec2..a8393fd 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
@@ -23,6 +23,7 @@
FrameLayout clickframeLayout = new FrameLayout();
Button clickbutton = new Button();
Button clicktextcolcrbutton = new Button();
+ HorizontalScrolViewLayout devicetypehorizontalScrol1;
public void Show()
{
@@ -120,7 +121,7 @@
};
this.AddChidren(roomhorizontalScrol);
- var devicetypehorizontalScrol1 = new HorizontalScrolViewLayout()
+ devicetypehorizontalScrol1 = new HorizontalScrolViewLayout()
{
Width = Application.GetRealWidth(1080 - 58 - 200),
Height = Application.GetRealHeight(280),
@@ -144,7 +145,7 @@
middle = new VerticalScrolViewLayout();
middle.Y = devicetypehorizontalScrol.Bottom + Application.GetRealHeight(40);
- middle.Height =Application.GetRealHeight(1920-40) - devicetypehorizontalScrol.Bottom;
+ middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
middle.X = Application.GetRealWidth(58);
middle.Radius = (uint)Application.GetRealHeight(50);
@@ -176,7 +177,7 @@
Height = Application.GetRealHeight(780),
X = Application.GetRealWidth(1080 - 468 - 35),
Y = Application.GetRealHeight(184),
- BackgroundImagePath= "Item/SelectFloor_Right.png",
+ BackgroundImagePath = "Item/SelectFloor_Right.png",
};
flMain.AddChidren(foolrbjicon);
@@ -195,7 +196,7 @@
{
Width = Application.GetRealWidth(450),
- Height =foolrbjicon.Height - btnfoolrtext.Height,
+ Height = foolrbjicon.Height - btnfoolrtext.Height,
X = Application.GetRealWidth(80),
Y = btnfoolrtext.Bottom,
};
@@ -206,7 +207,7 @@
var foolrRowLayout = new RowLayout
{
Height = Application.GetRealHeight(150),
- LineColor= ZigbeeColor.Current.LogicMiddleBackgroundColor,
+ LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
foolrbj.AddChidren(foolrRowLayout);
@@ -215,7 +216,7 @@
Width = Application.GetRealWidth(81),
Height = Application.GetRealHeight(81),
UnSelectedImagePath = "Floor/Floor.png",
- Gravity=Gravity.CenterVertical,
+ Gravity = Gravity.CenterVertical,
};
foolrRowLayout.AddChidren(btnfoolricon);
@@ -228,10 +229,11 @@
TextAlignment = TextAlignment.CenterLeft,
TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
Tag = foolr.Key,
- X= btnfoolricon.Right+Application.GetRealWidth(12),
+ X = btnfoolricon.Right + Application.GetRealWidth(12),
};
foolrRowLayout.AddChidren(btnfoolrname);
- if (foolrname.Text == foolr.Value) {
+ if (foolrname.Text == foolr.Value)
+ {
btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
}
@@ -245,7 +247,7 @@
foolrname.Text = btnfoolrname.Text;
flMain.RemoveFromParent();
var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
-
+
AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
};
foolrRowLayout.MouseUpEventHandler += foolrnameclick;
@@ -303,20 +305,20 @@
Width = Application.GetRealWidth(255),
UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
- Y=Application.GetRealHeight(21),
+ Y = Application.GetRealHeight(21),
};
fra.AddChidren(roombjBtn);
- var roomnameBtn= new Button
+ var roomnameBtn = new Button
{
- Height = Application.GetRealHeight(152-26-20),
- Width = Application.GetRealWidth(255-20-50),
+ Height = Application.GetRealHeight(152 - 26 - 20),
+ Width = Application.GetRealWidth(255 - 20 - 50),
Text = room.Name,
TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
- Y=Application.GetRealHeight(21 +13+10),
- X=Application.GetRealWidth(10+25),
+ Y = Application.GetRealHeight(21 + 13 + 10),
+ X = Application.GetRealWidth(10 + 25),
};
fra.AddChidren(roomnameBtn);
@@ -334,7 +336,8 @@
var list = new List<DeviceUI>();
foreach (var device in room.DeviceUIList)
{
- if (device.CommonDevice==null) {
+ if (device.CommonDevice == null)
+ {
continue;
}
if (!deviceTypeList.Contains(device.CommonDevice.Type))
@@ -343,7 +346,19 @@
}
list.Add(device);
}
-
+ if (list.Count == 0)
+ {
+ devicetypehorizontalScrol.Height = 0;
+ devicetypehorizontalScrol1.Height = 0;
+ middle.Height = 0;
+ }
+ else
+ {
+ devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
+ devicetypehorizontalScrol1.Height = Application.GetRealHeight(280);
+ middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
+ }
+
AllDeviceTypeView(list, devicetypehorizontalScrol);
}
@@ -364,7 +379,8 @@
var list = new List<DeviceUI>();
foreach (var device in room.DeviceUIList)
{
- if (device.CommonDevice==null) {
+ if (device.CommonDevice == null)
+ {
continue;
}
if (!deviceTypeList.Contains(device.CommonDevice.Type))
@@ -373,7 +389,20 @@
}
list.Add(device);
}
-
+
+ if (list.Count == 0)
+ {
+ devicetypehorizontalScrol.Height = 0;
+ devicetypehorizontalScrol1.Height = 0;
+ middle.Height = 0;
+ }
+ else
+ {
+ devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
+ devicetypehorizontalScrol1.Height = Application.GetRealHeight(280);
+ middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
+ }
+
AllDeviceTypeView(list, devicetypehorizontalScrol);
@@ -404,7 +433,7 @@
devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
}
- var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone|| device.CommonDevice.Type == DeviceType.TemperatureSensor);
+ var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone || device.CommonDevice.Type == DeviceType.TemperatureSensor);
if (iASZonejosn != null)
{
devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor));
@@ -685,11 +714,11 @@
/// 閫変腑璇ヨ澶囧姛鑳戒綔涓烘潯浠剁殑瑙嗗浘鏂规硶
/// </summary>
/// <param name="common">Common.</param>
- public async static void CurrentDeviceView(FrameLayout flMain, CommonDevice common, bool edit)
+ public async static void CurrentDeviceView(FrameLayout flMain, CommonDevice common, bool edit)
{
//涓嶈褰撳墠鐣岄潰婊戝姩
UserView.HomePage.Instance.ScrollEnabled = false;
- List<Dictionary<string, string>> doorlockConditionsInfo= new List<Dictionary<string, string>>();
+ List<Dictionary<string, string>> doorlockConditionsInfo = new List<Dictionary<string, string>>();
Dictionary<string, string> deviceConditionsInfo = new Dictionary<string, string>();
dictionary(deviceConditionsInfo, "Type", "1");
dictionary(deviceConditionsInfo, "IsValid", "1");
@@ -1386,12 +1415,12 @@
var buttonSelected = new SelectedButton();
buttonRow.AddChidren(buttonSelected);
EventHandler<MouseEventArgs> buttonclick = (sender, e) =>
- {
- buttonSelected.Visible = true;
- SelectedDeviceStatuscondition = "OnOffSwitch";
- button.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+ {
+ buttonSelected.Visible = true;
+ SelectedDeviceStatuscondition = "OnOffSwitch";
+ button.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
- };
+ };
buttonRow.MouseUpEventHandler += buttonclick;
button.MouseUpEventHandler += buttonclick;
buttonSelected.MouseUpEventHandler += buttonclick;
@@ -1544,7 +1573,7 @@
deviceConditionsInfo.Add(Key, Value);
}
-
+
}
}
--
Gitblit v1.8.0