WJC
2020-03-17 f6e34a69f1d1e0b0b3a6252fe20acddca7fe56e5
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
using System;
using Shared.Common;
 
namespace Shared.Phone.Device.CurtainPanel
{
    public class ButtonSet : FrameLayout
    {
        public ButtonSet()
        {
        }
        /// <summary>
        /// 最上面块View
        /// </summary>
        public RowLayout topRowLayout = new RowLayout
        {
            BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
            Height = Application.GetRealHeight(184),
            LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
        };
        /// <summary>
        /// 标题Btn
        /// </summary>
        public Button toptitleNameBtn = new Button
        {
            TextSize = 17,
            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
            TextAlignment = TextAlignment.CenterLeft,
            X = Application.GetRealWidth(176),
            Width = Application.GetRealWidth(600),
            Height = Application.GetRealHeight(69),
            Y = Application.GetRealHeight(92),
            Text = "按键设置",
            IsBold = true
        };
        /// <summary>
        /// 后退Btn
        /// </summary>
        public Button backBtn = new Button
        {
            Width = Application.GetRealWidth(30),
            Height = Application.GetRealHeight(51),
            X = Application.GetRealWidth(81),
            Y = Application.GetRealHeight(98),
            //Gravity = Gravity.CenterVertical;
            UnSelectedImagePath = "ZigeeLogic/back.png",
        };
        /// <summary>
        /// 增加热键大小Btn
        /// </summary>
        public Button clickBtn = new Button
        {
            Width = Application.GetRealWidth(81 + 51),
            Height = Application.GetRealHeight(58 + 40),
            Y = Application.GetRealHeight(98 - 40),
        };
        public VerticalScrolViewLayout verticalScrolView = new VerticalScrolViewLayout
        {
            Y = Application.GetRealHeight(184),
            Height = Application.GetRealHeight(1920 - 184),
            Width = Application.GetRealWidth(1080),
            BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor
        };
        /// <summary>
        /// 显示点击效果btn
        /// </summary>
        Button btnClick = new Button();
        public void Show()
        {
            this.AddChidren(topRowLayout);
            topRowLayout.AddChidren(toptitleNameBtn);
            topRowLayout.AddChidren(backBtn);
            topRowLayout.AddChidren(clickBtn);
            this.AddChidren(verticalScrolView);
 
            FrameLayout frameLayout = new FrameLayout
            {
                Height = Application.GetRealHeight(700),
                Width = Application.GetRealWidth(1080),
            };
            verticalScrolView.AddChidren(frameLayout);
 
            Button iconBtn = new Button
            {
                Y = Application.GetRealHeight(160),
                X = Application.GetRealWidth(360),
                UnSelectedImagePath = "Item/C_Panel.png",
                Width = Application.GetRealWidth(366),
                Height = Application.GetRealWidth(366),
            };
            frameLayout.AddChidren(iconBtn);
            for (int i = 1; i < 5; i++)
            {
 
                Button selectedIcon = new Button
                {
                    SelectedImagePath = "Item/selected_Panel.png",
                    Width = Application.GetRealWidth(156),
                    Height = Application.GetRealWidth(156),
                };
                frameLayout.AddChidren(selectedIcon);
 
                Button selectedText = new Button
                {
                    Width = Application.GetRealWidth(120),
                    Height = Application.GetRealWidth(38),
                    TextSize=5,
                    TextColor=ZigbeeColor.Current.LogicBtnNotSelectedColor,
                };
                frameLayout.AddChidren(selectedText);
                switch (i)
                {
                    case 1:
                        {
                            selectedIcon.Y = Application.GetRealHeight(160 + 26);
                            selectedIcon.X = Application.GetRealWidth(360 + 29);
                            selectedIcon.BackgroundColor = 0xff674746;
 
                            selectedText.Y = Application.GetRealHeight(160 + 26 + 63);
                            selectedText.X = Application.GetRealWidth(360 + 29 + 20);
                            selectedText.Text = "窗帘开/停";
                        }
                        break;
                    case 2:
                        {
                            selectedIcon.Y = Application.GetRealHeight(160 + 26);
                            selectedIcon.X = Application.GetRealWidth(360 + 29 + 156);
                            selectedIcon.BackgroundColor = 0xff888906;
 
                            selectedText.Y = Application.GetRealHeight(160 + 26 + 63);
                            selectedText.X = Application.GetRealWidth(360 + 29 + 156 + 14);
                            selectedText.Text = "窗帘关/停";
                        }
                        break;
                    case 3:
                        {
                            selectedIcon.Y = Application.GetRealHeight(160 + 26 + 156);
                            selectedIcon.X = Application.GetRealWidth(360 + 29);
                            selectedIcon.BackgroundColor = 0xff342345;
 
                            selectedText.Y = Application.GetRealHeight(160 + 26 + 156 + 46);
                            selectedText.X = Application.GetRealWidth(360 + 29 + 20);
                            selectedText.Text = "窗帘开/停";
                        }
                        break;
                    case 4:
                        {
                            selectedIcon.Y = Application.GetRealHeight(160 + 26 + 156);
                            selectedIcon.X = Application.GetRealWidth(360 + 29 + 156);
                            selectedIcon.BackgroundColor = 0xff568451;
 
 
                            selectedText.Y = Application.GetRealHeight(160 + 26 + 156 + 46);
                            selectedText.X = Application.GetRealWidth(360 + 29 +156+ 14);
                            selectedText.Text = "窗帘关/停";
                        }
                        break;
                }
                selectedIcon.MouseUpEventHandler += (sen, e) =>
                {
                    //btnClick.IsSelected = false;
                    //btnClick = selectedIcon;
                    //selectedIcon.IsSelected = true;
                };
 
            }
 
        }
    }
}