From 06696e6f225733a60b03eea4a7c6374053d92c1d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 14 四月 2020 14:15:35 +0800
Subject: [PATCH] 20200414

---
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs |  101 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 60 insertions(+), 41 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 1a064c6..323ee88 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -64,9 +64,14 @@
 
         #endregion
 
+
+        List<Room> roomsShowed;
+
         public ClassificationPage()
         {
             bodyView = this;
+            roomsShowed = new List<Room>();
+            roomsShowed.AddRange(DB_ResidenceData.residenceData.rooms);
         }
 
         public void LoadPage()
@@ -172,7 +177,7 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                 TextAlignment = TextAlignment.CenterLeft,
-                Text = UserConfig.Instance.CurFoor,
+                Text = OnAppConfig.Instance.CurFoor,
             };
             roomFloorChangeView.AddChidren(btnFloor);
             /// <summary>
@@ -190,7 +195,6 @@
             roomFloorChangeView.AddChidren(btnSwitchDipaly);
             #endregion
 
-
             /// <summary>
             /// 鎴块棿鍒楄〃鍖哄煙
             /// </summary>
@@ -201,8 +205,20 @@
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
             roomPageView.AddChidren(roomListView);
+            LoadRoomRows();
+            roomListView.AddChidren(new Button() { Height = Application.GetRealHeight(20) });//澶珮瑙嗗浘锛屽皢瀵艰埅浜嗛伄鎸$殑閮ㄥ垎瀹屾暣鏄剧ず
+            #endregion
 
-            foreach (var room in DB_ResidenceData.residenceData.rooms)
+            LoadDialog_ChangeFloor();
+        }
+
+        /// <summary>
+        /// 鍔犺浇鎴块棿鍒楄〃鍖哄煙
+        /// </summary>
+        void LoadRoomRows ()
+        {
+            roomListView.RemoveAll();
+            foreach (var room in roomsShowed)
             {
                 var roomView = new FrameLayout()
                 {
@@ -256,7 +272,7 @@
                     Gravity = Gravity.CenterVertical,
                     Width = Application.GetMinRealAverage(16),
                     Height = Application.GetMinRealAverage(16),
-                    UnSelectedImagePath = "Public/InfoIcon/TempIcon.png",
+                    UnSelectedImagePath = "Public/DeviceInfoIcon/TempIcon.png",
                 };
                 environmentalView.AddChidren(btnTempIcon);
 
@@ -279,7 +295,7 @@
                     Gravity = Gravity.CenterVertical,
                     Width = Application.GetMinRealAverage(16),
                     Height = Application.GetMinRealAverage(16),
-                    UnSelectedImagePath = "Public/InfoIcon/HumidityIcon.png",
+                    UnSelectedImagePath = "Public/DeviceInfoIcon/HumidityIcon.png",
                 };
                 environmentalView.AddChidren(btnHumidityIcon);
 
@@ -302,7 +318,7 @@
                     Gravity = Gravity.CenterVertical,
                     Width = Application.GetMinRealAverage(16),
                     Height = Application.GetMinRealAverage(16),
-                    UnSelectedImagePath = "Public/InfoIcon/Pm25Icon.png",
+                    UnSelectedImagePath = "Public/DeviceInfoIcon/Pm25Icon.png",
                 };
                 environmentalView.AddChidren(btnPm25Icon);
 
@@ -328,10 +344,10 @@
                     Width = Application.GetMinRealAverage(58),
                     Height = Application.GetMinRealAverage(58),
                     UnSelectedImagePath = "Classification/Room/AllCloseIcon.png",
-                    Tag = "AllClose"
+                    Tag = "AllClose",
+                    Visible = false
                 };
                 roomView.AddChidren(btnAllClose);
-
                 LoadEvent_CloseAllFunction(btnAllClose, room);
 
                 var btn = new Button()
@@ -348,11 +364,6 @@
                 };
 
             }
-
-            roomListView.AddChidren(new Button() { Height = Application.GetRealHeight(20) });//澶珮瑙嗗浘锛屽皢瀵艰埅浜嗛伄鎸$殑閮ㄥ垎瀹屾暣鏄剧ず
-            #endregion
-
-            LoadDialog_ChangeFloor();
         }
 
         /// <summary>
@@ -459,7 +470,7 @@
                 int functionOnCount = 0;
                 switch (item)
                 {
-                    case FunctionCategory.Light:
+                    case ShowFunction.Light:
                         #region Light
                         btnName.TextID = StringId.Lights;
                         functionCount = DB_ResidenceData.residenceData.functionList.lights.Count;
@@ -472,6 +483,7 @@
                             Height = Application.GetRealWidth(32),
                             SelectedImagePath = "Public/PowerOpen.png",
                             UnSelectedImagePath = "Public/PowerClose.png",
+                            IsSelected = functionCount == functionOnCount
                         };
                         functionView.AddChidren(btnLightPower);
                         btnLightPower.MouseUpEventHandler = (sender, e) => {
@@ -485,7 +497,7 @@
                         };
                         #endregion
                         break;
-                    case FunctionCategory.AC:
+                    case ShowFunction.AC:
                         #region AC
                         btnName.TextID = StringId.AC;
                         functionCount = DB_ResidenceData.residenceData.functionList.aCs.Count;
@@ -498,6 +510,7 @@
                             Height = Application.GetRealWidth(32),
                             SelectedImagePath = "Public/PowerOpen.png",
                             UnSelectedImagePath = "Public/PowerClose.png",
+                            IsSelected = functionCount == functionOnCount
                         };
                         functionView.AddChidren(btnAcPower);
                         btnAcPower.MouseUpEventHandler = (sender, e) => {
@@ -511,7 +524,7 @@
                         };
                         #endregion
                         break;
-                    case FunctionCategory.Curtain:
+                    case ShowFunction.Curtain:
                         #region Curtain
                         btnName.TextID = StringId.Curtain;
                         functionCount = DB_ResidenceData.residenceData.functionList.curtains.Count;
@@ -525,6 +538,7 @@
                             Height = Application.GetRealWidth(32),
                             UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
                             SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
+                            IsSelected = functionCount == functionOnCount
                         };
                         functionView.AddChidren(btnClose);
 
@@ -549,37 +563,37 @@
                         };
                         #endregion
                         break;
-                    case FunctionCategory.FloorHeating:
+                    case ShowFunction.FloorHeating:
                         btnName.TextID = StringId.FloorHeating;
                         break;
-                    case FunctionCategory.DoorLock:
+                    case ShowFunction.DoorLock:
                         btnName.TextID = StringId.DoorLock;
                         break;
-                    case FunctionCategory.Electric:
+                    case ShowFunction.Electric:
                         btnName.TextID = StringId.Electric;
                         break;
-                    case FunctionCategory.EnergyMonitoring:
+                    case ShowFunction.EnergyMonitoring:
                         btnName.TextID = StringId.EnergyMonitoring;
                         break;
-                    case FunctionCategory.Environmental:
+                    case ShowFunction.Environmental:
                         btnName.TextID = StringId.Environmental;
                         break;
-                    case FunctionCategory.FreshAir:
+                    case ShowFunction.FreshAir:
                         btnName.TextID = StringId.FreshAir;
                         break;
-                    case FunctionCategory.Music:
+                    case ShowFunction.Music:
                         btnName.TextID = StringId.Music;
                         break;
-                    case FunctionCategory.Panel:
+                    case ShowFunction.Panel:
                         btnName.TextID = StringId.Panel;
                         break;
-                    case FunctionCategory.SecurityMonitoring:
+                    case ShowFunction.SecurityMonitoring:
                         btnName.TextID = StringId.SecurityMonitoring;
                         break;
-                    case FunctionCategory.Sensor:
+                    case ShowFunction.Sensor:
                         btnName.TextID = StringId.Sensor;
                         break;
-                    case FunctionCategory.VideoIntercom:
+                    case ShowFunction.VideoIntercom:
                         btnName.TextID = StringId.VideoIntercom;
                         break;
 
@@ -598,19 +612,10 @@
                     Tag = item + "_onCount"
                 };
                 functionView.AddChidren(btnFunctionCount);
-
-
-
-
                 index++;
             }
-
-
-
             #endregion
-
         }
-
 
         #region 鍒囨崲妤煎眰
         /// <summary>
@@ -631,7 +636,7 @@
                     X = Application.GetRealWidth(10),
                     Y = Application.GetRealHeight(100),
                     Width = Application.GetRealWidth(160),
-                    Height = Application.GetRealHeight(190),
+                    Height = Application.GetRealHeight(203),
                     BackgroundImagePath = "PersonalCenter/HomeListbg.png",
                 };
                 dialogBody.AddChidren(dispalyView);
@@ -639,9 +644,9 @@
                 var contentView = new VerticalScrolViewLayout()
                 {
                     X = Application.GetRealWidth(8),
-                    Y = Application.GetRealHeight(10),
+                    Y = Application.GetRealHeight(15),
                     Width = Application.GetRealWidth(150),
-                    Height = Application.GetRealHeight(44 * 4),
+                    Height = Application.GetRealHeight(45 * 4),
                 };
                 dispalyView.AddChidren(contentView);
 
@@ -680,9 +685,23 @@
                     btnHomeName.MouseUpEventHandler += (senderH, en) =>
                     {
                         dialog.Close();
-
                         btnFloor.Text = floor;
-                        UserConfig.Instance.SaveUserConfig();
+                        roomsShowed.Clear();
+                        if (floor == Language.StringByID(StringId.All))
+                        {
+                            roomsShowed.AddRange(DB_ResidenceData.residenceData.rooms);
+                        }
+                        else
+                        {
+                            foreach (var room in DB_ResidenceData.residenceData.rooms)
+                            {
+                                if (room.floor == floor)
+                                {
+                                    roomsShowed.Add(room);
+                                }
+                            }
+                        }
+                        LoadRoomRows();
                     };
                 }
 

--
Gitblit v1.8.0