wjc
2023-03-07 8fdb0e0c9d04b5069e9c83e9a5f38ba085485663
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
@@ -32,13 +32,25 @@
        /// </summary>
        private TopView topView;
        /// <summary>
        /// 当前设备名称
        /// </summary>
        private Button btnCurrDeviceName;
        /// <summary>
        /// 区域
        /// </summary>
        private Button btnCurrDeviceRoom;
        /// <summary>
        /// 电量
        /// </summary>
        private Button btnCell;
        /// <summary>
        ///收藏图标
        /// </summary>
        private Button btnCollectIcon;
        /// <summary>
        /// 门锁状态
        /// </summary>
        private CustomFrameLayout doorLockFL;
        private Button btnDoorLockIcon;
        /// <summary>
        /// 实时视频
        /// </summary>
@@ -55,6 +67,7 @@
        /// 历史记录
        /// </summary>
        private CustomFrameLayout recordFL;
        /// <summary>
        /// 表示来自那个界面
        /// </summary>
@@ -82,7 +95,7 @@
            //初始化UI
            this.InitUI();
            //初始化事件
            this.Events();
            this.EventListener ();
        }
@@ -95,17 +108,71 @@
            this.BackgroundColor = MusicColor.ViewColor;
            this.topView = new TopView();
            this.topView.setBtn.Visible = true;
            this.topView.topNameBtn.Text = this.device.name;
            this.topView.topNameBtn.TextID =StringId.shipinmensuo;
            this.AddChidren(topView.TopFLayoutView());
            var middLayout = new FrameLayout
            var middleFl=new FrameLayout
            {
                Y = topView.fLayout.Bottom,
                Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
            };
            this.AddChidren(middLayout);
            this.AddChidren(middleFl);
            var whiteFl = new FrameLayout
            {
                Y = Application.GetRealHeight(24),
                X = Application.GetRealWidth(24),
                Height = Application.GetRealHeight(526),
                Width = Application.GetRealWidth(327),
                BackgroundImagePath = "MusicIcon/playBj.png",
                Name = "fl",
            };
            middleFl.AddChidren(whiteFl);
            btnCurrDeviceName= new Button
            {
                TextSize = TextSize.Text24,
                TextColor = MusicColor.Text18Color,
                Width = Application.GetRealWidth(160),
                Height = Application.GetRealHeight(33),
                Y = Application.GetRealHeight(16),
                X = Application.GetRealWidth(16),
                Text = this.device.name,
                TextAlignment=TextAlignment.CenterLeft,
            };
            whiteFl.AddChidren(btnCurrDeviceName);
            btnCurrDeviceRoom = new Button
            {
                TextSize = TextSize.Text12,
                TextColor = MusicColor.MusicNoTxetColor,
                Width = Application.GetRealWidth(160),
                Height = Application.GetRealHeight(33),
                Y = btnCurrDeviceName.Bottom+ Application.GetRealHeight(4),
                X = Application.GetRealWidth(16),
                Text = this.device.GetRoomListName(),
                TextAlignment = TextAlignment.CenterLeft,
            };
            whiteFl.AddChidren(btnCurrDeviceRoom);
            btnCurrDeviceRoom.Width=btnCurrDeviceName.GetTextWidth();
            btnCell = new Button
            {
                TextSize = TextSize.Text10,
                TextColor = MusicColor.TextColor,
                Y = Application.GetRealHeight(43),
                X = btnCurrDeviceRoom.Right+Application.GetRealWidth(17),
                //Text ="60"+"%",
                //TextAlignment = TextAlignment.Center,
                Width = Application.GetRealWidth(36),
                Height = Application.GetRealWidth(36),
                UnSelectedImagePath ="FunctionIcon/DoorLock/Cell.png",
            };
            whiteFl.AddChidren(btnCell);
            btnCollectIcon = new Button
            {
                X = Application.GetRealWidth(273),
                X = Application.GetRealWidth(264),
                Y = Application.GetRealHeight(14),
                Width = Application.GetRealWidth(40),
                Height = Application.GetRealWidth(40),
@@ -114,54 +181,63 @@
                IsSelected= this.device.collect,
                Name = "collect"
            };
            middLayout.AddChidren(btnCollectIcon);
            whiteFl.AddChidren(btnCollectIcon);
            //门锁状态
            doorLockFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(doorLockFL);
            doorLockFL.X = Application.GetRealWidth(40);
            doorLockFL.Y = btnCollectIcon.Bottom + Application.GetRealHeight(20);
            doorLockFL.AddImageView();
            doorLockFL.AddTextButtonView();
            doorLockFL.GetTextButton().TextID = StringId.shishishipin;
            btnDoorLockIcon = new Button
            {
                X = Application.GetRealWidth(65),
                Y = Application.GetRealHeight(108),
                Width = Application.GetRealWidth(198),
                Height = Application.GetRealWidth(200),
                UnSelectedImagePath = "FunctionIcon/DoorLock/UnLocked.png",
                SelectedImagePath = "FunctionIcon/DoorLock/UnLocking.png",
            };
            whiteFl.AddChidren(btnDoorLockIcon);
            //实时视频
            rtvFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(rtvFL);
            rtvFL.X = Application.GetRealWidth(20);
            rtvFL.Y = Application.GetRealHeight(300);
            whiteFl.AddChidren(rtvFL);
            rtvFL.Y = btnDoorLockIcon.Bottom+ Application.GetRealHeight(45);
            rtvFL.X = Application.GetRealWidth(68);
            rtvFL.AddImageView();
            rtvFL.AddTextButtonView();
            rtvFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/RTV.png";
            rtvFL.GetTextButton().TextID = StringId.shishishipin;
            //历史记录
            recordFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            whiteFl.AddChidren(recordFL);
            recordFL.Y = btnDoorLockIcon.Bottom + Application.GetRealHeight(45);
            recordFL.X = rtvFL.Right + Application.GetRealHeight(CustomFrameLayout.interval);
            recordFL.AddImageView();
            recordFL.AddTextButtonView();
            recordFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/HistoryList.png";
            recordFL.GetTextButton().TextID = StringId.lishijilu;
            //一键开锁
            openFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(openFL);
            openFL.X = rtvFL.Right + Application.GetRealWidth(20);
            openFL.Y = Application.GetRealHeight(300);
            whiteFl.AddChidren(openFL);
            openFL.X = rtvFL.X;
            openFL.Y = rtvFL.Bottom+Application.GetRealHeight(14);
            openFL.AddImageView();
            openFL.AddTextButtonView();
            openFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/OneOpenLock.png";
            openFL.GetTextButton().TextID = StringId.yijiankaisuo;
            //临时密码
            pswFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(pswFL);
            pswFL.X = openFL.Right + Application.GetRealWidth(20);
            pswFL.Y = Application.GetRealHeight(300);
            whiteFl.AddChidren(pswFL);
            pswFL.X = recordFL.X;
            pswFL.Y = rtvFL.Bottom + Application.GetRealHeight(14);
            pswFL.AddImageView();
            pswFL.AddTextButtonView();
            pswFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/OneOpenLock.png";
            pswFL.GetTextButton().TextID = StringId.linshimima1;
            //历史记录
            recordFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(recordFL);
            recordFL.X = Application.GetRealWidth(20);
            recordFL.Y = Application.GetRealHeight(300 + 100);
            recordFL.AddImageView();
            recordFL.AddTextButtonView();
            recordFL.GetTextButton().TextID = StringId.lishijilu;
            #endregion
        }
        /// <summary>
        /// 注册事件
        /// </summary>
        private void Events()
        private void EventListener()
        {
            //返回
            this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
@@ -184,6 +260,8 @@
                    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.btnDeviceName.Text = btnDeviceName.Text;
@@ -223,11 +301,11 @@
    /// </summary>
    class CustomFrameLayout : FrameLayout
    {
        public const int widthFrameLayout = 100;
        public const int heightFrameLayout = 80;
        public const int yFrameLayout = 300;
        public const int xFrameLayout = 20;
        public const int interval = 20;//行中的列间隔值
        public const int widthFrameLayout = 74;
        public const int heightFrameLayout = 70;
        public const int yFrameLayout = 353;
        public const int xFrameLayout = 68;
        public const int interval = 47;//行中的列间隔值
        public CustomFrameLayout(int width, int height, int x = 0, int y = 0)
        {
@@ -239,26 +317,23 @@
        }
        Button btnStateImage = new Button
        {
            Width = Application.GetRealWidth(40),
            Height = Application.GetRealWidth(40),
            UnSelectedImagePath = "MusicIcon/collect.png",
            SelectedImagePath = "MusicIcon/collectSelected.png",
            Gravity = Gravity.CenterHorizontal,
            Width = Application.GetRealWidth(32),
            Height = Application.GetRealWidth(32),
            Gravity = Gravity.TopCenter,
            Name = "btnStateImage",
        };
        Button btnStateText = new Button
        {
            Y = Application.GetRealHeight(20),
            Y = Application.GetRealHeight(4),
            Width = Application.GetRealWidth(100),
            Height = Application.GetRealWidth(20),
            TextID = StringId.dangqianmenweiguan,
            TextSize = TextSize.Text14,
            TextColor = MusicColor.TextColor,
            TextSize = TextSize.Text12,
            TextColor = MusicColor.TextCancelColor,
            TextAlignment=TextAlignment.Center,
            Gravity = Gravity.CenterHorizontal,
            Name = "btnStateText"
        };
        public void AddImageView()
        {