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/CommonForm/SelectZone.cs | 33 ++++++++++++++++++++++++---------
1 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs
index 213da61..caedc18 100755
--- a/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs
+++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs
@@ -43,6 +43,8 @@
};
dialog.AddChidren(backgroundFL);
+ backgroundFL.Animate = Animate.DownToUp;
+
var topView = new FrameLayout
{
Height = Application.GetRealHeight(138)
@@ -83,31 +85,41 @@
pickView = new UIPickerView
{
- Y = Application.GetRealHeight(20+138),
+ Y = Application.GetRealHeight(20 + 138),
Height = Application.GetRealHeight(450)
};
backgroundFL.AddChidren(pickView);
- foreach(var floor in Config.Instance.Home.FloorDics)
+ foreach (var floor in Config.Instance.Home.FloorDics)
{
floorList.Add(floor.Value);
}
- foreach(var room in Shared.Common.Room.Lists)
+ foreach (var room in Shared.Common.Room.Lists)
{
roomList.Add(room.Name);
roomIdList.Add(room.Id);
}
- pickView.setNPicker(floorList, roomList, null);
- pickView.OnSelectChangeEvent += (l1, l2, l3) =>
+ if (floorList.Count == 0)
{
- currentId = roomIdList[l2];
- };
+ pickView.setNPicker(roomList, null, null);
+ pickView.OnSelectChangeEvent += (l1, l2, l3) =>
+ {
+ currentId = roomIdList[l1];
+ };
+ }
+ else
+ {
+ pickView.setNPicker(floorList, roomList, null);
+ pickView.OnSelectChangeEvent += (l1, l2, l3) =>
+ {
+ currentId = roomIdList[l2];
+ };
+ }
cancle.MouseUpEventHandler += Close;
confrim.MouseUpEventHandler += Confrim_MouseEvent;
}
-
/// <summary>
/// Close
@@ -126,7 +138,10 @@
/// <param name="mouseEventArgs"></param>
private void Confrim_MouseEvent(object sender, MouseEventArgs mouseEventArgs)
{
- ZoneAction?.Invoke(Shared.Common.Room.CurrentRoom.GetRoomById(currentId));
+ if (Shared.Common.Room.CurrentRoom.GetRoomById(currentId) != null)
+ {
+ ZoneAction?.Invoke(Shared.Common.Room.CurrentRoom.GetRoomById(currentId));
+ }
RemoveFromParent();
}
}
--
Gitblit v1.8.0