陈嘉乐
2021-02-23 780b8b391bc92fba473291ec8151df5860749408
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
using System;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using Shared;
using System.Collections.Generic;
using System.Text;
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice
{
    public class DeviceSet : FrameLayout
    {
        public DeviceSet()
        {
            Tag = "PirView";
        }
        public void Show() {
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            PirDevice.View.TopView topView = new View.TopView();
            topView.topNameBtn.TextID = StringId.shebeigaunli;
            topView.topIconBtn.Visible = true;
            this.AddChidren(topView.FLayoutView());
            topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); };
            VerticalScrolViewLayout vv = new VerticalScrolViewLayout();
            vv.Height = Application.GetRealHeight(667 - 64);
            vv.Y = Application.GetRealHeight(64);
            this.AddChidren(vv);
            #endregion
            int a = 3;
            int b = 3;
            for (int i = 0; i < b; i++)
            {
                #region 红外宝图标 版本号 名称 状态
                FrameLayout fLayout = new FrameLayout
                {
                    Width = Application.GetRealWidth(375),
                    Height = Application.GetRealHeight(12+92+(50* a)),
                };
                vv.AddChidren(fLayout);
               
                //红外宝显示父控件
                FrameLayout devfLayout = new FrameLayout
                {
                    Y = Application.GetRealHeight(12),
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(375-16*2),
                    Height = Application.GetRealHeight(92 + (50 * a)),
                    BackgroundColor = CSS.CSS_Color.view,
                    Radius = (uint)Application.GetRealHeight(12),
                };
                fLayout.AddChidren(devfLayout);
                //红外宝图标
                Button priequipmentBtn = new Button
                {
                    Y=Application.GetRealHeight(16),
                    X = Application.GetRealWidth(5),
                    Width = Application.GetRealWidth(60),
                    Height = Application.GetRealWidth(60),
                    UnSelectedImagePath = "PirIcon/priequipment.png",
                    TextAlignment = TextAlignment.Center,
                };
                devfLayout.AddChidren(priequipmentBtn);
                //红外宝名称
                Button deviceNameBtn = new Button
                {
                    Y=Application.GetRealHeight(16),
                    X = priequipmentBtn.Right + Application.GetRealWidth(7),
                    Width = Application.GetRealWidth(120),
                    Height = Application.GetRealHeight(20),
                    Text = "红外宝A"+i.ToString(),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = TextSize.text14,
                    TextColor = CSS.CSS_Color.textColor,
                    IsBold = true,
                };
                devfLayout.AddChidren(deviceNameBtn);
                //版本号
                Button versionBtn = new Button
                {
                    Y = deviceNameBtn.Bottom+ Application.GetRealHeight(4),
                    X = priequipmentBtn.Right + Application.GetRealWidth(7),
                    Width = Application.GetRealWidth(120),
                    Height = Application.GetRealHeight(17),
                    Text = "版本号v1.3.5",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = TextSize.text12,
                    TextColor = CSS.CSS_Color.textCancelColor,
                };
                devfLayout.AddChidren(versionBtn);
                // 5/10
                Button geBtn = new Button
                {
                    Y = versionBtn.Bottom + Application.GetRealHeight(2),
                    X = priequipmentBtn.Right + Application.GetRealWidth(7),
                    Width = Application.GetRealWidth(120),
                    Height = Application.GetRealHeight(17),
                    Text = "2",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = TextSize.text12,
                    TextColor = CSS.CSS_Color.textConfirmColor,
                };
                devfLayout.AddChidren(geBtn);
                geBtn.Width = geBtn.GetTextWidth();
                // 5/10
                Button sumBtn = new Button
                {
                    Y = versionBtn.Bottom + Application.GetRealHeight(2),
                    X = geBtn.Right,
                    Width = Application.GetRealWidth(20),
                    Height = Application.GetRealHeight(17),
                    Text ="/10",
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = TextSize.text12,
                    TextColor = CSS.CSS_Color.textCancelColor,
                };
                devfLayout.AddChidren(sumBtn);
                //状态图标
                Button stateIconBtn = new Button
                {
                    Y =Application.GetRealHeight(23),
                    X = Application.GetRealWidth(291),
                    Width = Application.GetRealWidth(8),
                    Height = Application.GetRealWidth(8),
                    UnSelectedImagePath = "PirIcon/online.png",
                };
                devfLayout.AddChidren(stateIconBtn);
                //红外宝状态(在线-离线)
                Button stateTextBtn = new Button
                {
                    Y = Application.GetRealHeight(18),
                    X = Application.GetRealWidth(303),
                    Width = Application.GetRealWidth(30),
                    Height = Application.GetRealHeight(17),
                    TextID=StringId.zaixianhwb,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = TextSize.text12,
                    TextColor = 0xFF67D569,// CSS.CSS_Color.textColor,
                    IsBold=true,
                };
                devfLayout.AddChidren(stateTextBtn);
                //线
                Button lineBtn = new Button
                {
                    Y = Application.GetRealHeight(92)-1,
                    X = Application.GetRealWidth(16),
                    Width = Application.GetRealWidth(343-16*2),
                    Height =1,
                    BackgroundColor = CSS.CSS_Color.viewLine,
                };
                devfLayout.AddChidren(lineBtn);
 
                if (b - 1 == i)
                {
                    //最后一个后面增加间隔背景
                    vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(20) });
                }
                #endregion
 
                for (int j = 0; j < a; j++) {
                    RowLayout funControlRow = new RowLayout
                    {
                        Y = Application.GetRealHeight(92 + (50 * j)),
                        Width = Application.GetRealWidth(375 - 16 * 2),
                        Height = Application.GetRealHeight(50),
                        LineColor = CSS.CSS_Color.textWhiteColor,
                        SubViewWidth=Application.GetRealWidth(68),
                    };
                    devfLayout.AddChidren(funControlRow);
                    //遥控器名称
                    Button nameBtn = new Button
                    {
                        X = Application.GetRealWidth(16),
                        Width = Application.GetRealWidth(150),
                        Height = Application.GetRealHeight(20),
                        Text =j.ToString(),
                        TextAlignment=TextAlignment.CenterLeft,
                        TextSize = TextSize.text14,
                        TextColor = CSS.CSS_Color.textColor,
                        Gravity=Gravity.CenterVertical,
                    };
                    funControlRow.AddChidren(nameBtn);
                    //遥控器区域
                    Button areaBtn = new Button
                    {
                        X=Application.GetRealWidth(311+16-(40+100)),
                        Width = Application.GetRealWidth(100),
                        Height = Application.GetRealHeight(17),
                        Text = j.ToString(),
                        TextAlignment = TextAlignment.CenterRight,
                        TextSize = TextSize.text12,
                        TextColor = CSS.CSS_Color.textCancelColor,
                        Gravity =Gravity.CenterVertical,
                    };
                    funControlRow.AddChidren(areaBtn);
                    //下一级图标
                    Button nextIconBtn = new Button
                    {
                        X = Application.GetRealWidth(295+16),
                        Width = Application.GetRealWidth(16),
                        Height = Application.GetRealWidth(16),
                        UnSelectedImagePath = "PirIcon/next.png",
                        Gravity = Gravity.CenterVertical,
                    };
                    funControlRow.AddChidren(nextIconBtn);
                    //删除
                    Button delBtn = new Button
                    {
                        Width = Application.GetRealWidth(50),
                        Height = Application.GetRealHeight(22),
                        TextID = StringId.Del,
                        TextAlignment = TextAlignment.Center,
                        TextSize = TextSize.text16,
                        TextColor = CSS.CSS_Color.textWhiteColor,
                        IsBold=true,
                        BackgroundColor= CSS.CSS_Color.textRedColor,
                    };
                    funControlRow.AddRightView(delBtn);
                    //线
                    Button line1Btn = new Button
                    {
                        Y = Application.GetRealHeight(50 - 2),
                        X = Application.GetRealWidth(16),
                        Width = Application.GetRealWidth(311),
                        Height = 1,
                        BackgroundColor = CSS.CSS_Color.viewLine,
                    };
                    funControlRow.AddChidren(line1Btn);
                    if (j == a - 1)
                    {
                        //最后改变一个线的颜色
                        line1Btn.BackgroundColor = CSS.CSS_Color.viewTranslucence;
                        funControlRow.LineColor = CSS.CSS_Color.viewTranslucence;
                    }
                    delBtn.MouseUpEventHandler += (sender,e) => {
 
 
                    };
                }
 
               
 
            }
 
 
         
          
 
        }
    }
}