黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
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
using System;
//using Android.Icu.Lang;
 
namespace Shared.Phone.UserCenter.DoorLock
{
    public class DoorlockDialog : FrameLayout
    {
        /// <summary>
        /// 门锁弹窗
        /// </summary>
        /// <param name="dialog"></param>
        /// <param name="title"></param>
        public DoorlockDialog(Dialog dialog, string title)
        {
            this.dialog = dialog;
            this.title = title;
        }
        /// <summary>
        /// 弹窗标题
        /// </summary>
        public string title = string.Empty;
        public Dialog dialog;
 
        /// <summary>
        /// 弹窗标题栏下的线条
        /// </summary>
        public Button dialogLine = new Button
        {
            Height = 1,
            Y = Application.GetRealHeight(380),
            BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
        };
 
        /// <summary>
        /// 弹窗取消按键
        /// </summary>
        public Button dialogBtnCancel = new Button
        {
            TextID = R.MyInternationalizationString.Cancel,
            TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
            TextSize = 14,
        };
 
        /// <summary>
        /// 弹窗确认按键
        /// </summary>
        public Button dialogBtnConfirm = new Button
        {
            TextID = R.MyInternationalizationString.confrim,
            TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
            TextSize = 14,
        };
 
        /// <summary>
        /// 弹窗中部布局
        /// </summary>
        public FrameLayout dialogMidFraFrameLayout = new FrameLayout
        {
            Height = Application.GetRealHeight(58),
            X = Application.GetRealWidth(190),
            Y = Application.GetRealHeight(202),
        };
 
        /// <summary>
        /// 弹窗中部文本
        /// </summary>
        public Button dialogMidText = new Button
        {
            TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
            TextSize = 14,
            TextAlignment = TextAlignment.Center,
        };
 
        /// <summary>
        /// 弹窗阴影背景
        /// </summary>
        public FrameLayout flMain = new FrameLayout
        {
            BackgroundColor = 0x00000000,
        };
 
        /// <summary>
        /// 弹窗显示
        /// </summary>
        public void Show()
        {
            dialog.Show();
            dialog.AddChidren(flMain);
            flMain.MouseUpEventHandler += (sender11, e11) =>
            {
                dialog.Close();
            };
 
            var dialogFrameLayout = new FrameLayout()
            {
                Height = Application.GetRealHeight(380 + 127),
                Width = Application.GetRealWidth(792),
                Y = Application.GetRealHeight(691 - 184),
                X = Application.GetRealWidth(144),
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                Radius = 6,
            };
            flMain.AddChidren(dialogFrameLayout);
 
            var dialogTitle = new Button()
            {
                Width = Application.GetRealWidth(492),
                Height = Application.GetRealHeight(63),
                X = Application.GetRealWidth(150),
                Y = Application.GetRealHeight(69),
                Text = title,
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 16,
            };
            #region 底部圆角UI 
            var rFrameLayout0 = new FrameLayout
            {
                Width = Application.GetRealWidth(397),
                Height = Application.GetRealHeight(50),
                Y = Application.GetRealHeight(380) + 1,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout,
            };
 
            var rFrameLayout1 = new FrameLayout
            {
                Width = Application.GetRealWidth(398),
                Height = Application.GetRealHeight(50),
                X = Application.GetRealWidth(397),
                Y = Application.GetRealHeight(380) + 1,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
            };
 
            var rFrameLayout2 = new FrameLayout
            {
                Width = Application.GetRealWidth(50),
                Height = Application.GetRealHeight(128) - 1,
                X = Application.GetRealWidth(397 - 50),
                Y = Application.GetRealHeight(380) + 1,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout,
            };
 
            var rFrameLayout3 = new FrameLayout
            {
                Width = Application.GetRealWidth(50),
                Height = Application.GetRealHeight(128) - 1,
                X = Application.GetRealWidth(397),
                Y = Application.GetRealHeight(380) + 1,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
            };
 
            var r1FrameLayout = new FrameLayout
            {
                Width = Application.GetRealWidth(397),
                Height = Application.GetRealHeight(128) - 1,
                Y = Application.GetRealHeight(380) + 1,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout,
                Radius = 6,
            };
 
            var r2FrameLayout = new FrameLayout
            {
                Width = Application.GetRealWidth(398),
                Height = Application.GetRealHeight(128) - 1,
                X = Application.GetRealWidth(397),
                Y = Application.GetRealHeight(380) + 1,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                Radius = 6,
            };
            dialogFrameLayout.AddChidren(rFrameLayout0);
            dialogFrameLayout.AddChidren(rFrameLayout1);
            dialogFrameLayout.AddChidren(rFrameLayout2);
            dialogFrameLayout.AddChidren(rFrameLayout3);
            dialogFrameLayout.AddChidren(r1FrameLayout);
            dialogFrameLayout.AddChidren(r2FrameLayout);
            #endregion 
            dialogFrameLayout.AddChidren(dialogTitle);
            dialogFrameLayout.AddChidren(dialogMidFraFrameLayout);
            dialogFrameLayout.AddChidren(dialogLine);
            r2FrameLayout.AddChidren(dialogBtnConfirm);
            r1FrameLayout.AddChidren(dialogBtnCancel);
        }
    }
}