陈嘉乐
2020-11-26 5b40f1da1d28616de3880857b38357eef7859b64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using Shared;
namespace HDL_ON.UI.UI2.Intelligence.Automation
{
    public class MainView
    {
        //public MainView(FrameLayout layout)
        //{
        //    automationPage = layout;
        //}
        //public static FrameLayout automationPage;
     
        public static void MainShow(FrameLayout automationPage)
        {
            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);
            }
        }
    }
}