using System;
using Shared;
using System.Collections.Generic;
namespace HDL_ON.UI.UI2.Intelligence.Automation.LogicView
{
public class ModeView
{
///
/// 主控件View
///
public FrameLayout frameLayout = new FrameLayout
{
Height = Application.GetRealHeight(50),
BackgroundColor = CSS.CSS_Color.view,
};
///
/// 文本描述
///
public Button btnText = new Button
{
TextSize = TextSize.text14,
Width = Application.GetRealWidth(130),
Height = Application.GetRealHeight(20),
TextColor = CSS.CSS_Color.textColor,
X = Application.GetRealWidth(20),
Gravity = Gravity.CenterVertical,
TextAlignment = TextAlignment.CenterLeft,
};
///
/// 图标
///
public Button btnClickIcon = new Button
{
X = Application.GetRealWidth(303),
Width = Application.GetMinRealAverage(28),
Height = Application.GetMinRealAverage(28),
UnSelectedImagePath = "LogicIcon/weekoff.png",
SelectedImagePath = "LogicIcon/weekon.png",
Gravity = Gravity.CenterVertical,
};
///
/// 线
///
public Button btnLine = new Button
{
Width = Application.GetRealWidth(343),
X = Application.GetRealWidth(16),
Height = 1,
BackgroundColor = CSS.CSS_Color.viewLine,
};
public Button btnClick = new Button
{
Height = Application.GetRealHeight(50),
};
///
/// View的方法
///
///
///
public void FLayoutView(FrameLayout fLayout, List list)
{
/// 主控件
FrameLayout frameLayout1 = new FrameLayout
{
Y = Application.GetRealHeight(460),
Height = Application.GetRealHeight(56 + 150),
Width = Application.GetRealWidth(343),
X = Application.GetRealWidth(16),
BackgroundColor = CSS.CSS_Color.view,
Radius = (uint)Application.GetRealHeight(12),
};
/// 标题Btn
Button btnTitle = new Button
{
TextID = StringId.timeHorizon,
TextSize = TextSize.text16,
TextColor = CSS.CSS_Color.textColor,
IsBold = true,
Width = Application.GetRealWidth(343 - (52 + 4 + 10) * 2),
Height = Application.GetRealHeight(22),
Y = Application.GetRealHeight(17),
X = Application.GetRealWidth(52 + 4 + 10)
};
/// 取消Btn
Button btnCancel = new Button
{
TextID = StringId.cancelSelected,
TextSize = TextSize.text14,
TextColor = CSS.CSS_Color.textCancelColor,
Width = Application.GetRealWidth(52),
Height = Application.GetRealHeight(32),
Y = Application.GetRealHeight(10),
X = Application.GetRealWidth(4)
};
/// 确定Btn
Button btnConfirm = new Button
{
TextID = StringId.confirmSelected,
TextSize = TextSize.text14,
TextColor = CSS.CSS_Color.textConfirmColor,
Width = Application.GetRealWidth(52),
Height = Application.GetRealHeight(32),
X = Application.GetRealWidth(343 - 4 - 52),
Y = Application.GetRealHeight(10),
};
fLayout.AddChidren(frameLayout);
frameLayout1.Y = Application.GetRealHeight(667 - 20 - 56 - 50 * list.Count);
frameLayout1.Height = Application.GetRealHeight(56 + 50 * list.Count);
frameLayout1.AddChidren(btnTitle);
frameLayout1.AddChidren(btnCancel);
frameLayout1.AddChidren(btnConfirm);
for (int j = 0; j < list.Count; j++)
{
frameLayout.Y = Application.GetRealHeight(56 + 50 * j);
frameLayout1.AddChidren(frameLayout);
frameLayout.AddChidren(btnText);
frameLayout.AddChidren(btnClickIcon);
btnLine.Y = frameLayout.Height - 1;
frameLayout.AddChidren(btnLine);
frameLayout.AddChidren(btnClick);
btnClick.Tag = list[j];
}
}
}
}