陈嘉乐
2020-07-10 48ba446936b51fffafa7c3600c0dadc6ac0e8c20
ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
@@ -27,7 +27,6 @@
                    //初始化左滑菜单
                    roomManagement = new ListRoomViewFrom();
                    CommonPage.Instance.AddLeftView(roomManagement);
                    roomManagement.ShowForm();
                }
                return roomManagement;
            }
@@ -37,6 +36,10 @@
        /// 是否可以触发点击事件--是否可以跳转主页房间
        /// </summary>
        public bool CanClick = true;
        /// <summary>
        /// 是否初始化完成
        /// </summary>
        private bool isInitFinish = false;
        /// <summary>
        /// 当前楼层id
        /// </summary>
@@ -58,8 +61,7 @@
        /// 画面显示
        /// </summary>
        public void ShowForm()
        {
            roomManagement = this;
        {
            //初始化头部信息
            this.InitTopFrame();
            //初始化中部控件
@@ -90,10 +92,8 @@
            };
            //获取楼层
            if (this.curFloorId == string.Empty)
            {
                this.curFloorId = Config.Instance.Home.CurrentFloorId;
            }
            this.curFloorId = Config.Instance.Home.CurrentFloorId;
            var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
            if (dicFloor.Count == 0)
            {
@@ -124,8 +124,8 @@
                {
                    this.curFloorId = floorId;
                    btnFloor.Text = dicFloor[floorId];
                    //刷新房间列表
                    this.RefreshListRoom();
                    //刷新Body容器
                    this.RefreshBodyFrame();
                };
            };
        }
@@ -139,8 +139,8 @@
            listView.Height = bodyFrameLayout.Height;
            listView.Width = bodyFrameLayout.Width;
            bodyFrameLayout.AddChidren(listView);
            //刷新房间列表
            this.RefreshListRoom();
            //刷新Body容器
            this.RefreshBodyFrame();
        }
        #endregion
@@ -152,11 +152,27 @@
        /// </summary>
        public void RefreshListRoom()
        {
            //如果还没有初始化完成界面的话
            if (this.isInitFinish == false)
            {
                this.ShowForm();
                this.isInitFinish = true;
                return;
            }
            //把头部也一起初始化了
            this.topFrameLayout.RemoveAll();
            //初始化头部信息
            this.InitTopFrame();
            //刷新Body容器
            this.RefreshBodyFrame();
        }
        /// <summary>
        /// 刷新Body容器
        /// </summary>
        private void RefreshBodyFrame()
        {
            //先清空
            this.listView.frameTable.RemoveAll();
            this.listView.frameTable.Height = Application.GetRealHeight(100);
@@ -198,7 +214,6 @@
                    }
                    string oldFloorId = Config.Instance.Home.CurrentFloorId;
                    CommonPage.Instance.CloseLeftMenu();
                    HdlRoomLogic.Current.CurrentRoom = room;
                    HdlThreadLogic.Current.RunThread(() =>
                    {
@@ -213,12 +228,12 @@
                                if (oldFloorId != room.FloorId)
                                {
                                    //楼层都切换的话,刷新整个主页
                                    UserPage.Instance.Fresh();
                                    UserPage.Instance.ReFreshControl();
                                    return;
                                }
                            }
                            //如果只是切换当前楼层的其他房间,则只滑动主页的滑动控件
                            this.LoadFormMethodByName("HomeMainPageForm", "SetRoomPageViewSelect", room);
                            HomeMainPageForm.Instance?.SetRoomPageViewSelect(room);
                        });
                    });
                };
@@ -239,7 +254,7 @@
        private void InitRoomCardControl(int XX, int YY)
        {
            //桌布控件
            var frameBack = new FrameLayoutControl();
            var frameBack = new FrameLayoutStatuControl();
            frameBack.X = XX;
            frameBack.Y = YY;
            frameBack.Width = this.GetPictrueRealSize(495);
@@ -256,14 +271,14 @@
            picBackGroud.Gravity = Gravity.CenterHorizontal;
            picBackGroud.Radius = (uint)this.GetPictrueRealSize(29);
            picBackGroud.BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor3;
            frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEventOnly);
            frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEvent);
            //未分配图标
            var btnIcon = new PicViewControl(92, 72);
            btnIcon.X = this.GetPictrueRealSize(129);
            btnIcon.Y = this.GetPictrueRealSize(141);
            btnIcon.UnSelectedImagePath = "Room/NoNameRoom.png";
            frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
            frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
            //未分配
            var btnName = new NormalViewControl(141, 84, true);
@@ -272,7 +287,7 @@
            btnName.IsBold = true;
            btnName.TextColor = UserCenterColor.Current.White;
            btnName.TextID = R.MyInternationalizationString.Unallocated;
            frameBack.AddChidren(btnName, ChidrenBindMode.BindEventOnly);
            frameBack.AddChidren(btnName, ChidrenBindMode.BindEvent);
            frameBack.ButtonClickEvent += (sender, e) =>
            {
                if (this.CanClick == false)