using System;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.ArmCenter
{
public class ArmCenterPage : FrameLayout
{
///
/// 主窗体
///
FrameLayout bodyView;
public ArmCenterPage()
{
bodyView = this;
}
public void LoadPage()
{
Action skipAction = () => {
};
new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView_ArmCenter(skipAction);
VerticalScrolViewLayout contentView = new VerticalScrolViewLayout()
{
Height = Application.GetRealHeight(603),
BackgroundColor = CSS_Color.MainBackgroundColor,
ScrollEnabled = false,
};
bodyView.AddChidren(contentView);
contentView.AddChidren(new Button()
{
Height =Application.GetRealWidth(32),
});
//安防状态背景图
Button btnArmTipIcon = new Button()
{
Gravity = Gravity.CenterHorizontal,
Width = Application.GetRealWidth(198),
Height = Application.GetRealWidth(198),
UnSelectedImagePath = "FunctionIcon/ArmCenter/NoDefenseBigIcon.png",
SelectedImagePath = "FunctionIcon/ArmCenter/InDefenseBigIcon.png",
};
contentView.AddChidren(btnArmTipIcon);
contentView.AddChidren(new Button()
{
Height = Application.GetRealWidth(16),
});
//自定义布防标题
Button btnCustomDeploymentTitle = new Button()
{
X = Application.GetRealWidth(24),
Height = Application.GetRealWidth(54),
TextAlignment = TextAlignment.CenterLeft,
IsBold = true,
TextSize = CSS_FontSize.SubheadingFontSize,
TextColor = CSS_Color.FirstLevelTitleColor,
TextID = StringId.CustomDeployment,
};
contentView.AddChidren(btnCustomDeploymentTitle);
HorizontalScrolViewLayout customDeploymentView = new HorizontalScrolViewLayout()
{
X = Application.GetRealWidth(23),
Height = Application.GetRealWidth(80),
};
contentView.AddChidren(customDeploymentView);
}
}
///
/// 安防自定义控件
///
public class ArmDiyView
{
public FrameLayout ArmDiyButton;
///
///
///
/// 图片路径
/// 显示文本
public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text)
{
ArmDiyButton = new FrameLayout()
{
Width = Application.GetRealWidth(82),
Height = Application.GetRealWidth(80),
};
Button btnIcon = new Button()
{
Gravity = Gravity.CenterHorizontal,
Width = Application.GetRealWidth(40),
Height = Application.GetRealWidth(40),
UnSelectedImagePath = UnSelectedIconPath,
SelectedImagePath = SelectedIconPath,
};
ArmDiyButton.AddChidren(btnIcon);
Button btnText = new Button()
{
Y = Application.GetRealWidth(40),
Height = Application.GetRealWidth(41),
Text = Text,
TextAlignment = TextAlignment.Center,
TextColor = CSS_Color.TextualColor,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
};
ArmDiyButton.AddChidren(btnText);
}
}
}