using System;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
public partial class FunctionBaseInfoSetPage : FrameLayout
{
#region 控件列表
FrameLayout bodyView;
///
/// 功能名称显示按钮
///
Button btnFunctionName;
///
/// 功能名称编辑按钮
///
Button btnEditName;
///
/// 位置信息显示按钮
///
Button btnLocationValues;
///
/// 位置信息跳转编辑按钮
///
Button btnLocationInfoRight;
#endregion
#region 局部变量
Function function;
///
/// 后退时,刷新之前界面的显示信息
///
Action actionRefresh;
#endregion
public FunctionBaseInfoSetPage(Function func, Action action)
{
bodyView = this;
function = func;
actionRefresh = action;
}
///
/// 加载界面
///
public void LoadPage()
{
bodyView.BackgroundColor = CSS_Color.BackgroundColor;
new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(actionRefresh);
#region name view
var nameView = new FrameLayout()
{
Y = Application.GetRealHeight(64),
Height = Application.GetRealHeight(50),
BackgroundColor = CSS_Color.MainBackgroundColor,
};
bodyView.AddChidren(nameView);
var btnNameText = new Button()
{
X = Application.GetRealWidth(16),
Width = Application.GetRealWidth(160),
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.SubheadingFontSize,
TextID = StringId.Name,
};
nameView.AddChidren(btnNameText);
btnFunctionName = new Button()
{
X = Application.GetRealWidth(186),
Width = Application.GetRealWidth(137),
TextAlignment = TextAlignment.CenterRight,
TextColor = CSS_Color.PromptingColor1,
TextSize = CSS_FontSize.TextFontSize,
Text = function.name,
};
nameView.AddChidren(btnFunctionName);
btnEditName = new Button()
{
X = Application.GetRealWidth(333),
Gravity = Gravity.CenterVertical,
Width = Application.GetMinRealAverage(28),
Height = Application.GetMinRealAverage(28),
UnSelectedImagePath = "Public/Edit.png",
};
nameView.AddChidren(btnEditName);
nameView.AddChidren(
new Button()
{
Gravity = Gravity.CenterHorizontal,
Y = Application.GetRealHeight(49),
BackgroundColor = CSS_Color.DividingLineColor,
Width = Application.GetRealWidth(343),
Height = Application.GetRealHeight(1)
});
#endregion
#region 位置管理
var locationMagtView = new FrameLayout()
{
Y = nameView.Bottom,
Height = Application.GetRealHeight(55),
BackgroundColor = CSS_Color.MainBackgroundColor,
};
bodyView.AddChidren(locationMagtView);
var btnLocationMagtTitle = new Button()
{
X = Application.GetRealWidth(16),
Width = Application.GetRealWidth(160),
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.SubheadingFontSize,
TextID = StringId.LocationManagement,
};
locationMagtView.AddChidren(btnLocationMagtTitle);
btnLocationValues = new Button()
{
X = Application.GetRealWidth(186),
Width = Application.GetRealWidth(137),
TextAlignment = TextAlignment.CenterRight,
TextColor = CSS_Color.PromptingColor1,
TextSize = CSS_FontSize.TextFontSize,
Text = function.GetRoomListName(),
};
locationMagtView.AddChidren(btnLocationValues);
btnLocationInfoRight = new Button()
{
X = Application.GetRealWidth(339),
Gravity = Gravity.CenterVertical,
Width = Application.GetMinRealAverage(16),
Height = Application.GetMinRealAverage(16),
UnSelectedImagePath = "Public/RightIcon.png",
};
locationMagtView.AddChidren(btnLocationInfoRight);
locationMagtView.AddChidren(
new Button()
{
Gravity = Gravity.CenterHorizontal,
Y = Application.GetRealHeight(54),
BackgroundColor = CSS_Color.DividingLineColor,
Width = Application.GetRealWidth(343),
Height = Application.GetRealHeight(1)
});
#endregion
#region 共享
//var sharedView = new FrameLayout()
//{
// Y = locationMagtView.Bottom,
// Height = Application.GetRealHeight(55),
// BackgroundColor = CSS_Color.MainBackgroundColor,
//};
//bodyView.AddChidren(sharedView);
//var btnSharedText = new Button()
//{
// X = Application.GetRealWidth(16),
// Width = Application.GetRealWidth(160),
// TextAlignment = TextAlignment.CenterLeft,
// TextColor = CSS_Color.FirstLevelTitleColor,
// TextSize = CSS_FontSize.SubheadingFontSize,
// TextID = StringId.Shared,
//};
//sharedView.AddChidren(btnSharedText);
//var btnSharedRight = new Button()
//{
// X = Application.GetRealWidth(339),
// Gravity = Gravity.CenterVertical,
// Width = Application.GetMinRealAverage(16),
// Height = Application.GetMinRealAverage(16),
// UnSelectedImagePath = "Public/RightIcon.png",
//};
//sharedView.AddChidren(btnSharedRight);
//sharedView.AddChidren(
// new Button()
// {
// Gravity = Gravity.CenterHorizontal,
// Y = Application.GetRealHeight(54),
// BackgroundColor = CSS_Color.DividingLineColor,
// Width = Application.GetRealWidth(343),
// Height = Application.GetRealHeight(1)
// });
#endregion
#if stage2
#region 添加到桌面
var addToDesktopView = new FrameLayout()
{
Y = locationMagtView.Bottom,
Height = Application.GetRealHeight(55),
BackgroundColor = CSS_Color.MainBackgroundColor,
};
bodyView.AddChidren(addToDesktopView);
var btnAddToDesktopText = new Button()
{
X = Application.GetRealWidth(16),
Width = Application.GetRealWidth(160),
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.SubheadingFontSize,
TextID = StringId.AddToDesktop,
};
addToDesktopView.AddChidren(btnAddToDesktopText);
var btnAddToDesktopRight = new Button()
{
X = Application.GetRealWidth(339),
Gravity = Gravity.CenterVertical,
Width = Application.GetMinRealAverage(16),
Height = Application.GetMinRealAverage(16),
UnSelectedImagePath = "Public/RightIcon.png",
};
addToDesktopView.AddChidren(btnAddToDesktopRight);
#endregion
#endif
LoadEventList();
}
}
}