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
|
}
|
}
|