wxr
2020-03-05 0bdc0a135dbe31761b53f432ed34f347f0a4e36b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using System;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
 
namespace HDL_ON.UI
{
    public class ChooseRoomPage : FrameLayout
    {
        #region 控件列表
        FrameLayout bodyView;
        /// <summary>
        /// 内容加载区域
        /// </summary>
        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);
 
            }
        }
    }
}