using System;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using Shared;
namespace HDL_ON.UI.UI2.Intelligence.Automation
{
public class MainView
{
///
/// 记录逻辑自动化父控件
///
public static FrameLayout automationPage;
///
/// 加载逻辑列表显示界面
///
public static void MainShow()
{
automationPage.RemoveAll();
VerticalScrolViewLayout vv = new VerticalScrolViewLayout();
automationPage.AddChidren(vv);
for (int i = 0; i < 2; i++)
{
Logic.LogicList.Add(new Logic { name = "123456" });
}
for (int i = 0; i < Logic.LogicList.Count; i++)
{
///上下间隔12像素
vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) });
LogicView.SingleLogicView logicView = new LogicView.SingleLogicView();
vv.AddChidren(logicView.FLayoutView());
logicView.btnLogicName.Text = i.ToString();
logicView.btnWeekText.Text = "每天";
}
if (Logic.LogicList.Count == 0)
{
Button btnTipNot = new Button()
{
Gravity = Gravity.CenterHorizontal,
Y = Application.GetRealHeight(120),
Width = Application.GetRealWidth(180),
Height = Application.GetRealWidth(180),
UnSelectedImagePath = "TipNot.png",
};
automationPage.AddChidren(btnTipNot);
Button btnTipNotText = new Button()
{
Y = btnTipNot.Bottom,
Height = Application.GetRealWidth(100),
TextID = StringId.TipNotOpen,
TextAlignment = TextAlignment.Center,
TextColor = CSS.CSS_Color.TextualColor,
TextSize = CSS.CSS_FontSize.PromptFontSize_FirstLevel,
};
automationPage.AddChidren(btnTipNotText);
}
}
///
/// 按+跳转到逻辑界面的方法
///
public static void SkipAddLogicPage()
{
Logic.currlogic = new Logic();
var addLogic = new AddLogic();
MainPage.BasePageView.AddChidren(addLogic);
addLogic.Show();
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
}
}
}