From 7d005a7618e3d7a80d8ede3baf6ecc4bf8019cd5 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 01 九月 2020 15:22:09 +0800
Subject: [PATCH] 2020-09-01
---
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 135 +++++++++++++++++++++++++++++++++-----------
1 files changed, 101 insertions(+), 34 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 1d856e6..c9480f1 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -71,7 +71,7 @@
{
bodyView = this;
roomsShowed = new List<Room>();
- roomsShowed.AddRange(DB_ResidenceData.residenceData.rooms);
+ roomsShowed.AddRange(DB_ResidenceData.rooms);
}
public void LoadPage()
@@ -226,7 +226,6 @@
Width = Application.GetRealWidth(343),
Height = Application.GetRealHeight(184),
Radius = (uint)Application.GetRealWidth(12),
- BackgroundColor = 0xFFFF0000,
Tag = room.sid,
};
roomListView.AddChidren(roomView);
@@ -253,7 +252,7 @@
Y = Application.GetRealHeight(12 - 2),
Width = Application.GetRealWidth(266),
Height = Application.GetRealHeight(22 + 2 + 2),
- Text = room.floor + " " + room.name,
+ Text = room.floorName + room.name,
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.MainBackgroundColor,
TextSize = CSS_FontSize.SubheadingFontSize,
@@ -359,7 +358,8 @@
};
roomListView.AddChidren(btn);
- roomViewbgColor.MouseUpEventHandler += (sender, e) => {
+ roomViewbgColor.MouseUpEventHandler += (sender, e) =>
+ {
var view = new RoomPage(room);
MainPage.BasePageView.AddChidren(view);
view.LoadPage();
@@ -391,7 +391,7 @@
if (DB_ResidenceData.residenceData.functionTypeList.Count > 4)
{
- functionContentView.Height += Application.GetRealHeight((220 * (DB_ResidenceData.residenceData.functionTypeList.Count - 4 - 2) / 2) + 20);
+ functionContentView.Height += Application.GetRealHeight((220 * (DB_ResidenceData.residenceData.functionTypeList.Count - 4 - 2) / 2) + 20);
}
functionsPageView.AddChidren(functionContentView);
@@ -476,8 +476,8 @@
case ShowFunction.Light:
#region Light
btnName.TextID = StringId.Lights;
- functionCount = DB_ResidenceData.residenceData.functionList.lights.Count;
- functionOnCount = DB_ResidenceData.residenceData.functionList.lights.FindAll((obj) => obj.on_off == "on" ).Count;
+ functionCount = DB_ResidenceData.functionList.lights.Count;
+ functionOnCount = DB_ResidenceData.functionList.lights.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count;
Button btnLightPower = new Button()
{
X = Application.GetRealWidth(120),
@@ -489,10 +489,12 @@
IsSelected = functionCount == functionOnCount
};
functionView.AddChidren(btnLightPower);
- btnLightPower.MouseUpEventHandler = (sender, e) => {
- LoadEvent_SwitchFunction(btnLightPower,item);
+ btnLightPower.MouseUpEventHandler = (sender, e) =>
+ {
+ LoadEvent_SwitchFunction(btnLightPower, item);
};
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ {
var skipView = new FunctionPage();
MainPage.BasePageView.AddChidren(skipView);
skipView.LoadPage(StringId.Lights);
@@ -503,8 +505,8 @@
case ShowFunction.AC:
#region AC
btnName.TextID = StringId.AC;
- functionCount = DB_ResidenceData.residenceData.functionList.aCs.Count;
- functionOnCount = DB_ResidenceData.residenceData.functionList.aCs.FindAll((obj) => obj.on_off == "on" ).Count;
+ functionCount = DB_ResidenceData.functionList.aCs.Count;
+ functionOnCount = DB_ResidenceData.functionList.aCs.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count;
Button btnAcPower = new Button()
{
X = Application.GetRealWidth(120),
@@ -516,10 +518,12 @@
IsSelected = functionCount == functionOnCount
};
functionView.AddChidren(btnAcPower);
- btnAcPower.MouseUpEventHandler = (sender, e) => {
+ btnAcPower.MouseUpEventHandler = (sender, e) =>
+ {
LoadEvent_SwitchFunction(btnAcPower, item);
};
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ {
var skipView = new FunctionPage();
MainPage.BasePageView.AddChidren(skipView);
skipView.LoadPage(StringId.AC);
@@ -530,8 +534,8 @@
case ShowFunction.Curtain:
#region Curtain
btnName.TextID = StringId.Curtain;
- functionCount = DB_ResidenceData.residenceData.functionList.curtains.Count;
- functionOnCount = DB_ResidenceData.residenceData.functionList.curtains.FindAll((obj) => obj.on_off == "on").Count;
+ functionCount = DB_ResidenceData.functionList.curtains.Count;
+ functionOnCount = DB_ResidenceData.functionList.curtains.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count;
Button btnClose;
btnClose = new Button()
{
@@ -558,7 +562,8 @@
functionView.AddChidren(btnOpen);
LoadEvent_CurtainSwitch(btnClose, btnOpen);
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ {
var skipView = new FunctionPage();
MainPage.BasePageView.AddChidren(skipView);
skipView.LoadPage(StringId.Curtain);
@@ -569,8 +574,8 @@
case ShowFunction.FloorHeating:
#region 鍦扮儹
btnName.TextID = StringId.FloorHeating;
- functionCount = DB_ResidenceData.residenceData.functionList.floorHeatings.Count;
- functionOnCount = DB_ResidenceData.residenceData.functionList.floorHeatings.FindAll((obj) => obj.on_off == "on").Count;
+ functionCount = DB_ResidenceData.functionList.floorHeatings.Count;
+ functionOnCount = DB_ResidenceData.functionList.floorHeatings.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count;
Button btnFhPower = new Button()
{
X = Application.GetRealWidth(120),
@@ -582,10 +587,12 @@
IsSelected = functionCount == functionOnCount
};
functionView.AddChidren(btnFhPower);
- btnFhPower.MouseUpEventHandler = (sender, e) => {
+ btnFhPower.MouseUpEventHandler = (sender, e) =>
+ {
LoadEvent_SwitchFunction(btnFhPower, item);
};
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ {
var skipView = new FunctionPage();
MainPage.BasePageView.AddChidren(skipView);
skipView.LoadPage(StringId.FloorHeating);
@@ -599,8 +606,8 @@
case ShowFunction.Electric:
#region 鐢靛櫒
btnName.TextID = StringId.Electric;
- functionCount = DB_ResidenceData.residenceData.functionList.electricals.Count;
- functionOnCount = DB_ResidenceData.residenceData.functionList.electricals.FindAll((obj) => obj.on_off == "on").Count;
+ functionCount = DB_ResidenceData.functionList.electricals.Count;
+ functionOnCount = DB_ResidenceData.functionList.electricals.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count;
Button btnElectricPower = new Button()
{
X = Application.GetRealWidth(120),
@@ -612,10 +619,12 @@
IsSelected = functionCount == functionOnCount
};
functionView.AddChidren(btnElectricPower);
- btnElectricPower.MouseUpEventHandler = (sender, e) => {
+ btnElectricPower.MouseUpEventHandler = (sender, e) =>
+ {
LoadEvent_SwitchFunction(btnElectricPower, item);
};
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ {
var skipView = new FunctionPage();
MainPage.BasePageView.AddChidren(skipView);
skipView.LoadPage(StringId.Electric);
@@ -629,7 +638,8 @@
case ShowFunction.Environmental:
#region 鐜鏁版嵁
btnName.TextID = StringId.EnvironmentalData;
- btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+ btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+ {
var skipView = new EnvironmentalSciencePage();
MainPage.BasePageView.AddChidren(skipView);
skipView.LoadPage();
@@ -642,6 +652,8 @@
break;
case ShowFunction.Music:
btnName.TextID = StringId.Music;
+ functionCount = Music.A31MusicModel.A31MusicModelList.Count;
+ functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count;
btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
{
var musicMain = new Music.MusicMain();
@@ -680,6 +692,7 @@
Tag = item + "_onCount"
};
functionView.AddChidren(btnFunctionCount);
+
}
index++;
}
@@ -692,11 +705,13 @@
/// </summary>
void LoadDialog_ChangeFloor()
{
- EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
+ EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+ {
var dialog = new Dialog();
var dialogBody = new FrameLayout();
dialog.AddChidren(dialogBody);
- dialogBody.MouseUpEventHandler += (sender1, e1) => {
+ dialogBody.MouseUpEventHandler += (sender1, e1) =>
+ {
dialog.Close();
};
@@ -705,8 +720,8 @@
X = Application.GetRealWidth(10),
Y = Application.GetRealHeight(100),
Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(203),
- BackgroundImagePath = "PersonalCenter/HomeListbg.png",
+ Height = Application.GetRealHeight(110),
+ BackgroundImagePath = "PersonalCenter/HomeList1bg.png",
};
dialogBody.AddChidren(dispalyView);
@@ -715,9 +730,61 @@
X = Application.GetRealWidth(8),
Y = Application.GetRealHeight(15),
Width = Application.GetRealWidth(150),
- Height = Application.GetRealHeight(45 * 4),
+ Height = Application.GetRealHeight(45 * 2),
+ ScrollEnabled = false
};
dispalyView.AddChidren(contentView);
+
+ if (DB_ResidenceData.residenceData.floors.Count < 2)
+ {
+ }
+ else if (DB_ResidenceData.residenceData.floors.Count < 3)
+ {
+ dispalyView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(10),
+ Y = Application.GetRealHeight(100),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(155),
+ BackgroundImagePath = "PersonalCenter/HomeList2bg.png",
+ };
+ dialogBody.AddChidren(dispalyView);
+
+ contentView.Height = Application.GetRealHeight(45 * 3);
+ dispalyView.AddChidren(contentView);
+ }
+ else if (DB_ResidenceData.residenceData.floors.Count < 4)
+ {
+ dispalyView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(10),
+ Y = Application.GetRealHeight(100),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(200),
+ BackgroundImagePath = "PersonalCenter/HomeList3bg.png",
+ };
+ dialogBody.AddChidren(dispalyView);
+
+ contentView.Height = Application.GetRealHeight(45 * 4);
+ dispalyView.AddChidren(contentView);
+ }
+ else
+ {
+ dispalyView = new FrameLayout()
+ {
+ X = Application.GetRealWidth(10),
+ Y = Application.GetRealHeight(100),
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(245),
+ BackgroundImagePath = "PersonalCenter/HomeList4bg.png",
+ };
+ dialogBody.AddChidren(dispalyView);
+
+ contentView.Height = Application.GetRealHeight(45 * 5);
+ contentView.ScrollEnabled = true;
+ dispalyView.AddChidren(contentView);
+ }
+
List<string> chooseList = new List<string>();
chooseList.Add(Language.StringByID(StringId.All));
@@ -761,13 +828,13 @@
roomsShowed.Clear();
if (floor == Language.StringByID(StringId.All))
{
- roomsShowed.AddRange(DB_ResidenceData.residenceData.rooms);
+ roomsShowed.AddRange(DB_ResidenceData.rooms);
}
else
{
- foreach (var room in DB_ResidenceData.residenceData.rooms)
+ foreach (var room in DB_ResidenceData.rooms)
{
- if (room.floor == floor)
+ if (room.floorName == floor)
{
roomsShowed.Add(room);
}
--
Gitblit v1.8.0