wxr
2021-06-09 ac2aeba22ed55fd81bd87a373017933ecb49508c
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
using System;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using Shared;
namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View
{
    public class PirView
    {
 
        /// <summary>
        /// 父控件
        /// </summary>
        public FrameLayout devfLayout = new FrameLayout
        {
            Y = Application.GetRealHeight(12),
            X = Application.GetRealWidth(16),
            Width = Application.GetRealWidth(375 - 16 * 2),
            // Height = Application.GetRealHeight(92 + (50 * pirDevice.FunctioList.Count)),
            BackgroundColor = CSS.CSS_Color.view,
            Radius = (uint)Application.GetRealHeight(12),
        };
        /// <summary>
        /// 图标
        /// </summary>
        public 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,
        };
 
        /// <summary>
        /// 名称
        /// </summary>
        public Button deviceNameBtn = new Button
        {
            Y = Application.GetRealHeight(16),
            X = Application.GetRealWidth(72),
            Width = Application.GetRealWidth(120+80),
            Height = Application.GetRealHeight(20),
            //Text = pirDevice.name,
            TextAlignment = TextAlignment.CenterLeft,
            TextSize = TextSize.text14,
            TextColor = CSS.CSS_Color.textColor,
            IsBold = true,
        };
 
        /// <summary>
        /// 当前个数
        /// </summary>
        public TextButton geBtn = new TextButton
        {
            Y = Application.GetRealHeight(40),
            X = Application.GetRealWidth(72),
            Width = Application.GetRealWidth(120),
            Height = Application.GetRealHeight(17),
            //Text = pirDevice.FunctioList.Count.ToString(),
            TextAlignment = TextAlignment.CenterLeft,
            TextSize = TextSize.text12,
            TextColor = CSS.CSS_Color.textConfirmColor,
        };
 
        /// <summary>
        /// 总数
        /// </summary>
        public Button sumBtn = new Button
        {
            Y = Application.GetRealHeight(40),
            Width = Application.GetRealWidth(50),
            Height = Application.GetRealHeight(17),
            Text = "/10",
            TextAlignment = TextAlignment.CenterLeft,
            TextSize = TextSize.text12,
            TextColor = CSS.CSS_Color.textCancelColor,
        };
 
        /// <summary>
        /// 状态图标
        /// </summary>
        public Button stateIconBtn = new Button
        {
            Y = Application.GetRealHeight(23),
            X = Application.GetRealWidth(291-5),
            Width = Application.GetRealWidth(8),
            Height = Application.GetRealWidth(8),
            UnSelectedImagePath ="PirIcon/offline.png",
            SelectedImagePath = "PirIcon/online.png",
        };
 
        /// <summary>
        /// 红外宝状态(在线-离线)
        /// </summary>
        public Button stateTextBtn = new Button
        {
            Y = Application.GetRealHeight(18),
            X = Application.GetRealWidth(303-5),
            Width = Application.GetRealWidth(30+5),
            Height = Application.GetRealHeight(17),
            TextID = StringId.zaixianhwb,
            TextAlignment = TextAlignment.CenterLeft,
            TextSize = TextSize.text12,
            TextColor = CSS.CSS_Color.textRedColor,// CSS.CSS_Color.textColor,
            SelectedTextColor = 0xFF67D569,
            IsBold = true,
        };
        /// <summary>
        /// 线
        /// </summary>
        public 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,
        };
 
        /// <summary>
        /// 点击事件
        /// </summary>
        public Button clickBtn = new Button
        {
            Y = Application.GetRealHeight(12),
            X = Application.GetRealWidth(16),
            Width = Application.GetRealWidth(375 - 16 * 2),
            Height = Application.GetRealHeight(92),
            BackgroundColor = 0x00000000, //CSS.CSS_Color.view,
            Radius = (uint)Application.GetRealHeight(12),
            //Tag = Pir.pirDeviceList[i],
        };
        /// <summary>
        /// view方法
        /// </summary>
        /// <param name="i"></param>
        /// <param name="fLayout"></param>
        public void Show(int i, FrameLayout fLayout)
        {
 
 
            fLayout.AddChidren(devfLayout);
            devfLayout.Height = Application.GetRealHeight(92 + (50 * i));
            devfLayout.AddChidren(priequipmentBtn);
            devfLayout.AddChidren(deviceNameBtn);
            devfLayout.AddChidren(geBtn);
            geBtn.Width = geBtn.GetTextWidth();
            devfLayout.AddChidren(sumBtn);
            sumBtn.X = geBtn.Right;
            sumBtn.TextAlignment = TextAlignment.CenterLeft;
            devfLayout.AddChidren(stateIconBtn);
            devfLayout.AddChidren(stateTextBtn);
            devfLayout.AddChidren(lineBtn);
            devfLayout.AddChidren(clickBtn);
        }
    }
}