| | |
| | | { |
| | | FrameLayout bodyView; |
| | | VerticalScrolViewLayout contentView; |
| | | Function scene; |
| | | Scene scene; |
| | | Button lastButton; |
| | | Action backAction; |
| | | public SetSceneLocationPage(Function function, Action action) |
| | | public SetSceneLocationPage(Scene s, Action action) |
| | | { |
| | | backAction = action; |
| | | bodyView = this; |
| | | scene = function; |
| | | scene = s; |
| | | } |
| | | |
| | | public void LoadPage() |
| | |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | System.Collections.Generic.List<Room> rooms = new System.Collections.Generic.List<Room>(); |
| | | rooms.Add(new Room() { sid = "", name = Language.StringByID(StringId.WholeHouseScene),floorId = "" }); |
| | | rooms.AddRange(DB_ResidenceData.rooms); |
| | | rooms.Add(new Room() { roomName = Language.StringByID(StringId.WholeZone),parentId = "" }); |
| | | rooms.AddRange(SpatialInfo.CurrentSpatial.RoomList); |
| | | foreach (var room in rooms) |
| | | { |
| | | var roomView = new FrameLayout() |
| | |
| | | }; |
| | | contentView.AddChidren(roomView); |
| | | |
| | | Button btnRoomText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(280), |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = room.floorName + room.name, |
| | | }; |
| | | roomView.AddChidren(btnRoomText); |
| | | |
| | | Button btnChoose = new Button() |
| | | { |
| | | X = Application.GetRealWidth(331), |
| | |
| | | Tag = "ChooseIcon" |
| | | }; |
| | | roomView.AddChidren(btnChoose); |
| | | if(scene.roomIdList.Contains(room.sid)) |
| | | |
| | | Button btnRoomText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | //Width = Application.GetRealWidth(280), |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = room.floorName + room.roomName, |
| | | }; |
| | | roomView.AddChidren(btnRoomText); |
| | | |
| | | if (scene.roomIds.Contains(room.roomId)) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | lastButton = btnChoose; |
| | |
| | | }; |
| | | roomView.AddChidren(btnLine); |
| | | |
| | | LoadEvent_ChangeSceneLocation(room, btnChoose); |
| | | LoadEvent_ChangeSceneLocation(room, btnRoomText); |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | lastButton = btn; |
| | | btn.IsSelected = true; |
| | | scene.roomIdList = new System.Collections.Generic.List<string>(); |
| | | scene.roomIdList.Add(room.sid); |
| | | scene.roomIds = new System.Collections.Generic.List<string>(); |
| | | scene.roomIds.Add(room.roomId); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | }; |