CrabtreeOn,印度客户定制APP,迁移2.0平台版本
JLChen
2022-01-12 407fae6f07a2a982a2a814c2f145c40733c966cb
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
using System;
using System.Collections.Generic;
 
namespace Shared.SimpleControl.Pad
{
    public class MonitorType : Dialog
    {
        public static MonitorType curView;
        VerticalScrolViewLayout middleVerticalScrolViewLayout;
 
        public MonitorType ()
        {
            showVideoMonitoring ();
        }
 
        void showVideoMonitoring ()
        {
            #region 标题
            var topView = new FrameLayout () {
                Height = Application.GetRealHeight (130),
                BackgroundColor = 0xff000000,
            };
            AddChidren (topView);
 
            var title = new Button () {
                TextAlignment = TextAlignment.Center,
                Text = Language.StringByID (R.MyInternationalizationString.VideoMonitoring),
                TextSize = 19,
                Y = Application.GetRealHeight (10),
            };
            topView.AddChidren (title);
 
            var back = new Button () {
                Height = Application.GetRealHeight (90),
                Width = Application.GetRealWidth (85),
                UnSelectedImagePath = "Item/Back.png",
                SelectedImagePath = "Item/BackSelected.png",
                Y = Application.GetRealHeight (30),
                X = Application.GetRealWidth (10),
            };
            topView.AddChidren (back);
            back.MouseUpEventHandler += (sender, e) => {
                Close ();
            };
 
            var btnl = new Button () {
                Height = 1,
                BackgroundColor = 0xFF2F2F2F,
                Y = topView.Height - 1
            };
            topView.AddChidren (btnl);
            #endregion
 
            var BodyView = new VerticalScrolViewLayout () {
                Y = topView.Bottom,
                Height = Application.GetRealHeight (Application.DesignHeight - 126),
                BackgroundColor = 0xFF2f2f2f,
            };
            AddChidren (BodyView);
 
            for (int i = 0; i < 2; i++) {
                var RowView = new FrameLayout () {
                    Height = Application.GetRealHeight (110),
                    BackgroundColor = 0xFF2f2f2f,
                };
                BodyView.AddChidren (RowView);
 
                var btnIcon = new Button () {
                    Width = Application.GetRealHeight (13),
                    Height = Application.GetRealHeight (13),
                    X = Application.GetRealWidth (50),
                    UnSelectedImagePath = "Item/Point.png",
                    SelectedImagePath = "Item/PointSelected.png",
                    Gravity = Gravity.CenterVertical,
                };
                RowView.AddChidren (btnIcon);
 
                var monitorName = new Button () {
                    X = btnIcon.Right + Application.GetRealWidth (40),
                    Width = Application.GetRealWidth (300),
                    Height = Application.GetRealHeight (110),
                    TextAlignment = TextAlignment.CenterLeft,
                };
                RowView.AddChidren (monitorName);
                if (i == 0) {
                    monitorName.TextID = R.MyInternationalizationString.EZVIZ;
                } else if (i == 1) {
                    monitorName.TextID = R.MyInternationalizationString.URL;
                }
 
                var btnRight = new Button () {
                    Width = Application.GetRealWidth (28),
                    Height = Application.GetRealHeight (40),
                    X = monitorName.Right + Application.GetRealWidth (1520),
                    UnSelectedImagePath = "Item/Right.png",
                    SelectedImagePath = "Item/RightSelected.png",
                    Gravity = Gravity.CenterVertical,
                };
                RowView.AddChidren (btnRight);
 
                var line2 = new Button () {
                    Y = RowView.Height - 1,
                    Height = 2,
                    BackgroundColor = 0xFF000000,
                };
                RowView.AddChidren (line2);
 
                int currentIndex = i;
                EventHandler<MouseEventArgs> eHandler = (sender, e) => {
                    for (int j = 0; j < BodyView.ChildrenCount; j++) {
                        var rowView = BodyView.GetChildren (j);
                    }
                    if (currentIndex == 0) {
                        if (Application.DeviceType == Device.Ios) {
                            //初始化萤石库
                            EZMonitor.Ezviz.LibInit ();
                            //跳转到萤石摄像头
                             EZMonitor.CommonList.AddEzvizMonitor ();
                            //Com.Hdl.ON.CommonList.Go2EZvizMonitor ();
                        } else {
                            //Shared.Ezviz.OpenEzviz ("com.hdl.ezviz");
                        }
                    } else if (currentIndex == 1) {
                        new URLMonitor ().Show ();
                    }
                };
                btnRight.MouseUpEventHandler += eHandler;
                btnIcon.MouseUpEventHandler += eHandler;
                RowView.MouseUpEventHandler += eHandler;
                monitorName.MouseUpEventHandler += eHandler;
            }
        }
    }
}