xm
2020-07-21 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d
ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs
@@ -23,11 +23,11 @@
        /// <summary>
        /// 场景功能中部背景bodyView(高度为设备菜单的那个白色背景的上部到屏幕底部)
        /// </summary>
        public FrameLayout functionSceneBodyView;
        public NormalFrameLayout functionSceneBodyView;
        /// <summary>
        /// 中部背景bodyView(高度为场景功能切换控件的底部到屏幕底部)
        /// </summary>
        public FrameLayout functionSceneAutoBodyView;
        public NormalFrameLayout functionSceneAutoBodyView;
        /// <summary>
        /// 右上角添加按钮
        /// </summary>
@@ -82,7 +82,7 @@
        private void InitTopControl()
        {
            //头部FrameLayout
            this.topFrameLayout = new FrameLayout();
            this.topFrameLayout = new NormalFrameLayout();
            topFrameLayout.Y = Application.GetRealHeight(104);
            topFrameLayout.Height = Application.GetRealHeight(127);
            topFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
@@ -130,7 +130,7 @@
        private void InitMidControls()
        {
            //应该是body吧
            this.bodyFrameLayout = new FrameLayout();
            this.bodyFrameLayout = new NormalFrameLayout();
            bodyFrameLayout.Y = topFrameLayout.Bottom;
            bodyFrameLayout.Height = this.Height - topFrameLayout.Bottom;
            bodyFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
@@ -152,18 +152,21 @@
                btnFloorName.Y = Application.GetRealHeight(17);
                btnFloorName.TextAlignment = TextAlignment.CenterRight;
                btnFloorName.IsBold = true;
                btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(Config.Instance.Home.CurrentFloorId);
                btnFloorName.Text = Common.Config.Instance.Home.GetCurrentFloorName;
                frameSwitchBack.AddChidren(btnFloorName);
                btnFloorName.ButtonClickEvent += (sender, e) =>
                {
                    var floors = new SelectFloorForm();
                    floors.CurFloorId = Config.Instance.Home.CurrentFloorId;
                    AddChidren(floors);
                    floors.Init(580, 330, Direction.Right);
                    floors.changeFloor = true;
                    floors.FloorAction += (floorId) =>
                    {
                        btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(floorId);
                        Config.Instance.Home.CurrentFloorId = floorId;
                        HdlRoomLogic.Current.NowCategoryRoom = HdlRoomLogic.Current.GetLoveRoom();
                        //这个时候需要刷新主页
                        UserPage.Instance.RefreshMainPageForm = true;
                        //刷新bodyView
                        this.RefreshBodyView();
                    };
@@ -181,13 +184,14 @@
            }
            //目前不知道郭雪城的这个具体放在哪个的位置
            this.functionSceneAutoBodyView = new FrameLayout();
            this.functionSceneAutoBodyView = new NormalFrameLayout();
            functionSceneAutoBodyView.Y = frameSwitchBack.Bottom;
            functionSceneAutoBodyView.Height = bodyFrameLayout.Height - frameSwitchBack.Bottom;
            bodyFrameLayout.AddChidren(functionSceneAutoBodyView);
            //场景,功能,自动化的切换控件
            var switchContr = new SceneFunctionSwitchControl();
            switchContr.Y = Application.GetRealHeight(40);
            switchContr.Width = Application.GetRealWidth(650);
            switchContr.Gravity = Gravity.CenterVertical;
            frameSwitchBack.AddChidren(switchContr);
@@ -276,7 +280,7 @@
        private void InitRoomMenuControl()
        {
            //当前楼层的全部房间
            var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
            var lisrRoom = HdlRoomLogic.Current.GetRoomsByFloorIdAppendLoveRoom(Config.Instance.Home.CurrentFloorId);
            if (HdlRoomLogic.Current.NowCategoryRoom == null)
            {
                //设置第一个为初始房间
@@ -317,7 +321,7 @@
            };
            //功能和场景bodyView
            this.functionSceneBodyView = new FrameLayout();
            this.functionSceneBodyView = new NormalFrameLayout();
            functionSceneBodyView.Y = roomSwitchContr.Bottom;
            functionSceneBodyView.Height = functionSceneAutoBodyView.Height - roomSwitchContr.Bottom;
            functionSceneAutoBodyView.AddChidren(functionSceneBodyView);
@@ -632,10 +636,14 @@
                        HdlThreadLogic.Current.RunMain(() =>
                        {
                            listview1.EndHeaderRefreshing();
                            if (result == true)
                            //listview1.Parent为null代表它切换房间了
                            if (result == true && listview1.Parent != null)
                            {
                                //刷新场景的时候,关闭左划菜单的未分配界面
                                MainPage.LeftListRoomViewFrom.Instance?.CloseUnallocatedRoomForm();
                                //在外面清空(特效的问题)
                                this.functionSceneBodyView.RemoveAll();
                                HdlThreadLogic.Current.RunMainInThread(() =>
                                {
                                    //刷新场景分支控件
@@ -816,7 +824,11 @@
                        //已经接收到网关的反馈 2020.05.09:删除Ack主题
                        this.dicDeviceRowControl[mainKeys].SetHadGetResponeResultStatu();
                        //刷新控件
                        this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
                        if (locadevice.Type != DeviceType.IASZone)
                        {
                            //传感器不需要属性上报(但是那个球型传感器居然会属性上报)
                            this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
                        }
                    }
                }, ShowErrorMode.NO);
            });
@@ -857,10 +869,8 @@
                    string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
                    if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true)
                    {
                        //本地设备对象
                        var locadevice = LocalDevice.Current.GetDevice(mainKeys);
                        //刷新卡片信息
                        this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice);
                        //开启行闪烁特效
                        this.dicDeviceRowControl[mainKeys].StartRowLightAppeal();
                    }
                }, ShowErrorMode.NO);