using System; using HDL_ON.Entity; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI { public class ChooseRoomPage : FrameLayout { #region 控件列表 FrameLayout bodyView; /// /// 内容加载区域 /// VerticalScrolViewLayout contentView; #endregion #region 局部变量 #endregion public ChooseRoomPage() { bodyView = this; } public void LoadPage() { bodyView.BackgroundColor = CSS_Color.BackgroundColor; new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.LocationManagement)); contentView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64), Height = Application.GetRealHeight(667 - 64), }; bodyView.AddChidren(contentView); var allRoomView = new FrameLayout() { Height = Application.GetRealHeight(50), BackgroundColor = CSS_Color.MainBackgroundColor, }; contentView.AddChidren(allRoomView); Button btnAllRoomText = new Button() { X = Application.GetRealWidth(16), Width = Application.GetRealWidth(280), TextID = StringId.All, TextSize= CSS_FontSize.SubheadingFontSize, TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.CenterLeft, }; allRoomView.AddChidren(btnAllRoomText); Button btnChooseAll = new Button() { X = Application.GetRealWidth(331), Gravity = Gravity.CenterVertical, Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "Public/ChooseIcon.png", SelectedImagePath = "Public/ChooseOnIcon.png", }; allRoomView.AddChidren(btnChooseAll); foreach(var room in DB_ResidenceData.residenceData.rooms) { var roomView = new FrameLayout() { Height = Application.GetRealHeight(50), BackgroundColor = CSS_Color.MainBackgroundColor, }; contentView.AddChidren(roomView); var btnLine = new Button() { Gravity = Gravity.CenterHorizontal, Height = Application.GetMinReal(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor, }; roomView.AddChidren(btnLine); 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.floor + " " + room.name, }; roomView.AddChidren(btnRoomText); Button btnChoose = new Button() { X = Application.GetRealWidth(331), Gravity = Gravity.CenterVertical, Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "Public/ChooseIcon.png", SelectedImagePath = "Public/ChooseOnIcon.png", }; roomView.AddChidren(btnChoose); } } } }