wxr
2020-01-18 4cc04639fbadde3a7f3b9875353df0d90fc09043
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI;
using HDL_ON.UI.CSS;
using Shared;
 
namespace HDL_ON.UI
{
    public partial class ClassificationPage : FrameLayout
    {
 
        #region 控件列表
        #region 顶部控件
        FrameLayout bodyView;
        /// <summary>
        /// 房间分页
        /// </summary>
        Button btnRoomTilte;
        /// <summary>
        /// 功能分类
        /// </summary>
        Button btnFuncTitle;
        #endregion
 
        #region 房间区域
        /// <summary>
        /// 房间内容显示区域
        /// </summary>
        FrameLayout roomContentView;
        #region 房间底部切换显示区域
        /// <summary>
        /// 房间区域,顶部区域
        /// </summary>
        FrameLayout roomTopView;
        /// <summary>
        /// 楼层选择下拉图标
        /// </summary>
        Button btnFoorDownIcon;
        /// <summary>
        /// 楼层显示
        /// </summary>
        Button btnFoor;
        /// <summary>
        /// 显示方式切换按钮
        /// </summary>
        Button btnSwitchDipaly;
        #endregion
        /// <summary>
        /// 房间列表区域
        /// </summary>
        VerticalScrolViewLayout roomListView;
        /// <summary>
        /// 房间区域集合
        /// </summary>
        List<FrameLayout> roomViewList;
        #endregion
 
 
        #endregion
 
        public ClassificationPage()
        {
            bodyView = this;
        }
 
        public void LoadPage()
        {
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            #region top
            FrameLayout topView = new FrameLayout()
            {
                Height = Application.GetRealHeight(64),
                BackgroundColor = CSS_Color.TopViewColor,
            };
            bodyView.AddChidren(topView);
 
            btnRoomTilte = new Button()
            {
                Y = Application.GetRealHeight(30),
                Width = Application.GetRealWidth(170),
                Height = Application.GetRealHeight(25),
                TextAlignment = TextAlignment.CenterRight,
                TextSize = CSS_FontSize.HeadlineFontSize,
                TextColor = CSS_Color.PromptingColor1,
                SelectedTextColor = CSS_Color.MainColor,
                TextID = StringId.Rooms,
                IsSelected = true
            };
            topView.AddChidren(btnRoomTilte);
 
            btnFuncTitle = new Button()
            {
                X = Application.GetRealWidth(209),
                Y = Application.GetRealHeight(30),
                Width = Application.GetRealWidth(170),
                Height = Application.GetRealHeight(25),
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.TextFontSize,
                TextColor = CSS_Color.PromptingColor1,
                SelectedTextColor = CSS_Color.MainColor,
                TextID = StringId.Devices,
            };
            topView.AddChidren(btnFuncTitle);
 
            #endregion
 
 
 
            #region 房间区域
            /// <summary>
            /// 房间内容显示区域
            /// </summary>
            roomContentView = new FrameLayout()
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(52),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(roomContentView);
            #region 房间底部切换显示区域
            /// <summary>
            /// 房间区域,顶部区域
            /// </summary>
            roomTopView = new FrameLayout()
            {
                Height = Application.GetRealHeight(53),
            };
            roomContentView.AddChidren(roomTopView);
            /// <summary>
            /// 楼层选择下拉图标
            /// </summary>
            btnFoorDownIcon = new Button()
            {
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(18),
                UnSelectedImagePath = "0Common/DownIcon.png",
            };
            roomContentView.AddChidren(btnFoorDownIcon);
            /// <summary>
            /// 楼层显示
            /// </summary>
            btnFoor = new Button()
            {
                X = btnFoorDownIcon.Right,
                Y = Application.GetRealHeight(18),
                Width = Application.GetRealWidth(200),
                Height = Application.GetMinRealAverage(16),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextAlignment = TextAlignment.CenterLeft,
                Text = UserConfig.Instance.CurFoor,
            };
            roomContentView.AddChidren(btnFoor);
            /// <summary>
            /// 显示方式切换按钮
            /// </summary>
            btnSwitchDipaly = new Button()
            {
                X = Application.GetRealWidth(335),
                Y = Application.GetRealHeight(12),
                Width = Application.GetMinRealAverage(28),
                Height = Application.GetMinRealAverage(28),
                UnSelectedImagePath = "Classification/ToggleDisplayThumbnail.png",//缩略图
                SelectedImagePath = "Classification/ToggleDisplayLarge.png",
            };
            roomContentView.AddChidren(btnSwitchDipaly);
            #endregion
 
 
            /// <summary>
            /// 房间列表区域
            /// </summary>
            roomListView = new VerticalScrolViewLayout()
            {
                Y = roomContentView.Bottom,
                Height = Application.GetRealHeight(497 + 10),
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(roomListView);
            /// <summary>
            /// 房间区域集合
            /// </summary>
            roomViewList = new List<FrameLayout>();
 
            foreach (var room in DB_ResidenceData.residenceData.rooms)
            {
                var btn = new Button()
                {
                    Height = Application.GetRealHeight(20),
                };
                roomListView.AddChidren(btn);
 
                var roomView = new FrameLayout()
                {
                    Gravity = Gravity.CenterHorizontal,
                    Width = Application.GetRealWidth(343),
                    Height = Application.GetRealHeight(184),
                    Radius = (uint)Application.GetRealHeight(12),
                    BorderColor = 0x00000000,
                    BorderWidth = 1,
                    BackgroundImagePath = room.backgroundImage
                };
                roomListView.AddChidren(roomView);
 
                roomViewList.Add(roomView);
 
 
 
            }
            #endregion
 
        }
    }
}