黄学彪
2020-12-17 6c0c799c1f5da2d215ec8d9df9b92b3d1948dc14
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 Shared;
using HDL_ON.UI.CSS;
using System.Collections.Generic;
 
namespace HDL_ON.UI
{
    /// <summary>
    /// 功能介绍
    /// </summary>
    public class FunctionIntroductionPage : FrameLayout
    {
        FrameLayout bodyView;
        /// <summary>
        /// 
        /// </summary>
        FrameLayout emptyTipFrameLayout;
        /// <summary>
        /// 当前
        /// </summary>
        VerticalScrolViewLayout bodyScrolView;
        /// <summary>
        /// 内容为空提示View
        /// </summary>
        EmptyTipView emptyTipView;
 
        public FunctionIntroductionPage()
        {
            bodyView = this;
        }
 
        public void LoadPage()
        {
            new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionIntroduced)).LoadTopView();
 
            int bodyY = Application.GetRealHeight(64);
            bodyScrolView = new VerticalScrolViewLayout()
            {
                Y = bodyY,
                Height = bodyView.Height - bodyY,
                BackgroundColor = CSS_Color.MainBackgroundColor,
            };
            bodyView.AddChidren(bodyScrolView);
 
            AddEmptyTipView();
 
            //TestLoad();
        }
 
        /// <summary>
        /// 添加内容为空提示页面
        /// </summary>
        void AddEmptyTipView()
        {
            emptyTipView = new EmptyTipView()
            {
                Gravity = Gravity.Center
            };
            bodyView.AddChidren(emptyTipView);
        }
 
        /// <summary>
        /// 加载区域选择RowView
        /// </summary>
        /// <param name="VerticalScrolViewMiddle"></param>
        void AddRowView(VerticalScrolViewLayout VerticalScrolViewMiddle, HelpURLInfo functionInfo)
        {
            var rowView = new FrameLayout()
            {
                Height = Application.GetRealHeight(54),
            };
            VerticalScrolViewMiddle.AddChidren(rowView);
 
            //标题
            var btnTilte = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = Application.GetRealHeight(8),
                Width = Application.GetRealWidth(320),
                Height = Application.GetRealHeight(20),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
                Text = functionInfo.Title
            };
            rowView.AddChidren(btnTilte);
 
            //副标题
            var btnSubtitle = new Button()
            {
                X = Application.GetRealWidth(16),
                Y = btnTilte.Bottom + Application.GetRealHeight(4),
                Width = Application.GetRealWidth(320),
                Height = Application.GetRealHeight(14),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                Text = functionInfo.CreateTime
            };
 
            rowView.AddChidren(btnSubtitle);
 
            var btnGo = new Button()
            {
                X = Application.GetRealWidth(343),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetMinRealAverage(16),
                Height = Application.GetMinRealAverage(16),
                UnSelectedImagePath = "Public/Right.png",
            };
 
            rowView.AddChidren(btnGo);
 
            var lineView = new LineView(rowView.Height);
            rowView.AddChidren(lineView);
 
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                new WebViewDialog().LoadPage(functionInfo.Title, functionInfo.Url);
            };
 
            btnTilte.MouseUpEventHandler = eventHandler;
            btnSubtitle.MouseUpEventHandler = eventHandler;
            btnGo.MouseUpEventHandler = eventHandler;
        }
 
        #region 测试
        List<HelpURLInfo> list = new List<HelpURLInfo>();
        /// <summary>
        /// 
        /// </summary>
        void TestLoad()
        {
            list.Add(new HelpURLInfo()
            {
                Title = "HDL ON PRO 1.0.10 主要更新",
                CreateTime = "11月26",
                Url = Constant.URL_PRIVACYPOLICY,
            });
 
            list.Add(new HelpURLInfo()
            {
                Title = "HDL ON PRO 1.0.09 主要更新",
                CreateTime = "10月26",
                Url = Constant.URL_PRIVACYPOLICY,
            });
 
            list.Add(new HelpURLInfo()
            {
                Title = "HDL ON PRO 1.0.08 主要更新",
                CreateTime = "09月26",
                Url = Constant.URL_PRIVACYPOLICY,
            });
 
            foreach (var info in list)
            {
                AddRowView(bodyScrolView, info);
            }
        }
        #endregion
    }
 
 
    /// <summary>
    /// 帮助网页地址
    /// </summary>
    [System.Serializable]
    public class HelpURLInfo
    {
        /// <summary>
        /// 
        /// </summary>
        public string Title;
        /// <summary>
        /// 
        /// </summary>
        public string CreateTime;
        /// <summary>
        /// 
        /// </summary>
        public string Url;
    }
}