HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -88,8 +88,8 @@
        /// 构造函数
        /// </summary>
        /// <param name="function">设备</param>
        /// <param name="btnDeviceName">上一级界面的设备名字控件</param>
        /// <param name="btnRoomName">上一级界面的房间名字控件</param>
        /// <param name="btnDeviceName">上一级界面的设备名字控件(注:不能传null,没有可以传new Button())</param>
        /// <param name="btnRoomName">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param>
        public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, CommonMethod.Comerom comerom, Action action)
        {
            this.device = function;
@@ -216,9 +216,15 @@
            };
            cellFrame.AddChidren(btnCell);
#if __IOS__
            btnCell.Width += 5;
            cellFrame.Width += 5;
#else
#endif
            //门锁状态
            btnDoorLockIcon = new Button
                        //门锁状态
                        btnDoorLockIcon = new Button
            {
                X = Application.GetRealWidth(65),
                Y = Application.GetRealHeight(108),
@@ -274,36 +280,39 @@
            //返回
            this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                RemoveFromParent();
                this.RemoveFromParent();
            };
            //设置
            this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) =>
            {
                //调用秀绕的界面
                var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>
                CommonMethod.Current.MainThread(() =>
                {
                    //调用秀绕的界面
                    var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>
                     {
                         if (this.btnDeviceName == null || this.btnRoomName == null || this.device == null)
                         {
                             return;
                         }
                         ////刷新显示
                         this.btnDeviceName.Text = this.device.name;
                         this.btnRoomName.Text = this.device.GetRoomListName();
                         this.btnCurrDeviceName.Text = this.device.name;
                         this.btnCurrDeviceRoom.Text = this.device.GetRoomListName();
                         this.CalculatedPosition();//重新计算宽度
                     });
                    infoView.actionDel += () =>
                      {
                          //解绑设备后
                          this.RemoveFromParent();
                          this.action?.Invoke();
                    if (this.btnDeviceName == null || this.btnRoomName == null)
                    {
                        return;
                    }
                    ////刷新显示
                    this.btnDeviceName.Text = this.device.name;
                    this.btnRoomName.Text = this.device.GetRoomListName();
                    this.btnCurrDeviceName.Text = this.device.name;
                    this.btnCurrDeviceRoom.Text = this.device.GetRoomListName();
                    this.CalculatedPosition();//重新计算宽度
                }, () =>
                {
                    //解绑设备后
                    this.RemoveFromParent();
                    this.action?.Invoke();
                      };
                    MainPage.BasePageView.AddChidren(infoView);
                    infoView.LoadPage();
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                });
                MainPage.BasePageView.AddChidren(infoView);
                infoView.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            //收藏
            this.btnCollectIcon.MouseUpEventHandler += (sender, e) =>
@@ -314,15 +323,17 @@
            //实时视频
            this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) =>
            {
               CommonMethod.Current.SkipRTVActivity(this.device.sid,this.device.deviceId,this.device.spk);
                CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk, false);
            });
            //临时密码
            this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => {
                CommonMethod.Current.SkipPSWActivity();
            this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) =>
            {
                CommonMethod.Current.SkipPSWActivity(this.device.deviceId);
            });
            //历史记录
            this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => {
                CommonMethod.Current.SkipRecordActivity();
            this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) =>
            {
                CommonMethod.Current.SkipRecordActivity(this.device.deviceId);
            });
@@ -358,18 +369,22 @@
            });
        }
        /// <summary>
        /// 重新计算宽度(设备名称,房间控件)
        /// </summary>
        private void CalculatedPosition()
        {
            this.btnCurrDeviceName.Width = this.btnCurrDeviceName.GetTextWidth();
            this.btnCurrDeviceName.Width += 10;
            if (this.btnCurrDeviceName.GetTextWidth() > this.btnCollectIcon.X)
            {
                //重新计算宽度
                this.btnCurrDeviceName.Width = this.btnCollectIcon.X + Application.GetRealWidth(-10);
            }
            this.btnCurrDeviceRoom.Width = this.btnCurrDeviceRoom.GetTextWidth();
            this.btnCurrDeviceRoom.Width += 10;
            if (this.btnCurrDeviceRoom.GetTextWidth() > this.btnCollectIcon.X)
            {
                //重新计算宽度
@@ -378,6 +393,33 @@
            this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20);
        }
        /// <summary>
        /// 更新状态
        /// </summary>
        public void UpdateState(PushMessageType pushMessageType)
        {
            CommonMethod.Current.MainThread(() =>
            {
                if (pushMessageType == PushMessageType.Alarm)
                {
                    //门锁电池值
                    if (this.btnCell != null)
                    {
                        //videoDoorLockPage.btnCell.Text = "";
                    }
                }
                else
                {
                    if (this.btnDoorLockIcon != null && !this.btnDoorLockIcon.IsSelected)
                    {
                        this.btnDoorLockIcon.IsSelected = false;
                    }
                }
            });
        }
    }
    /// <summary>
    /// 自己弄一个FrameLayout