From ecba45c93391066bc30c7bd602c3a7683fbb99a7 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 31 七月 2020 10:56:12 +0800
Subject: [PATCH] 临时备份

---
 ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs |  190 +++++++++++++++++++++--------------------------
 1 files changed, 85 insertions(+), 105 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs
index 0bacf91..45f0f72 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs
@@ -12,22 +12,9 @@
         {
             Tag = "Logic";
         }
-        /// <summary>
-        /// 璁板綍鐐瑰嚮鎴块棿
-        /// </summary>
         Button roombjButton = new Button();
-        /// <summary>
-        /// 璁板綍鐐瑰嚮鎴块棿鍚嶇О
-        /// </summary>
         Button roomTextButton = new Button();
-        /// <summary>
-        /// 璁板綍鐐瑰嚮璁惧
-        /// </summary>
-        Button deviceTypeBjButton = new Button();
-        /// <summary>
-        /// 璁板綍鐐瑰嚮璁惧绫诲瀷
-        /// </summary>
-        Button deviceTypeTextButton = new Button();
+        Button devicetypeButton = new Button();
         FrameLayout clickframeLayout = new FrameLayout();
         Button clickbutton = new Button();
         Button clicktextcolcrbutton = new Button();
@@ -40,33 +27,21 @@
         /// </summary>
         public HorizontalScrolViewLayout roomhorizontalScrol = new HorizontalScrolViewLayout
         {
-            Width = Application.GetRealWidth(1080 - 29),
-            Height = Application.GetRealHeight(204),
-            X = Application.GetRealWidth(29),
+            Width = Application.GetRealWidth(1080 - 58),
+            Height = Application.GetRealHeight(200),
+            X = Application.GetRealWidth(58),
             Y = Application.GetRealHeight(184),
-        };
-        /// <summary>
-        /// 鍦嗚17
-        /// </summary>
-        public HorizontalScrolViewLayout devicetypehorizontalScrol1 = new HorizontalScrolViewLayout
-        {
-            Width = Application.GetRealWidth(1080 - 52),
-            Height = Application.GetRealHeight(50),
-            Y = Application.GetRealHeight(184 + 204),
-            BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-            X = Application.GetRealWidth(52),
-
         };
         /// <summary>
         /// 璁惧绫诲瀷婊戝姩鐨勬帶浠�
         /// </summary>
         public HorizontalScrolViewLayout devicetypehorizontalScrol = new HorizontalScrolViewLayout
         {
-            Width = Application.GetRealWidth(1080 - 52),
+            Width = Application.GetRealWidth(1080 - 58),
             Height = Application.GetRealHeight(280),
-            Y = Application.GetRealHeight(184 + 204),
+            Y = Application.GetRealHeight(184 + 200),
             BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-            X = Application.GetRealWidth(52),
+            X = Application.GetRealWidth(58),
             // Radius = (uint)Application.GetRealHeight(50),
 
         };
@@ -76,8 +51,8 @@
         public VerticalScrolViewLayout middle = new VerticalScrolViewLayout
         {
             X = Application.GetRealWidth(58),
-            Y = Application.GetRealHeight(184 + 204 + 280 + 40),
-            Height = Application.GetRealHeight(Method.H - 40 - 184 - 280 - 204),
+            Y = Application.GetRealHeight(184 + 200 + 280 + 40),
+            Height = Application.GetRealHeight(Method.H - 40 - 184 - 280 - 200),
             BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
         };
 
@@ -113,18 +88,15 @@
             if (roomlists.Count == 0)
             {
                 //杩斿洖娌℃湁鎴块棿闅愯棌涓嬮潰鏁村潡;
-                devicetypehorizontalScrol1.Height = 0;
                 devicetypehorizontalScrol.Height = 0;
                 middle.Height = 0;
             }
             /// 璁惧绫诲瀷鍒楄〃
             var deviceTypeList = Method.GetDevice(IfType);
             this.AddChidren(roomhorizontalScrol);
-            this.AddChidren(devicetypehorizontalScrol1);
             this.AddChidren(devicetypehorizontalScrol);
             this.AddChidren(middle);
-            devicetypehorizontalScrol1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft);
-            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft|HDLUtils.RectCornerTopLeft);
+            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft);
             middle.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft);
             ///妤煎眰鐐瑰嚮浜嬩欢
             view.foolrclickBtn.MouseUpEventHandler += (sender, e) =>
@@ -215,13 +187,11 @@
                           var list = Method.GetRoomList(IfType, btnfoolrname.Tag.ToString());
                           if (list.Count == 0)
                           {
-                              devicetypehorizontalScrol1.Height = 0;
                               devicetypehorizontalScrol.Height = 0;
                               middle.Height = 0;
                           }
                           else
                           {
-                              devicetypehorizontalScrol1.Height = 50;
                               devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
                               middle.Height = Application.GetRealHeight(1920 - 40 - 184 - 280 - 200);
                           }
@@ -244,64 +214,70 @@
             {
                 var room = roomlist[i];
 
-                LogicView.RoomClickView roomClickView = new LogicView.RoomClickView();
-                roomClickView.Show(roomhorizontalScrol);
-                roomClickView.roomnameBtn.Text = room.Name;
+                var fra = new FrameLayout
+                {
+                    Height = Application.GetRealHeight(200),
+                    Width = Application.GetRealWidth(255),
+                };
+                roomhorizontalScrol.AddChidren(fra);
+
+                var roombjBtn = new Button
+                {
+                    Height = Application.GetRealHeight(158),
+                    Width = Application.GetRealWidth(255),
+                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
+                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
+                    Y = Application.GetRealHeight(21),
+                };
+                fra.AddChidren(roombjBtn);
+
+                var roomnameBtn = new Button
+                {
+
+                    Height = Application.GetRealHeight(152 - 26 - 20),
+                    Width = Application.GetRealWidth(255 - 20 - 50),
+                    Text = room.Name,
+                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+                    Y = Application.GetRealHeight(21 + 13 + 10),
+                    X = Application.GetRealWidth(10 + 25),
+
+                };
+                fra.AddChidren(roomnameBtn);
 
                 if (i == 0)//榛樿閫変腑绗竴涓埧闂�
                 {
-
                     roombjButton.IsSelected = false;
-                    roomClickView.roombjBtn.Height = Application.GetRealHeight(135);
-                    roomClickView.roombjBtn.Width = Application.GetRealWidth(245);
-                    roomClickView.roombjBtn.Y = Application.GetRealHeight(40);
-                    roomClickView.roombjBtn.X = Application.GetRealWidth(0);
-                    roombjButton = roomClickView.roombjBtn;
-                    roomClickView.roombjBtn.IsSelected = true;
-                    roomTextButton.IsSelected = false;
-                    roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2);
-                    roomClickView.roomnameBtn.X = Application.GetRealWidth(60);
-                    roomTextButton = roomClickView.roomnameBtn;
-                    roomClickView.roomnameBtn.IsSelected = true;
+                    roombjButton = roombjBtn;
+                    roombjBtn.IsSelected = true;
 
-                    var list = Method.GetDeviceUIList(room, deviceTypeList, IfType);
+                    roomTextButton.IsSelected = false;
+                    roomTextButton = roomnameBtn;
+                    roomnameBtn.IsSelected = true;
+
+                    roombjBtn.IsSelected = true;
+                    roomnameBtn.IsSelected = true;
+
+                    var list = Method.GetDeviceUIList(room, deviceTypeList);
                     AllDeviceTypeView(list);
                 }
 
                 EventHandler<MouseEventArgs> roomclick = (sender, e) =>
                 {
-                    roombjButton.Height = Application.GetRealHeight(72);
-                    roombjButton.Width = Application.GetRealWidth(170);
-                    roombjButton.Y = Application.GetRealHeight(60);
-                    roombjButton.X = Application.GetRealWidth(26);
                     roombjButton.IsSelected = false;
+                    roombjButton = roombjBtn;
+                    roombjBtn.IsSelected = true;
 
-                    roombjButton.Height = Application.GetRealHeight(72);
-                    roombjButton.Width = Application.GetRealWidth(170);
-                    roombjButton.Y = Application.GetRealHeight(60);
-                    roombjButton.X = Application.GetRealWidth(26);
-                    roombjButton.IsSelected = false;
-
-                    roomClickView.roombjBtn.Height = Application.GetRealHeight(135);
-                    roomClickView.roombjBtn.Width = Application.GetRealWidth(245);
-                    roomClickView.roombjBtn.Y = Application.GetRealHeight(40);
-                    roomClickView.roombjBtn.X = Application.GetRealWidth(0);
-                    roombjButton = roomClickView.roombjBtn;
-                    roomClickView.roombjBtn.IsSelected = true;
-
-                    roomTextButton.Width = Application.GetRealWidth(125);
-                    roomTextButton.X = Application.GetRealWidth(26 + 22);
                     roomTextButton.IsSelected = false;
-                    roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2);
-                    roomClickView.roomnameBtn.X = Application.GetRealWidth(60);
-                    roomTextButton = roomClickView.roomnameBtn;
-                    roomClickView.roomnameBtn.IsSelected = true;
+                    roomTextButton = roomnameBtn;
+                    roomnameBtn.IsSelected = true;
 
-                    var list = Method.GetDeviceUIList(room, deviceTypeList, IfType);
+
+                    var list = Method.GetDeviceUIList(room, deviceTypeList);
                     AllDeviceTypeView(list);
                 };
-                roomClickView.roomnameBtn.MouseUpEventHandler += roomclick;
-                roomClickView.roombjBtn.MouseUpEventHandler += roomclick;
+                roomnameBtn.MouseUpEventHandler += roomclick;
+                roombjBtn.MouseUpEventHandler += roomclick;
 
             }
         }
@@ -316,27 +292,30 @@
             for (int i = 0; i < devicetypelist.Count; i++)
             {
                 var devicetype = devicetypelist[i];
-
+                var spaceRowLayout = new FrameLayout();
+                devicetypehorizontalScrol.AddChidren(spaceRowLayout);
                 if (i == 0)
                 {
-                    var spaceRowLayout = new FrameLayout();
-                    devicetypehorizontalScrol.AddChidren(spaceRowLayout);
                     spaceRowLayout.Width = Application.GetRealWidth(37);
                 }
-               
+                else
+                {
+                    spaceRowLayout.Width = Application.GetRealWidth(80);
+                }
 
                 var deviceRowLayout = new FrameLayout
                 {
-                    Width = Application.GetRealWidth(150+75),
-                    Height = Application.GetRealHeight(173+52),
-                    Y = Application.GetRealHeight(35),
+                    Width = Application.GetRealWidth(156 + 20),
+                    Height = Application.GetRealHeight(280 - 30),
+                    Y = Application.GetRealHeight(30),
                 };
                 devicetypehorizontalScrol.AddChidren(deviceRowLayout);
 
                 var backgroundColor = new Button
                 {
-                    Width = Application.GetMinRealAverage(150),
-                    Height = Application.GetMinRealAverage(173),
+                    Width = Application.GetMinRealAverage(156),
+                    Height = Application.GetMinRealAverage(180),
+                    X = Application.GetRealWidth(10),
                     UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png",
                     SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png",
                 };
@@ -347,22 +326,21 @@
                 {
                     Width = Application.GetMinRealAverage(84),
                     Height = Application.GetMinRealAverage(84),
-                    X = Application.GetRealWidth(35),
-                    Y = Application.GetRealHeight(29),
+                    X = Application.GetRealWidth(46),
+                    Y = Application.GetRealHeight(30),
                     UnSelectedImagePath =Method.GetDeviceTypeIcon(devicetype),
                 };
                 deviceRowLayout.AddChidren(devicetypeicon);
 
                 var devicetypename = new Button
                 {
-                    Width = Application.GetRealWidth(150),
-                    Height = Application.GetRealHeight(52),
+                    Width = Application.GetRealWidth(176),
+                    Height = Application.GetRealHeight(40),
                     Text = devicetype,
                     TextAlignment = TextAlignment.Center,
                     Y = backgroundColor.Bottom,
+                    TextColor = ZigbeeColor.Current.LogicAddColor,
                     TextSize = 10,
-                    TextColor =ZigbeeColor.Current.LogicBtnSelectedColor,
-                    SelectedTextColor =ZigbeeColor.Current.LogicAddColor,
                 };
                 deviceRowLayout.AddChidren(devicetypename);
 
@@ -378,18 +356,13 @@
 
                 EventHandler<MouseEventArgs> devicetypeclick = (sender13, e13) =>
                 {
-                    deviceTypeBjButton.IsSelected = false;
-                    deviceTypeBjButton = backgroundColor;
+                    devicetypeButton.IsSelected = false;
+                    devicetypeButton = backgroundColor;
                     backgroundColor.IsSelected = true;
-
-                    deviceTypeTextButton.IsSelected = false;
-                    deviceTypeTextButton = devicetypename;
-                    devicetypename.IsSelected = true;
-
-
                     var list = Method.GetDeviceType(devicetypename.Text);
                     ConditionDeviceView(list, devicelist);
                 };
+                deviceRowLayout.MouseUpEventHandler += devicetypeclick;
                 devicetypename.MouseUpEventHandler += devicetypeclick;
                 devicetypeicon.MouseUpEventHandler += devicetypeclick;
                 backgroundColor.MouseUpEventHandler += devicetypeclick;
@@ -415,6 +388,13 @@
                 {
                     continue;
                 }
+                if (IfType == "condition_mould")
+                {
+                    if (common.IasDeviceType != 13)
+                    {//鑷姩鍖栨ā鏉垮彧鏀寔绾㈠浼犳劅鍣�
+                        continue;
+                    }
+                }
                 var deviceFramelayout = new FrameLayout
                 {
                     Height = Application.GetRealHeight(160),

--
Gitblit v1.8.0