From 944b87b6bcccb095cd73f13f4410fb20faf48f74 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期三, 25 十二月 2019 11:21:06 +0800 Subject: [PATCH] 2019.12.25 --- ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs | 95 +++++++++++++++-------------------------------- 1 files changed, 30 insertions(+), 65 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs old mode 100755 new mode 100644 index 822da27..78d0cef --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/SelectZone.cs @@ -56,7 +56,7 @@ TextAlignment = TextAlignment.CenterLeft, TextColor = ZigbeeColor.Current.GXCTextGrayColor, TextID = R.MyInternationalizationString.Cancel, - TextSize = 16 + TextSize = 14 }; topView.AddChidren(cancle); @@ -77,90 +77,52 @@ TextAlignment = TextAlignment.CenterRight, TextColor = ZigbeeColor.Current.GXCTextSelectedColor2, TextID = R.MyInternationalizationString.Confrim, - TextSize = 16 + TextSize = 14 }; topView.AddChidren(confrim); 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) { + if(room.IsLove) + { + continue; + } 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); + currentId = roomIdList[0]; + pickView.OnSelectChangeEvent += (l1, l2, l3) => + { + currentId = roomIdList[l1]; + }; + } + else + { + pickView.setNPicker(floorList, roomList, null); + currentId = roomIdList[0]; + pickView.OnSelectChangeEvent += (l1, l2, l3) => + { + currentId = roomIdList[l2]; + }; + } cancle.MouseUpEventHandler += Close; confrim.MouseUpEventHandler += Confrim_MouseEvent; - } - - /// <summary> - /// AddTime - /// </summary> - /// <param name="verticalScrolView"></param> - private void AddTime(VerticalScrolViewLayout verticalScrolView, int timess) - { - var row = new FrameLayout - { - Height = Application.GetRealHeight(127 + 12), - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor - }; - verticalScrolView.AddChidren(row); - - var trow = new FrameLayout - { - Y = Application.GetRealHeight(12), - Height = Application.GetRealHeight(127), - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor - }; - row.AddChidren(trow); - - var timeBtn = new Button - { - X = Application.GetRealWidth(80), - Width = Application.GetRealWidth(500), - TextAlignment = TextAlignment.CenterLeft, - TextColor = ZigbeeColor.Current.GXCTextGrayColor4, - SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor, - IsSelected = false - }; - trow.AddChidren(timeBtn); - - var selectBtn = new Button - { - X = Application.GetRealWidth(942), - Width = Application.GetMinRealAverage(60), - Height = Application.GetMinRealAverage(60), - Gravity = Gravity.CenterVertical, - UnSelectedImagePath = "Item/ItemSelected.png", - Visible = false - }; - trow.AddChidren(selectBtn); - - var Line = new FrameLayout() - { - Y = trow.Height - 1, - Width = Application.GetRealWidth(919), - Height = 1, - Gravity = Gravity.CenterHorizontal, - BackgroundColor = Common.ZigbeeColor.Current.GXCGrayLineColor2 - }; - trow.AddChidren(Line); - } /// <summary> @@ -180,7 +142,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