CrabtreeOn,印度客户定制APP,迁移2.0平台版本
JLChen
2022-01-12 407fae6f07a2a982a2a814c2f145c40733c966cb
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
using System;
using System.Collections.Generic;
 
namespace Shared.SimpleControl.Phone
{
    /// <summary>
    /// BasePage
    /// </summary>
    public class BasePage : FrameLayout
    {
        #region TopView
        /// <summary>
        /// 顶部导航栏背景View
        /// </summary>
        public FrameLayout TopView;
        /// <summary>
        /// 返回按钮
        /// </summary>
        public Button topBackBtn;
        /// <summary>
        /// 标题
        /// </summary>
        public Button topTitleBtn;
        /// <summary>
        /// 右边菜单按钮
        /// </summary>
        public Button topItemButton;
        #endregion
        /// <summary>
        /// 
        /// </summary>
        public FrameLayout BaseContentView;
 
 
        /// <summary>
        /// 
        /// </summary>
        public BasePage()
        {
            BackgroundColor = SkinStyle.Current.MainColor;
        }
 
        /// <summary>
        /// 加载页面
        /// </summary>
        public virtual void ShowPage()
        {
            #region ---TopView---
            TopView = new FrameLayout()
            {
                Y = Application.GetRealHeight(36),
                Height = Application.GetRealHeight(90),
                BackgroundColor = SkinStyle.Current.MainColor,
            };
            AddChidren(TopView);
 
            topBackBtn = new Button()
            {
                Height = Application.GetRealHeight(90),
                Width = Application.GetRealWidth(85),
                UnSelectedImagePath = "Item/Back.png",
                SelectedImagePath = "Item/BackSelected.png",
            };
            TopView.AddChidren(topBackBtn);
            topBackBtn.MouseUpEventHandler += (sender, e) => {
                (Parent as PageLayout).PageIndex -= 1;
            };
 
            topTitleBtn = new Button()
            {
                Width = Application.GetMinRealAverage(400),
                Height = Application.GetMinRealAverage(90),
                TextColor = SkinStyle.Current.TextColor1,
                Gravity = Gravity.CenterHorizontal,
                TextAlignment = TextAlignment.Center,
                TextSize = 20,
            };
            TopView.AddChidren(topTitleBtn);
 
            topItemButton = new Button()
            {
                Width = Application.GetMinRealAverage(55),
                Height = Application.GetMinRealAverage(55),
                UnSelectedImagePath = "Item/+.png",
                SelectedImagePath = "Item/+.png",
                Gravity = Gravity.CenterVertical,
                X = Application.GetRealWidth(640 - 80),
            };
            TopView.AddChidren(topItemButton);
            #endregion
 
            #region
 
            BaseContentView = new FrameLayout()
            {
                Y = TopView.Bottom,
                Width = LayoutParams.MatchParent,
                Height = Application.GetRealHeight(Application.DesignHeight) - TopView.Bottom,
                BackgroundColor = SkinStyle.Current.ViewColor,
            };
            AddChidren(BaseContentView);
 
            #endregion
 
        }
 
        /// <summary>
        /// 关闭页面
        /// </summary>
        public void BackAction()
        {
            (Parent as PageLayout).PageIndex -= 1;
        }
 
    }
 
 
}