xm
2020-04-22 dfa6733793434bdcfd394f978ae72f1628b2260f
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 ■ 结构体_____________________________