黄学彪
2020-07-06 f23ad1b3f9f6193f35f72104d690b21dc67d5c1f
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>
@@ -54,6 +54,7 @@
        /// </summary>
        public CategoryMainForm()
        {
            this.FormID = "CategoryMainForm";
            BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor;
            instance = this;
        }
@@ -81,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;
@@ -129,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;
@@ -161,7 +162,7 @@
                    floors.changeFloor = true;
                    floors.FloorAction += (floorId) =>
                    {
                        btnFloorName.Text = Config.Instance.Home.GetFloorNameById(floorId);
                        btnFloorName.Text = HdlResidenceLogic.Current.GetFloorNameById(floorId);
                        HdlRoomLogic.Current.NowCategoryRoom = HdlRoomLogic.Current.GetLoveRoom();
                        //刷新bodyView
                        this.RefreshBodyView();
@@ -180,7 +181,7 @@
            }
            //目前不知道郭雪城的这个具体放在哪个的位置
            this.functionSceneAutoBodyView = new FrameLayout();
            this.functionSceneAutoBodyView = new NormalFrameLayout();
            functionSceneAutoBodyView.Y = frameSwitchBack.Bottom;
            functionSceneAutoBodyView.Height = bodyFrameLayout.Height - frameSwitchBack.Bottom;
            bodyFrameLayout.AddChidren(functionSceneAutoBodyView);
@@ -316,7 +317,7 @@
            };
            //功能和场景bodyView
            this.functionSceneBodyView = new FrameLayout();
            this.functionSceneBodyView = new NormalFrameLayout();
            functionSceneBodyView.Y = roomSwitchContr.Bottom;
            functionSceneBodyView.Height = functionSceneAutoBodyView.Height - roomSwitchContr.Bottom;
            functionSceneAutoBodyView.AddChidren(functionSceneBodyView);
@@ -532,6 +533,11 @@
                    {
                        cardContr = new Controls.DeviceDoorLockRowControl();
                    }
                    //色温灯
                    else if (device.Type == DeviceType.ColorTemperatureLight)
                    {
                        cardContr = new Controls.DeviceColorTemperatureRowControl();
                    }
                    //无法识别
                    else
                    {
@@ -605,6 +611,20 @@
                //下拉刷新
                listview1.BeginHeaderRefreshingAction += () =>
                {
                    //如果当前是虚拟住宅,则只给个特效
                    if (Common.Config.Instance.Home.IsVirtually == true)
                    {
                        HdlThreadLogic.Current.RunThread(() =>
                        {
                            System.Threading.Thread.Sleep(1500);
                            HdlThreadLogic.Current.RunMain(() =>
                            {
                                listview1.EndHeaderRefreshing();
                            });
                        });
                        return;
                    }
                    HdlThreadLogic.Current.RunThread(() =>
                    {
                        //从网关刷新场景列表
@@ -783,7 +803,7 @@
        private void AddNormalDeviceReportEvent()
        {
            //设备属性上报(缓存的修改交由 HdlGatewayReceiveLogic 处理)
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceStatus", ReceiveComandDiv.A设备属性上报, (report) =>
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormDeviceStatus", ReceiveComandDiv.A设备属性上报, (report) =>
            {
                HdlThreadLogic.Current.RunMain(() =>
                {
@@ -802,7 +822,7 @@
            });
            //设备在线上报(缓存的修改交由 HdlGatewayReceiveLogic 处理)
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceOnline", ReceiveComandDiv.A设备在线上报, (report) =>
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormDeviceOnline", ReceiveComandDiv.A设备在线上报, (report) =>
            {
                HdlThreadLogic.Current.RunMain(() =>
                {
@@ -829,7 +849,7 @@
        private void AddSensorDeviceReportEvent()
        {
            //传感器上报(缓存的修改交由 HdlGatewayReceiveLogic 处理)
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewSensor", ReceiveComandDiv.A传感器上报, (report) =>
            HdlGatewayReceiveLogic.Current.AddAttributeEvent("CategoryMainFormSensor", ReceiveComandDiv.A传感器上报, (report) =>
            {
                HdlThreadLogic.Current.RunMain(() =>
                {
@@ -837,10 +857,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);
@@ -904,6 +922,9 @@
        {
            //把静态变量的这个东西置空
            instance = null;
            HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormDeviceStatus");
            HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormDeviceOnline");
            HdlGatewayReceiveLogic.Current.RemoveEvent("CategoryMainFormSensor");
            base.CloseFormBefore();
        }