From dfa6733793434bdcfd394f978ae72f1628b2260f Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 22 四月 2020 16:50:03 +0800
Subject: [PATCH] 合并代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs |   83 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 69 insertions(+), 14 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
index 6ca7502..b36ff40 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs
@@ -16,9 +16,13 @@
         /// </summary>
         private FrameLayout frameTable = null;
         /// <summary>
-        /// 鍒楄〃鎺т欢
+        /// 鍒楄〃鎺т欢(鐧借壊鑳屾櫙)
         /// </summary>
-        private VerticalListControl listView = null;
+        private FrameListControl listView = null;
+        /// <summary>
+        /// 鏁翠釜鐣岄潰鐨勪笂涓嬫粦鍔ㄦ帶浠�
+        /// </summary>
+        private VerticalFrameControl listBackContr = null;
         /// <summary>
         /// 妤煎眰椤哄簭
         /// </summary>
@@ -64,10 +68,16 @@
             //娓呯┖bodyFrame
             this.ClearBodyFrame();
 
+            //鏁翠釜鐣岄潰鐨勪笂涓嬫粦鍔ㄦ帶浠�
+            this.listBackContr = new VerticalFrameControl();
+            listBackContr.Height = bodyFrameLayout.Height;
+            bodyFrameLayout.AddChidren(listBackContr);
+
+            //浣忓畢琛�
             var rowHome = new RowLayoutControl();
             rowHome.Height = Application.GetRealHeight(173);
             rowHome.BackgroundColor = UserCenterColor.Current.White;
-            bodyFrameLayout.AddChidren(rowHome);
+            listBackContr.frameTable.AddChidren(rowHome);
             rowHome.frameTable.UseClickStatu = false;
 
             var btnAdreeIcon = rowHome.frameTable.AddLeftIcon(81);
@@ -144,8 +154,8 @@
             //鍒濆鍖栨甯�
             this.frameTable = new FrameLayout();
             frameTable.Y = rowHome.Bottom + Application.GetRealHeight(23);
-            frameTable.Height = bodyFrameLayout.Height - rowHome.Bottom - Application.GetRealHeight(23);
-            bodyFrameLayout.AddChidren(frameTable);
+            frameTable.Height = listBackContr.frameTable.Height - rowHome.Bottom - Application.GetRealHeight(23);
+            listBackContr.frameTable.AddChidren(frameTable);
 
             //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠�
             this.InitFrameTableByMode();
@@ -244,7 +254,7 @@
             frameFloor.UseClickStatu = false;
             frameFloor.Height = Application.GetRealHeight(115);
             frameFloor.BackgroundColor = UserCenterColor.Current.White;
-            frameTable.AddChidren(frameFloor);
+            this.frameTable.AddChidren(frameFloor);
 
             //妤煎眰
             var btnFloor = frameFloor.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFloor), 200, 60);
@@ -253,11 +263,11 @@
             btnFloor.TextSize = 15;
             frameFloor.AddChidren(btnFloor, ChidrenBindMode.NotBind);
 
-            listView = new VerticalListControl(29);
+            listView = new FrameListControl(29);
             listView.BackgroundColor = UserCenterColor.Current.White;
             listView.Y = frameFloor.Bottom;
             listView.Height = frameTable.Height - frameFloor.Bottom;
-            frameTable.AddChidren(listView);
+            this.frameTable.AddChidren(listView);
 
             //鍒濆鍖栨ゼ灞傝
             this.InitFloorRow();
@@ -289,7 +299,7 @@
                     this.AddFloorRow(keys, dicFloor[keys], i != count);
                 }
                 //璋冩暣鎺т欢楂樺害
-                listView.AdjustRealHeight(Application.GetRealHeight(23));
+                this.AdjustContrlTableHeight();
             });
         }
 
@@ -306,6 +316,7 @@
         private void AddFloorRow(string keys, string floorName, bool addLine)
         {
             var frameRow = new RowLayoutControl(listView.rowSpace / 2);
+            frameRow.MainKeys = keys;
             this.listView.AddChidren(frameRow);
             //鍥炬爣
             var btnIcon = frameRow.frameTable.AddLeftIcon(81);
@@ -395,8 +406,24 @@
                         }
                         else
                         {
+                            bool canMove = false;
+                            for (int i = 0; i < listView.ChildrenCount; i++)
+                            {
+                                var myRow = listView.GetChildren(i) as RowLayoutControl;
+                                if (myRow != null && myRow.MainKeys == keys)
+                                {
+                                    canMove = true;
+                                    continue;
+                                }
+                                if (canMove == true)
+                                {
+                                    //瀹冧箣鍚庣殑琛岋紝鍏ㄩ儴寰�涓婄Щ
+                                    myRow.Y -= frameRow.Height;
+                                }
+                            }
                             frameRow.RemoveFromParent();
-                            listView.AdjustRealHeight(Application.GetRealHeight(23));
+                            //璋冩暣妗屽竷楂樺害
+                            this.AdjustContrlTableHeight();
                         }
                     });
                 };
@@ -495,7 +522,7 @@
             btnRoomList.TextSize = 15;
             frameRoom.AddChidren(btnRoomList, ChidrenBindMode.NotBind);
 
-            listView = new VerticalListControl(29);
+            listView = new FrameListControl(29);
             listView.BackgroundColor = UserCenterColor.Current.White;
             listView.Y = frameRoom.Bottom;
             listView.Height = frameTable.Height - frameRoom.Bottom;
@@ -523,8 +550,8 @@
                 //娣诲姞鎴块棿琛�
                 this.AddRoomRow(listRoom[i], i != listRoom.Count - 1);
             }
-            //璋冩暣鎺т欢鐪熷疄楂樺害
-            listView.AdjustRealHeight(Application.GetRealHeight(23));
+            //璋冩暣妗屽竷楂樺害
+            this.AdjustContrlTableHeight();
         }
 
         #endregion
@@ -539,6 +566,7 @@
         private void AddRoomRow(Common.Room room, bool addLine)
         {
             var frameRow = new RowLayoutControl(listView.rowSpace / 2);
+            frameRow.MainKeys = room.Id;
             listView.AddChidren(frameRow);
             //鍥炬爣
             var btnIcon = frameRow.frameTable.AddLeftIcon(81);
@@ -602,8 +630,24 @@
                     }
                     else
                     {
+                        bool canMove = false;
+                        for (int i = 0; i < listView.ChildrenCount; i++)
+                        {
+                            var myRow = listView.GetChildren(i) as RowLayoutControl;
+                            if (myRow != null && myRow.MainKeys == room.Id)
+                            {
+                                canMove = true;
+                                continue;
+                            }
+                            if (canMove == true)
+                            {
+                                //瀹冧箣鍚庣殑琛岋紝鍏ㄩ儴寰�涓婄Щ
+                                myRow.Y -= frameRow.Height;
+                            }
+                        }
                         frameRow.RemoveFromParent();
-                        listView.AdjustRealHeight(Application.GetRealHeight(23));
+                        //璋冩暣妗屽竷楂樺害
+                        this.AdjustContrlTableHeight();
                     }
                 });
             };
@@ -812,6 +856,17 @@
             return true;
         }
 
+        /// <summary>
+        /// 璋冩暣鎺т欢妗屽竷楂樺害
+        /// </summary>
+        private void AdjustContrlTableHeight()
+        {
+            //璋冩暣妗屽竷楂樺害
+            listView.AdjustRealHeight(Application.GetRealHeight(23));
+            this.frameTable.Height = listView.Bottom;
+            this.listBackContr.AdjustTableHeight();
+        }
+
         #endregion
 
         #region 鈻� 缁撴瀯浣揰____________________________

--
Gitblit v1.8.0