using System;
using Shared;
using HDL_ON.UI.CSS;
using System.Collections.Generic;
namespace HDL_ON.UI
{
///
/// 功能介绍
///
public class FunctionIntroductionPage : FrameLayout
{
FrameLayout bodyView;
///
///
///
FrameLayout emptyTipFrameLayout;
///
/// 当前
///
VerticalScrolViewLayout bodyScrolView;
///
/// 内容为空提示View
///
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();
}
///
/// 添加内容为空提示页面
///
void AddEmptyTipView()
{
emptyTipView = new EmptyTipView()
{
Gravity = Gravity.Center
};
bodyView.AddChidren(emptyTipView);
}
///
/// 加载区域选择RowView
///
///
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 eventHandler = (sender, e) =>
{
new WebViewDialog().LoadPage(functionInfo.Title, functionInfo.Url);
};
btnTilte.MouseUpEventHandler = eventHandler;
btnSubtitle.MouseUpEventHandler = eventHandler;
btnGo.MouseUpEventHandler = eventHandler;
}
#region 测试
List list = new List();
///
///
///
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
}
///
/// 帮助网页地址
///
[System.Serializable]
public class HelpURLInfo
{
///
///
///
public string Title;
///
///
///
public string CreateTime;
///
///
///
public string Url;
}
}