| | |
| | | |
| | | floorBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(750), |
| | | Width = Application.GetRealWidth(200), |
| | | X = Application.GetRealWidth(650), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize=14, |
| | | IsBold=true |
| | | TextSize = 14, |
| | | IsBold = true |
| | | }; |
| | | |
| | | var selectFloorBtn = new Button() |
| | |
| | | }; |
| | | AddChidren(bodyFrameLayout); |
| | | |
| | | var roomScrolView = new VerticalScrolViewLayout { }; |
| | | bodyFrameLayout.AddChidren(roomScrolView); |
| | | try |
| | | { |
| | | var roomList = Common.Room.CurrentRoom.GetRoomsByFloorId(floorId); |
| | | if (roomList == null || roomList.Count == 0) |
| | | if (Common.Room.Lists.Count <= 1) |
| | | { |
| | | return; |
| | | } |
| | | for (int i = 0; i < roomList.Count + 1; i++) |
| | | var roomScrolView = new VerticalScrolViewLayout { }; |
| | | bodyFrameLayout.AddChidren(roomScrolView); |
| | | var roomList = Common.Room.CurrentRoom.GetRoomsByFloorId(floorId); |
| | | if (roomList == null || roomList.Count == 0) |
| | | { |
| | | int xx = 43 + i % 2 * (20 + 487); |
| | | int yy = 0; |
| | | if (i == 0 || i == 1) |
| | | itemView = new FrameLayout() |
| | | { |
| | | if (i % 2 == 0) |
| | | Height = Application.GetRealHeight(354 + 58) |
| | | }; |
| | | roomScrolView.AddChidren(itemView); |
| | | |
| | | var roomView = new RoomNoNameMainView(34, 58); |
| | | itemView.AddChidren(roomView); |
| | | roomView.Init(); |
| | | |
| | | roomView.Icon.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | roomView.RoomNameButton.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | roomView.iconFL.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < roomList.Count + 1; i++) |
| | | { |
| | | int xx = 43 + i % 2 * (20 + 487); |
| | | int yy = 0; |
| | | if (i == 0 || i == 1) |
| | | { |
| | | if (i % 2 == 0) |
| | | { |
| | | itemView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(354 + 58) |
| | | }; |
| | | roomScrolView.AddChidren(itemView); |
| | | } |
| | | yy = 58; |
| | | } |
| | | else if (i % 2 == 0) |
| | | { |
| | | itemView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(354 + 58) |
| | | Height = Application.GetRealHeight(354) |
| | | }; |
| | | roomScrolView.AddChidren(itemView); |
| | | } |
| | | yy = 58; |
| | | } |
| | | else if (i % 2 == 0) |
| | | { |
| | | itemView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(354) |
| | | }; |
| | | roomScrolView.AddChidren(itemView); |
| | | } |
| | | |
| | | if (i < roomList.Count) |
| | | { |
| | | var room = roomList[i]; |
| | | var roomView = new RoomMainView(xx, yy); |
| | | itemView.AddChidren(roomView); |
| | | roomView.Init(this, room); |
| | | roomView.SetRoomName(room.Name); |
| | | roomView.SetRoomIcon(room.BackgroundImageType == 0 ? room.BackgroundImage : System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage)); |
| | | roomView.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | if (i < roomList.Count) |
| | | { |
| | | if (CanClick == false) |
| | | var room = roomList[i]; |
| | | var roomView = new RoomMainView(xx, yy); |
| | | itemView.AddChidren(roomView); |
| | | roomView.Init(this, room); |
| | | roomView.SetRoomName(room.Name); |
| | | roomView.SetRoomIcon(room.BackgroundImageType == 0 ? room.BackgroundImage : System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage)); |
| | | roomView.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | return; |
| | | } |
| | | CommonPage.Instance.CloseLeftMenu(); |
| | | Common.Room.CurrentRoom = room; |
| | | Config.Instance.Home.CurrentFloorId = room.FloorId; |
| | | UserPage.Instance.Fresh(); |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | var roomView = new RoomNoNameMainView(xx, yy); |
| | | itemView.AddChidren(roomView); |
| | | roomView.Init(); |
| | | if (CanClick == false) |
| | | { |
| | | return; |
| | | } |
| | | CommonPage.Instance.CloseLeftMenu(); |
| | | Common.Room.CurrentRoom = room; |
| | | Config.Instance.Home.CurrentFloorId = room.FloorId; |
| | | UserPage.Instance.Fresh(); |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | var roomView = new RoomNoNameMainView(xx, yy); |
| | | itemView.AddChidren(roomView); |
| | | roomView.Init(); |
| | | |
| | | roomView.Icon.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | roomView.RoomNameButton.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | roomView.iconFL.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | roomView.Icon.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | roomView.RoomNameButton.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | roomView.iconFL.MouseUpEventHandler += ShowUnallocatedRoom_MouseUpEvent; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |