From 9d65c293924e4edbbc8c6c6091f55d7fc49c23eb Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 06 七月 2021 13:15:46 +0800
Subject: [PATCH] 乐橙子账号token
---
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs | 299 +++++++++++++++++++++++++++++------------------------------
1 files changed, 145 insertions(+), 154 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs
old mode 100755
new mode 100644
index 8bb99ac..3293e0d
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs
@@ -107,6 +107,10 @@
IsBold = true
};
showdFunctionTypeRow.AddChidren(btnUnallocated);
+ if(Language.CurrentLanguage != "Chinese")
+ {
+ btnUnallocated.Width = Application.GetRealWidth(130);
+ }
btnAllocated = new Button()
{
@@ -153,12 +157,17 @@
Y = showdFunctionTypeRow.Bottom,
Height = Application.GetRealHeight(518 - 40 - 62),
BackgroundColor = CSS_Color.BackgroundColor,
+
};
bodyView.AddChidren(functionListView);
foreach (var function in FunctionList.List.GetDeviceFunctionList())
{
function.roomIds.Remove(null);
+ if(MainPage.RoomNotSupportFunctionList.Contains(function.spk))
+ {
+ continue;
+ }
if (function.roomIds.Count > 0 )
{
allocatedList.Add(function);
@@ -171,11 +180,20 @@
LoadFunctionListRow(unallocatedList);
+ var bottomView = new FrameLayout()
+ {
+ Y = Application.GetRealHeight(591),
+ Height = Application.GetRealHeight(76) + Application.GetRealWidth(44),
+ Radius = (uint)Application.GetRealWidth(22),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ };
+ bodyView.AddChidren(bottomView);
+
btnConfrim = new Button()
{
Gravity = Gravity.CenterHorizontal,
- Y = Application.GetRealHeight(582),
+ Y = Application.GetRealHeight(603),
Width = Application.GetRealWidth(220),
Height = Application.GetRealWidth(44),
Radius = (uint)Application.GetRealWidth(22),
@@ -184,7 +202,7 @@
TextSize = CSS_FontSize.SubheadingFontSize,
TextAlignment = TextAlignment.Center,
IsBold = true,
- TextID = StringId.Confirm,
+ TextID = StringId.ConfirmAdd,
};
bodyView.AddChidren(btnConfrim);
@@ -200,15 +218,24 @@
showdFunctionCount = 0;
functionListView.RemoveAll();
+ bool isFrist = true;
+
foreach (var function in functions)
{
- functionListView.AddChidren(new Button()
+ if (isFrist)
{
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(343),
- Height = Application.GetRealWidth(1),
- BackgroundColor = CSS_Color.DividingLineColor,
- });
+ isFrist = false;
+ }
+ else
+ {
+ functionListView.AddChidren(new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(343),
+ Height = Application.GetRealWidth(1),
+ BackgroundColor = CSS_Color.DividingLineColor,
+ });
+ }
FrameLayout functionRow = new FrameLayout()
{
@@ -225,71 +252,9 @@
Height = Application.GetMinRealAverage(28),
};
functionRow.AddChidren(btnFunctionIcon);
- switch (function.functionCategory)
- {
- case FunctionCategory.Thermostat:
- switch (function.functionType)
- {
- case FunctionType.AC:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png";
- break;
- case FunctionType.FloorHeating:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png";
- break;
- }
- break;
- case FunctionCategory.Curtain:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainThinIcon.png";
- break;
- case FunctionCategory.Light:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png";
- break;
- case FunctionCategory.SwitchDevice:
- switch (function.functionType)
- {
- case FunctionType.Socket:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png";
- break;
- }
- break;
- case FunctionCategory.Electrical:
- switch (function.functionType)
- {
- case FunctionType.Fan:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png";
- break;
- case FunctionType.TV:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png";
- break;
- }
- break;
- case FunctionCategory.Scene:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png";
- break;
- case FunctionCategory.Music:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicThinIcon.png";
- break;
- case FunctionCategory.Sensor:
- switch(function.functionType)
- {
- case FunctionType.PM25:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconPm25.png";
- break;
- case FunctionType.CO2:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconCO2.png";
- break;
- case FunctionType.TVOC:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconTVOC.png";
- break;
- case FunctionType.Humidity:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconHumidity.png";
- break;
- case FunctionType.Temp:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/FunctionIconTemp.png";
- break;
- }
- break;
- }
+
+ btnFunctionIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png";
+
if (!btnAllocated.IsSelected)
{
@@ -362,91 +327,117 @@
/// </summary>
void LoadPage_LoadChooseRoomDialog()
{
- Dialog dialog = new Dialog();
- FrameLayout dialogBodyView = new FrameLayout()
- {
- BackgroundColor = CSS_Color.DialogTransparentColor1,
- };
- dialog.AddChidren(dialogBodyView);
-
- FrameLayout contentView;
- contentView = new FrameLayout()
- {
- X = Application.GetRealWidth(205),
- Y = Application.GetRealHeight(106),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(200),
- BackgroundImagePath = "Public/ChooseRoomListbg.png",
- };
- dialogBodyView.AddChidren(contentView);
-
- VerticalScrolViewLayout roomListView;
- roomListView = new VerticalScrolViewLayout()
- {
- X = Application.GetRealWidth(8),
- Y = Application.GetRealHeight(15),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(45 * 4),
- };
- contentView.AddChidren(roomListView);
-
- Button btnAllRoom;
- btnAllRoom = new Button()
- {
- X = Application.GetRealWidth(16),
- Width = Application.GetRealWidth(128),
- Height = Application.GetRealHeight(50),
- TextID = StringId.All,
- TextColor = CSS_Color.FirstLevelTitleColor,
- SelectedTextColor = CSS_Color.MainColor,
- TextSize = CSS_FontSize.SubheadingFontSize,
- IsSelected = showedFunctionRoomId == "0",
- TextAlignment = TextAlignment.CenterLeft,
- Tag = "0"
- };
- roomListView.AddChidren(btnAllRoom);
- LoadEvent_ChangeShowedFunctionList(btnAllRoom, dialog, Language.StringByID(StringId.All));
-
- roomListView.AddChidren(new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealWidth(1),
- BackgroundColor = CSS_Color.DividingLineColor,
- });
- foreach (var tempRoom in SpatialInfo.CurrentSpatial.RoomList)
- {
-
- Button btnRoom = new Button()
+ Action<string, string> action = (key, value) => {
+ if (lastButton != null)
{
- X = Application.GetRealWidth(16),
- Width = Application.GetRealWidth(128),
- Height = Application.GetRealHeight(50),
- Text = tempRoom.roomName,
- TextColor = CSS_Color.FirstLevelTitleColor,
- SelectedTextColor = CSS_Color.MainColor,
- TextSize = CSS_FontSize.SubheadingFontSize,
- TextAlignment = TextAlignment.CenterLeft,
- IsSelected = showedFunctionRoomId == tempRoom.roomId,
- Tag = tempRoom.roomId,
- };
- roomListView.AddChidren(btnRoom);
- LoadEvent_ChangeShowedFunctionList(btnRoom, dialog, tempRoom.roomName);
-
- roomListView.AddChidren(new Button()
+ lastButton.IsSelected = false;
+ }
+ showedFunctionRoomId = key;
+ if (showedFunctionRoomId == "0")
{
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealWidth(1),
- BackgroundColor = CSS_Color.DividingLineColor,
- });
+ LoadFunctionListRow(allocatedList);
+ }
+ else
+ {
+ LoadFunctionListRow(allocatedList.FindAll((obj) => obj.roomIds.Contains(showedFunctionRoomId)));
+ }
+ btnChoosedRoom.Text = value;
+ };
+
+ Dictionary<string, string> items = new Dictionary<string, string>();
+ items.Add("0",Language.StringByID(StringId.All));
+ foreach(var room in SpatialInfo.CurrentSpatial.RoomList)
+ {
+ items.Add(room.roomId,room.roomName);
}
- dialogBodyView.MouseUpEventHandler = (sender, e) =>
- {
- dialog.Close();
- };
+ var chooseDialog = new ListCellDialog(items,showedFunctionRoomId,action);
+ chooseDialog.ShowRightDialog();
- dialog.Show();
+ //Dialog dialog = new Dialog();
+ //FrameLayout dialogBodyView = new FrameLayout()
+ //{
+ // BackgroundColor = CSS_Color.DialogTransparentColor1,
+ //};
+ //dialog.AddChidren(dialogBodyView);
+
+ //FrameLayout contentView;
+ //contentView = new FrameLayout()
+ //{
+ // X = Application.GetRealWidth(205),
+ // Y = Application.GetRealHeight(106),
+ // Width = Application.GetRealWidth(160),
+ // Height = Application.GetRealHeight(200),
+ // BackgroundImagePath = "Public/ChooseRoomListbg.png",
+ //};
+ //dialogBodyView.AddChidren(contentView);
+
+ //VerticalScrolViewLayout roomListView;
+ //roomListView = new VerticalScrolViewLayout()
+ //{
+ // X = Application.GetRealWidth(8),
+ // Y = Application.GetRealHeight(15),
+ // Width = Application.GetRealWidth(160),
+ // Height = Application.GetRealHeight(45 * 4),
+ //};
+ //contentView.AddChidren(roomListView);
+
+ //Button btnAllRoom;
+ //btnAllRoom = new Button()
+ //{
+ // X = Application.GetRealWidth(16),
+ // Width = Application.GetRealWidth(128),
+ // Height = Application.GetRealHeight(50),
+ // TextID = StringId.All,
+ // TextColor = CSS_Color.FirstLevelTitleColor,
+ // SelectedTextColor = CSS_Color.MainColor,
+ // TextSize = CSS_FontSize.SubheadingFontSize,
+ // IsSelected = showedFunctionRoomId == "0",
+ // TextAlignment = TextAlignment.CenterLeft,
+ // Tag = "0"
+ //};
+ //roomListView.AddChidren(btnAllRoom);
+ //LoadEvent_ChangeShowedFunctionList(btnAllRoom, dialog, Language.StringByID(StringId.All));
+
+ //roomListView.AddChidren(new Button()
+ //{
+ // Gravity = Gravity.CenterHorizontal,
+ // Width = Application.GetRealWidth(112),
+ // Height = Application.GetRealWidth(1),
+ // BackgroundColor = CSS_Color.DividingLineColor,
+ //});
+ //foreach (var tempRoom in SpatialInfo.CurrentSpatial.RoomList)
+ //{
+
+ // Button btnRoom = new Button()
+ // {
+ // X = Application.GetRealWidth(16),
+ // Width = Application.GetRealWidth(128),
+ // Height = Application.GetRealHeight(50),
+ // Text = tempRoom.roomName,
+ // TextColor = CSS_Color.FirstLevelTitleColor,
+ // SelectedTextColor = CSS_Color.MainColor,
+ // TextSize = CSS_FontSize.SubheadingFontSize,
+ // TextAlignment = TextAlignment.CenterLeft,
+ // IsSelected = showedFunctionRoomId == tempRoom.roomId,
+ // Tag = tempRoom.roomId,
+ // };
+ // roomListView.AddChidren(btnRoom);
+ // LoadEvent_ChangeShowedFunctionList(btnRoom, dialog, tempRoom.roomName);
+
+ // roomListView.AddChidren(new Button()
+ // {
+ // Gravity = Gravity.CenterHorizontal,
+ // Width = Application.GetRealWidth(112),
+ // Height = Application.GetRealWidth(1),
+ // BackgroundColor = CSS_Color.DividingLineColor,
+ // });
+ //}
+ //dialogBodyView.MouseUpEventHandler = (sender, e) =>
+ //{
+ // dialog.Close();
+ //};
+
+ //dialog.Show();
}
--
Gitblit v1.8.0