wjc
2023-03-14 87c5e522b8ead5f8d5d201323e14e7aa438e84ec
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -6,6 +6,7 @@
using HDL_ON.Entity;
using HDL_ON.DriverLayer;
using HDL_ON.UI.Music;
using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock;
namespace HDL_ON.UI
{
@@ -39,6 +40,10 @@
        /// 区域
        /// </summary>
        private Button btnCurrDeviceRoom;
        /// <summary>
        /// 电量父控件
        /// </summary>
        private FrameLayout cellFrame;
        /// <summary>
        /// 电量
        /// </summary>
@@ -164,11 +169,7 @@
            };
            whiteFl.AddChidren(btnCurrDeviceName);
            btnCurrDeviceName.Width = btnCurrDeviceName.GetTextWidth();
            if (btnCurrDeviceName.GetTextWidth() > btnCollectIcon.X)
            {
                btnCurrDeviceName.Width = btnCollectIcon.X;
            }
            btnCurrDeviceRoom = new Button
            {
                TextSize = TextSize.Text12,
@@ -181,9 +182,8 @@
                TextAlignment = TextAlignment.CenterLeft,
            };
            whiteFl.AddChidren(btnCurrDeviceRoom);
            btnCurrDeviceRoom.Width = btnCurrDeviceRoom.GetTextWidth();
            var cellFrame = new FrameLayout
            cellFrame = new FrameLayout
            {
                X = btnCurrDeviceRoom.Right + Application.GetRealWidth(20),
                Y = btnCurrDeviceName.Bottom + Application.GetRealHeight(5),
@@ -191,8 +191,6 @@
                Height = Application.GetRealHeight(16),
            };
            whiteFl.AddChidren(cellFrame);
            cellDiyArcSeekBar = new DiyArcSeekBar
            {
@@ -221,9 +219,6 @@
            cellFrame.AddChidren(btnCell);
            //门锁状态
            btnDoorLockIcon = new Button
            {
@@ -235,6 +230,9 @@
                SelectedImagePath = "FunctionIcon/DoorLock/UnLocking.png",
            };
            whiteFl.AddChidren(btnDoorLockIcon);
            this.CalculatedPosition();//重新计算宽度
            int heightY = btnDoorLockIcon.Bottom + Application.GetRealHeight(70);
            //实时视频
            rtvFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
@@ -263,6 +261,8 @@
            pswFL.AddTextButtonView();
            pswFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/OneOpenLock.png";
            pswFL.GetTextButton().TextID = StringId.linshimima1;
            #endregion
@@ -295,19 +295,10 @@
                    ////刷新显示
                    this.btnDeviceName.Text = this.device.name;
                    this.btnRoomName.Text = this.device.GetRoomListName();
                    this.topView.topNameBtn.Text = this.device.name;
                    this.btnCurrDeviceName.Text = this.device.name;
                    this.btnCurrDeviceRoom.Text = this.device.GetRoomListName();
                    this.CalculatedPosition();//重新计算宽度
                    ////从新计算宽度
                    //this.btnDeviceName.Text = btnDeviceName.Text;
                    //this.btnDeviceName.Width = this.btnDeviceName.GetTextWidth();
                    //this.btnRoomName.Text = btnRoomName.Text;
                    //this.btnRoomName.Width = this.btnRoomName.GetTextWidth();
                    ////回调事件
                    //this.SettionFinishEvent?.Invoke();
                }, () =>
                {
                    //解绑设备后
@@ -327,12 +318,16 @@
            //实时视频
            this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) =>
            {
               CommonMethod.Current.SkipRTVActivity(this.device.sid,this.device.deviceId,this.device.spk);
            });
            //临时密码
            this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => { });
            this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => {
                CommonMethod.Current.SkipPSWActivity();
            });
            //历史记录
            this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => { });
            this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => {
                CommonMethod.Current.SkipRecordActivity();
            });
        }
@@ -369,6 +364,27 @@
            })
            { IsBackground = true }.Start() ;
        }
        /// <summary>
        /// 重新计算宽度(设备名称,房间控件)
        /// </summary>
        private void CalculatedPosition()
        {
            this.btnCurrDeviceName.Width = this.btnCurrDeviceName.GetTextWidth();
            if (this.btnCurrDeviceName.GetTextWidth() > this.btnCollectIcon.X)
            {
                //重新计算宽度
                this.btnCurrDeviceName.Width = this.btnCollectIcon.X + Application.GetRealWidth(-10);
            }
            this.btnCurrDeviceRoom.Width = this.btnCurrDeviceRoom.GetTextWidth();
            if (this.btnCurrDeviceRoom.GetTextWidth() > this.btnCollectIcon.X)
            {
                //重新计算宽度
                this.btnCurrDeviceRoom.Width = this.btnCollectIcon.X + Application.GetRealWidth(-20 - 10);
            }
            this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20);
        }
    }
    /// <summary>
    /// 自己弄一个FrameLayout