xm
2020-05-18 cf0bffdf072bae11bdb8c780d0a355818700f713
请合并代码,优化面板问题
7个文件已修改
297 ■■■■ 已修改文件
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs 99 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs
@@ -156,7 +156,7 @@
            framePmPic.AddChidren(btnPmStatus);
            this.listControl.Add(btnPmStatus);
            //PM2.5单位
            //PM2.5单位  (第4个,listControl【3】)
            var btnPmUnit = new NormalViewControl(120 + 26, 43, true);
            btnPmUnit.Y = Application.GetRealHeight(181 + 46);
            btnPmUnit.X = Application.GetRealWidth(153);
@@ -165,6 +165,23 @@
            btnPmUnit.TextColor = ZigbeeColor.Current.XMWhite;
            btnPmUnit.TextAlignment = TextAlignment.CenterLeft;
            framePmPic.AddChidren(btnPmUnit);
            this.listControl.Add(btnPmUnit);
            frameHumidityPic.MouseUpEventHandler += (sender, e) =>
            {
                pMSensor.currentPmData = 35;
                UpdateStatus();
            };
            frameTemperaturePic.MouseUpEventHandler += (sender, e) =>
            {
                pMSensor.currentPmData = 99;
                UpdateStatus();
            };
            framePmPic.MouseUpEventHandler += (sender, e) =>
            {
                pMSensor.currentPmData = 100;
                UpdateStatus();
            };
        }
        #endregion
@@ -261,30 +278,70 @@
            if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                if (pMSensor.currentPmData < 10)
                {
                    this.listControl[2].Width = Application.GetRealWidth(193 - 70);
                    this.listControl[3].X = Application.GetRealWidth(180 - 70);
                }
                else
                {
                    this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                    this.listControl[3].X = Application.GetRealWidth(153 - 25);
                    this.listControl[2].BackgroundColor = 0xff00ff00;
                    this.listControl[3].BackgroundColor = 0xff00ffff;
                }
            }
            else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                this.listControl[3].X = Application.GetRealWidth(153 - 25);
            }
            else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                if (pMSensor.currentPmData < 100)
                {
                    this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                    this.listControl[3].X = Application.GetRealWidth(153 - 25);
                    this.listControl[2].BackgroundColor = 0xff00ff00;
                    this.listControl[3].BackgroundColor = 0xff00ffff;
                }
                else
                {
                    this.listControl[2].Width = Application.GetRealWidth(162);
                    this.listControl[3].X = Application.GetRealWidth(153);
                    this.listControl[2].BackgroundColor = 0xff00ff00;
                    this.listControl[3].BackgroundColor = 0xff00ffff;
                }
            }
            else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else if (pMSensor.currentPmData > 250)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else
            {
                curQuality = "";
                this.listControl[2].Width = Application.GetRealWidth(0);
                this.listControl[3].Gravity = Gravity.CenterHorizontal;
            }
            //设置状态文字
            return curQuality;
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs
old mode 100755 new mode 100644
@@ -63,7 +63,7 @@
                    }
                    this.dicScenes[tempScene.Id] = tempScene;
                }
                catch(Exception ex)
                catch (Exception ex)
                {
                    HdlLogLogic.Current.WriteLog(ex);
                    try
@@ -589,13 +589,14 @@
        /// <returns></returns>
        public string GetZoneById(int sceneId)
        {
            var room =HdlRoomLogic.Current.GetRoomBySceneId(sceneId);
            var room = HdlRoomLogic.Current.GetRoomBySceneId(sceneId);
            if (room == null)
            {
                return null;
            }
            var floorName = Shared.Common.Config.Instance.Home.GetFloorNameById(room.FloorId);
            if (floorName == null)
            //更改代码:如果floorName=“”也要判断,否则有“,”
            if (string.IsNullOrEmpty(floorName))
            {
                return room.Name;
            }
@@ -659,8 +660,8 @@
                        sceneUIs.Add(this.dicScenes[sceneId]);
                    }
                }
            }
            }
            return sceneUIs;
        }
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs
old mode 100755 new mode 100644
@@ -354,10 +354,12 @@
                    continue;
                }
                roomTempList.Add(room);
                if (roomTempList.Count != 0)
                {
                    curRoom = roomTempList[0];
                }
            }
            for (int i = 0; i < roomTempList.Count; i++)
            {
                var room = roomTempList[i];
                curRoom = roomTempList[0];
                var btnRoomFrameLayout = new FrameLayout
                {
@@ -391,6 +393,18 @@
                    curentOldRoom = btnRoom;
                    curentOldRoomFrameLayout = btnRoomFrameLayout;
                }
                if (index == roomTempList.Count - 1 && index > 3)
                {
                    var btnRoomFrameLayoutEmpty = new FrameLayout
                    {
                        Height = Application.GetMinReal(159),
                        Width = Application.GetMinReal(50),
                        Y = Application.GetRealHeight(23),
                        X = Application.GetRealWidth(5),
                        BorderWidth = 1,
                    };
                    btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayoutEmpty);
                }
                EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                {
                    if (!btnRoom.IsSelected)
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -151,7 +151,6 @@
            btnHorizontalScrolViewLayout = new HorizontalScrolViewLayout
            {
                X = Application.GetRealWidth(58),
                BackgroundColor = 0xff00ff00,
            };
            btnMidTopLayout.AddChidren(btnHorizontalScrolViewLayout);
@@ -491,11 +490,11 @@
                {
                    roomTempList.Add(room);
                }
                if (roomTempList.Count != 0)
                {
                    curRoom = roomTempList[0];
                }
            }
            for (int i = 0; i < roomTempList.Count; i++)
            {
                var room = roomTempList[i];
                curRoom = roomTempList[0];
                var btnRoomFrameLayout = new FrameLayout
                {
                    Height = Application.GetMinReal(159),
@@ -528,6 +527,20 @@
                    curentOldRoom = btnRoom;
                    curentOldRoomFrameLayout = btnRoomFrameLayout;
                }
                if (index == roomTempList.Count - 1 && index > 3)
                {
                    var btnRoomFrameLayoutEmpty = new FrameLayout
                    {
                        Height = Application.GetMinReal(159),
                        Width = Application.GetMinReal(50),
                        Y = Application.GetRealHeight(23),
                        X = Application.GetRealWidth(5),
                        BorderWidth = 1,
                    };
                    btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayoutEmpty);
                }
                EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                {
                    if (!btnRoom.IsSelected)
@@ -695,48 +708,42 @@
                    }
                }
                bool IsTip = false;
                EventHandler<MouseEventArgs> hander = (sender, e) =>
                {
                    if (currentKey.bindList.Count != 0)
                    {
                        if (IsTip)
                        {
                            return;
                        }
                        IsTip = true;
                        if (btnChoose.IsSelected)
                        {
                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindExist), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnBindName);
                            return;
                        }
                    }
               {
                   if (currentKey.bindList.Count != 0)
                   {
                       if (btnChoose.IsSelected)
                       {
                           new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindExist), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnBindName);
                           return;
                       }
                   }
                    if (!btnChoose.IsSelected)
                    {
                        if (oldScene != null)
                        {
                            oldScene.IsSelected = false;
                            oldScene.Visible = false;
                        }
                        oldScene = btnChoose;
                        oldScene.IsSelected = true;
                        oldScene.Visible = true;
                        targetListDevice.Clear();
                        targetListScene.Clear();
                        targetListScene.Add(scene);
                    }
                    if (targetListDevice.Count == 0 && targetListScene.Count == 0)
                    {
                        btnFinifh.Enable = false;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                    }
                    else
                    {
                        btnFinifh.Enable = true;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    }
                };
                   if (!btnChoose.IsSelected)
                   {
                       if (oldScene != null)
                       {
                           oldScene.IsSelected = false;
                           oldScene.Visible = false;
                       }
                       oldScene = btnChoose;
                       oldScene.IsSelected = true;
                       oldScene.Visible = true;
                       targetListDevice.Clear();
                       targetListScene.Clear();
                       targetListScene.Add(scene);
                   }
                   if (targetListDevice.Count == 0 && targetListScene.Count == 0)
                   {
                       btnFinifh.Enable = false;
                       btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                   }
                   else
                   {
                       btnFinifh.Enable = true;
                       btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                   }
               };
                rowLayout.MouseUpEventHandler += hander;
                devicePic.MouseUpEventHandler += hander;
                btnBindName.MouseUpEventHandler += hander;
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirButtonSettionForm.cs
@@ -259,7 +259,15 @@
                        {
                            continue;
                        }
                        bindFreshAirName = device.DeviceEpointName;
                        if (string.IsNullOrEmpty(bDev.ESName))
                        {
                            bindFreshAirName = device.DeviceEpointName;
                        }
                        else
                        {
                            bindFreshAirName = bDev.ESName;
                        }
                        bindFreshAirDev = device;
                    }
                    if (device.Type == DeviceType.TemperatureSensor)
@@ -267,35 +275,83 @@
                        var bD = device as TemperatureSensor;
                        if (bD.SensorDiv == 1)
                        {
                            bindTemperatureName = device.DeviceEpointName;
                            if (string.IsNullOrEmpty(bDev.ESName))
                            {
                                bindTemperatureName = device.DeviceEpointName;
                            }
                            else
                            {
                                bindTemperatureName = bDev.ESName;
                            }
                            bindTemperatureDev = device;
                        }
                        if (bD.SensorDiv == 2)
                        {
                            bindHumidityName = device.DeviceEpointName;
                            if (string.IsNullOrEmpty(bDev.ESName))
                            {
                                bindHumidityName = device.DeviceEpointName;
                            }
                            else
                            {
                                bindHumidityName = bDev.ESName;
                            }
                            bindHumidityDev = device;
                        }
                    }
                    if (device.Type == DeviceType.FreshAirHumiditySensor)
                    {
                        bindHumidityName = device.DeviceEpointName;
                        if (string.IsNullOrEmpty(bDev.ESName))
                        {
                            bindHumidityName = device.DeviceEpointName;
                        }
                        else
                        {
                            bindHumidityName = bDev.ESName;
                        }
                        bindHumidityDev = device;
                    }
                    if (device.Type == DeviceType.PMSensor)
                    {
                        if (bDev.BindCluster == 1026)
                        {
                            bindTemperatureName = device.DeviceEpointName;
                            if (string.IsNullOrEmpty(bDev.ESName))
                            {
                                bindTemperatureName = device.DeviceEpointName;
                            }
                            else
                            {
                                bindTemperatureName = bDev.ESName;
                            }
                            bindTemperatureDev = device;
                        }
                        if (bDev.BindCluster == 1029)
                        {
                            bindHumidityName = device.DeviceEpointName;
                            if (string.IsNullOrEmpty(bDev.ESName))
                            {
                                bindHumidityName = device.DeviceEpointName;
                            }
                            else
                            {
                                bindHumidityName = bDev.ESName;
                            }
                            bindHumidityDev = device;
                        }
                        if (bDev.BindCluster == 1066)
                        {
                            bindPmName = device.DeviceEpointName;
                            if (string.IsNullOrEmpty(bDev.ESName))
                            {
                                bindPmName = device.DeviceEpointName;
                            }
                            else
                            {
                                bindPmName = bDev.ESName;
                            }
                            bindPMDev = device;
                        }
                    }
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
@@ -342,6 +342,19 @@
                    }
                }
                if (index == roomTempList.Count - 1 && index > 3)
                {
                    var btnRoomFrameLayoutEmpty = new FrameLayout
                    {
                        Height = Application.GetMinReal(159),
                        Width = Application.GetMinReal(50),
                        Y = Application.GetRealHeight(23),
                        X = Application.GetRealWidth(5),
                        BorderWidth = 1,
                    };
                    btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayoutEmpty);
                }
                EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                {
                    if (!btnRoom.IsSelected)
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -83,7 +83,7 @@
        /// <summary>
        /// 中部布局中门锁名称显示
        /// </summary>
        Button btnDoorLockTitle;
        NormalViewControl btnDoorLockTitle;
        /// <summary>
        /// 分享
        /// </summary>
@@ -252,18 +252,15 @@
            };
            this.midFrameLayout.AddChidren(midTopFrameLayout);
            //门锁标题
            btnDoorLockTitle = new Button()
            {
                Width = Application.GetRealWidth(250),
                Height = Application.GetRealHeight(60),
                X = Application.GetRealWidth(372),
                Y = Application.GetRealHeight(46),
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 15,
                TextAlignment = TextAlignment.Center,
                IsBold = true,
            };
            //设备名称
            btnDoorLockTitle = new NormalViewControl(100, 60, true);
            btnDoorLockTitle.Y = Application.GetRealHeight(46);
            btnDoorLockTitle.TextSize = 15;
            btnDoorLockTitle.IsBold = true;
            btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
            btnDoorLockTitle.Width = btnDoorLockTitle.GetRealWidthByText();
            btnDoorLockTitle.TextAlignment = TextAlignment.Center;
            btnDoorLockTitle.Gravity = Gravity.CenterHorizontal;
            midTopFrameLayout.AddChidren(btnDoorLockTitle);
            //记录