HDL Home App 第二版本 旧平台金堂用 正在使用
hxb
2022-08-30 25429f085093d89d543a0b90e30d0d62d1b7dac9
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
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.MainPage
{
    /// <summary>
    /// App公告界面
    /// </summary>
    public class AppNoticeForm : FrameLayout
    {
        #region ■ 变量声明___________________________
 
        /// <summary>
        /// 结束事件
        /// </summary>
        public Action FinishEvent = null;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// App公告界面
        /// </summary>
        public void Show()
        {
            this.BackgroundColor = 0x7f000000;
 
            //白色背景
            var frameWhite = new FrameLayout();
            frameWhite.Y = Application.GetRealHeight(252);
            frameWhite.Height = Application.GetRealHeight(1255);
            frameWhite.Width = Application.GetRealWidth(860);
            frameWhite.BackgroundColor = UserCenter.UserCenterColor.Current.White;
            frameWhite.Radius = (uint)Application.GetRealWidth(17);
            frameWhite.Gravity = Gravity.CenterHorizontal;
            this.AddChidren(frameWhite);
 
            //公告
            var btnNotice = new UserCenter.NormalViewControl(frameWhite.Width, Application.GetRealHeight(65), false);
            btnNotice.TextSize = 20;
            btnNotice.TextAlignment = TextAlignment.Center;
            btnNotice.TextID = R.MyInternationalizationString.uNotice;
            btnNotice.Y = Application.GetRealHeight(48);
            frameWhite.AddChidren(btnNotice);
 
            //加载的内容
            var webView = new WebView();
            webView.Y = btnNotice.Bottom + Application.GetRealHeight(70);
            webView.Height = Application.GetRealHeight(868);
            webView.Width = frameWhite.Width - Application.GetRealWidth(23) * 2;
            webView.Gravity = Gravity.CenterHorizontal;
            frameWhite.AddChidren(webView);
#if Android
            webView.LoadRequest("https://developer.hdlcontrol.com/AnnouncementAndriod.html");
#endif
#if iOS
            webView.LoadRequest("https://developer.hdlcontrol.com/AnnouncementIos.html");
#endif
 
            //好的
            var btnOk = new UserCenter.BottomClickButton();
            btnOk.Width = frameWhite.Width - Application.GetRealWidth(173);
            btnOk.Y = webView.Bottom + Application.GetRealHeight(23);
            btnOk.TextID = R.MyInternationalizationString.uWell;
            frameWhite.AddChidren(btnOk);
            btnOk.ButtonClickEvent += (sender, e) =>
            {
                this.RemoveFromParent();
 
                this.FinishEvent?.Invoke();
                this.FinishEvent = null;
            };
        }
#endregion
    }
}