using System;
|
using System.Collections.Generic;
|
using HDL_ON.Entity;
|
using HDL_ON.UI;
|
using HDL_ON.UI.CSS;
|
using Shared;
|
|
namespace HDL_ON.UI
|
{
|
public partial class ClassificationPage : FrameLayout
|
{
|
|
#region 控件列表
|
#region 顶部控件
|
FrameLayout bodyView;
|
/// <summary>
|
/// 房间分页
|
/// </summary>
|
Button btnRoomTilte;
|
/// <summary>
|
/// 功能分类
|
/// </summary>
|
Button btnFuncTitle;
|
#endregion
|
|
#region 房间区域
|
/// <summary>
|
/// 房间内容显示区域
|
/// </summary>
|
FrameLayout roomContentView;
|
#region 房间底部切换显示区域
|
/// <summary>
|
/// 房间区域,顶部区域
|
/// </summary>
|
FrameLayout roomTopView;
|
/// <summary>
|
/// 楼层选择下拉图标
|
/// </summary>
|
Button btnFoorDownIcon;
|
/// <summary>
|
/// 楼层显示
|
/// </summary>
|
Button btnFoor;
|
/// <summary>
|
/// 显示方式切换按钮
|
/// </summary>
|
Button btnSwitchDipaly;
|
#endregion
|
/// <summary>
|
/// 房间列表区域
|
/// </summary>
|
VerticalScrolViewLayout roomListView;
|
/// <summary>
|
/// 房间区域集合
|
/// </summary>
|
List<FrameLayout> roomViewList;
|
#endregion
|
|
|
#endregion
|
|
public ClassificationPage()
|
{
|
bodyView = this;
|
}
|
|
public void LoadPage()
|
{
|
bodyView.BackgroundColor = CSS_Color.BackgroundColor;
|
#region top
|
FrameLayout topView = new FrameLayout()
|
{
|
Height = Application.GetRealHeight(64),
|
BackgroundColor = CSS_Color.TopViewColor,
|
};
|
bodyView.AddChidren(topView);
|
|
btnRoomTilte = new Button()
|
{
|
Y = Application.GetRealHeight(30),
|
Width = Application.GetRealWidth(170),
|
Height = Application.GetRealHeight(25),
|
TextAlignment = TextAlignment.CenterRight,
|
TextSize = CSS_FontSize.HeadlineFontSize,
|
TextColor = CSS_Color.PromptingColor1,
|
SelectedTextColor = CSS_Color.MainColor,
|
TextID = StringId.Rooms,
|
IsSelected = true
|
};
|
topView.AddChidren(btnRoomTilte);
|
|
btnFuncTitle = new Button()
|
{
|
X = Application.GetRealWidth(209),
|
Y = Application.GetRealHeight(30),
|
Width = Application.GetRealWidth(170),
|
Height = Application.GetRealHeight(25),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextSize = CSS_FontSize.TextFontSize,
|
TextColor = CSS_Color.PromptingColor1,
|
SelectedTextColor = CSS_Color.MainColor,
|
TextID = StringId.Devices,
|
};
|
topView.AddChidren(btnFuncTitle);
|
|
#endregion
|
|
|
|
#region 房间区域
|
/// <summary>
|
/// 房间内容显示区域
|
/// </summary>
|
roomContentView = new FrameLayout()
|
{
|
Y = Application.GetRealHeight(64),
|
Height = Application.GetRealHeight(52),
|
BackgroundColor = CSS_Color.MainBackgroundColor,
|
};
|
bodyView.AddChidren(roomContentView);
|
#region 房间底部切换显示区域
|
/// <summary>
|
/// 房间区域,顶部区域
|
/// </summary>
|
roomTopView = new FrameLayout()
|
{
|
Height = Application.GetRealHeight(53),
|
};
|
roomContentView.AddChidren(roomTopView);
|
/// <summary>
|
/// 楼层选择下拉图标
|
/// </summary>
|
btnFoorDownIcon = new Button()
|
{
|
Width = Application.GetMinRealAverage(16),
|
Height = Application.GetMinRealAverage(16),
|
X = Application.GetRealWidth(16),
|
Y = Application.GetRealHeight(18),
|
UnSelectedImagePath = "0Common/DownIcon.png",
|
};
|
roomContentView.AddChidren(btnFoorDownIcon);
|
/// <summary>
|
/// 楼层显示
|
/// </summary>
|
btnFoor = new Button()
|
{
|
X = btnFoorDownIcon.Right,
|
Y = Application.GetRealHeight(18),
|
Width = Application.GetRealWidth(200),
|
Height = Application.GetMinRealAverage(16),
|
TextColor = CSS_Color.FirstLevelTitleColor,
|
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
|
TextAlignment = TextAlignment.CenterLeft,
|
Text = UserConfig.Instance.CurFoor,
|
};
|
roomContentView.AddChidren(btnFoor);
|
/// <summary>
|
/// 显示方式切换按钮
|
/// </summary>
|
btnSwitchDipaly = new Button()
|
{
|
X = Application.GetRealWidth(335),
|
Y = Application.GetRealHeight(12),
|
Width = Application.GetMinRealAverage(28),
|
Height = Application.GetMinRealAverage(28),
|
UnSelectedImagePath = "Classification/ToggleDisplayThumbnail.png",//缩略图
|
SelectedImagePath = "Classification/ToggleDisplayLarge.png",
|
};
|
roomContentView.AddChidren(btnSwitchDipaly);
|
#endregion
|
|
|
/// <summary>
|
/// 房间列表区域
|
/// </summary>
|
roomListView = new VerticalScrolViewLayout()
|
{
|
Y = roomContentView.Bottom,
|
Height = Application.GetRealHeight(497 + 10),
|
BackgroundColor = CSS_Color.MainBackgroundColor,
|
};
|
bodyView.AddChidren(roomListView);
|
/// <summary>
|
/// 房间区域集合
|
/// </summary>
|
roomViewList = new List<FrameLayout>();
|
|
foreach (var room in DB_ResidenceData.residenceData.rooms)
|
{
|
var btn = new Button()
|
{
|
Height = Application.GetRealHeight(20),
|
};
|
roomListView.AddChidren(btn);
|
|
var roomView = new FrameLayout()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Width = Application.GetRealWidth(343),
|
Height = Application.GetRealHeight(184),
|
Radius = (uint)Application.GetRealHeight(12),
|
BorderColor = 0x00000000,
|
BorderWidth = 1,
|
BackgroundImagePath = room.backgroundImage
|
};
|
roomListView.AddChidren(roomView);
|
|
roomViewList.Add(roomView);
|
|
|
|
}
|
#endregion
|
|
}
|
}
|
}
|