using System;
|
using HDL_ON.Entity;
|
using HDL_ON.UI.CSS;
|
using Shared;
|
|
namespace HDL_ON.UI
|
{
|
public partial class RoomPage : FrameLayout
|
{
|
|
#region 控件列表
|
/// <summary>
|
/// 当前窗体
|
/// </summary>
|
FrameLayout bodyView;
|
/// <summary>
|
/// 功能列表集合显示区域
|
/// </summary>
|
//VerticalScrolViewLayout functionListView;
|
#endregion
|
|
#region
|
Room room;
|
#endregion
|
|
public RoomPage(Room r)
|
{
|
bodyView = this;
|
room = r;
|
}
|
|
public void LoadPage()
|
{
|
bodyView.BackgroundColor = CSS_Color.BackgroundColor;
|
new TopViewDiv(bodyView,room.name).LoadTopView();
|
|
var functionListView =new VerticalScrolViewLayout()
|
{
|
Y = Application.GetRealHeight(64),
|
Height = Application.GetRealHeight(603-12),
|
};
|
bodyView.AddChidren(functionListView);
|
|
|
foreach (var function in room.functionData)
|
{
|
functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
|
|
if (function.functionType == "RGB" || function.functionType == "Dimmer")
|
{
|
var functionDiv = new RoomControlZone(function)
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Width = Application.GetRealWidth(343),
|
Height = Application.GetRealHeight(116),
|
Radius = (uint)Application.GetMinRealAverage(12),
|
BorderColor = 0x00FFFFFF,
|
BorderWidth = 1,
|
BackgroundColor = CSS_Color.MainBackgroundColor,
|
Tag = function.functionCategory.ToString() + "-" + function.functionType
|
};
|
functionDiv.LoadFunctionDiv();
|
functionListView.AddChidren(functionDiv);
|
}
|
else
|
{
|
var functionDiv = new RoomControlZone(function)
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Width = Application.GetRealWidth(343),
|
Height = Application.GetRealHeight(96),
|
Radius = (uint)Application.GetMinRealAverage(12),
|
BorderColor = 0x00FFFFFF,
|
BorderWidth = 1,
|
BackgroundColor = CSS_Color.MainBackgroundColor,
|
Tag = function.functionCategory.ToString() + "-" + function.functionType
|
};
|
functionDiv.LoadFunctionDiv();
|
functionListView.AddChidren(functionDiv);
|
}
|
}
|
|
}
|
}
|
}
|