陈嘉乐
2020-04-29 38ab16c66df6fc523f2c385fd583a2f2e86a781c
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
using System;
using Shared.Common;
 
namespace Shared.Phone.Device.Logic.LogicView
{
    public class TipView
    {
     
 
        public void ShowTip(FrameLayout fLayout)
        {
            
 
            FrameLayout tipFLayout = new FrameLayout
            {
                X = Application.GetRealWidth(144),
                Y = Application.GetRealHeight(706),
                Width = Application.GetRealWidth(792),
                Height = Application.GetRealHeight(351 + 127),
                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
            };
            fLayout.AddChidren(tipFLayout);
            tipFLayout.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft| HDLUtils.RectCornerTopRight| HDLUtils.RectCornerBottomLeft| HDLUtils.RectCornerBottomRight);
 
            FrameLayout topFrame = new FrameLayout
            {
                Width = Application.GetRealWidth(792),
                Height = Application.GetRealHeight(351),
            };
            tipFLayout.AddChidren(topFrame);
 
            Button tipBtn = new Button
            {
                TextID = R.MyInternationalizationString.Tip,
                TextAlignment = TextAlignment.Center,
                TextColor = ZigbeeColor.Current.LogicTipColor,
                TextSize = 16,
                Y = Application.GetRealHeight(69),
                X = Application.GetRealWidth(150),
                Height = Application.GetRealHeight(63),
                Width = Application.GetRealWidth(492),
            };
            topFrame.AddChidren(tipBtn);
 
 
            Button tipTextBtn = new Button
            {
                Text=Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n"),
                TextAlignment = TextAlignment.Center,
                TextColor = ZigbeeColor.Current.LogicTipTextColor,
                TextSize = 14,
                Y = tipBtn.Bottom + Application.GetRealHeight(35),
                X = Application.GetRealWidth(60),
                Height = Application.GetRealHeight(115),
                Width = Application.GetRealWidth(674),
                IsMoreLines = true,
            };
            topFrame.AddChidren(tipTextBtn);
 
            FrameLayout bottomFrame = new FrameLayout
            {
                Y = topFrame.Bottom,
                Width = Application.GetRealWidth(792),
                Height = Application.GetRealHeight(127),
            };
            tipFLayout.AddChidren(bottomFrame);
 
 
            Button cancelBtn = new Button
            {
                TextAlignment = TextAlignment.Center,
                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                TextSize = 14,
                Height = Application.GetRealHeight(127),
                Width = Application.GetRealWidth(397),
                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                Text="123",
            };
            bottomFrame.AddChidren(cancelBtn);
            cancelBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft );
            Button okBtn = new Button
            {
                TextAlignment = TextAlignment.Center,
                TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                TextSize = 14,
                X = cancelBtn.Right,
                Height = Application.GetRealHeight(127),
                Width = bottomFrame.Width- cancelBtn.Width, 
                BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor,
                Text = "456",
            };
            bottomFrame.AddChidren(okBtn);
            okBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomRight);
            cancelBtn.MouseUpEventHandler += (sender,e) => {
                fLayout.RemoveFromParent();
            };
        }
 
    }
}