WJC
2020-03-23 bba578c2f0acf2eca747edcb69426771e0cadd32
ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -69,11 +69,29 @@
            //清空bodyFrame
            this.ClearBodyFrame();
            //加一个白色背景
            var frameBack1 = new FrameLayout();
            frameBack1.Height = Application.GetRealHeight(450);
            frameBack1.Y = Application.GetRealHeight(196);
            frameBack1.BackgroundColor = UserCenterColor.Current.White;
            frameBack1.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            bodyFrameLayout.AddChidren(frameBack1);
            //初始化信息桌布
            var tableContr = new InformationEditorControl();
            this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 613, 1175);
            //房间图片底部阴影
            var btnShadow = new PicViewControl(994, 588);
            btnShadow.Y = Application.GetRealHeight(58);
            btnShadow.Gravity = Gravity.CenterHorizontal;
            btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
            bodyFrameLayout.AddChidren(btnShadow);
            //房间图片
            var btnPic = new ImageView();
            btnPic.Y = Application.GetRealHeight(60);
            btnPic.Width = Application.GetMinRealAverage(887);
            btnPic.Height = Application.GetMinRealAverage(444);
            btnPic.Width = Application.GetMinRealAverage(965);
            btnPic.Height = Application.GetMinRealAverage(544);
            btnPic.Radius = (uint)Application.GetRealHeight(17);
            btnPic.Gravity = Gravity.CenterHorizontal;
            if (this.editorRoom.BackgroundImageType == 0)
@@ -85,20 +103,23 @@
                btnPic.ImageBytes = Common.Global.ReadFileByHomeId(this.editorRoom.BackgroundImage);
            }
            bodyFrameLayout.AddChidren(btnPic);
            var btnShadow = new PicViewControl(916, 487);
            btnShadow.Y = btnPic.Y;
            btnShadow.Gravity = Gravity.CenterHorizontal;
            btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
            bodyFrameLayout.AddChidren(btnShadow);
            btnShadow.ButtonClickEvent += (sender, e) =>
            //图片遮罩
            var btnZhezhao = new FrameLayout();
            btnZhezhao.Width = btnPic.Width;
            btnZhezhao.Height = btnPic.Height;
            btnZhezhao.Y = btnPic.Y;
            btnZhezhao.Gravity = Gravity.CenterHorizontal;
            btnZhezhao.Radius = btnPic.Radius;
            bodyFrameLayout.AddChidren(btnZhezhao);
            //分享的房间不能修改
            if (this.editorRoom.IsSharedRoom == false)
            {
                btnZhezhao.MouseUpEventHandler += (sender, e) =>
            {
                //房间图片选择
                this.RoomPictrueSelect(btnPic);
            };
            //初始化桌布
            var tableContr = new InformationEditorControl();
            this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 562, 1175);
            }
            //添加全部菜单
            this.AddAllMenuRow(tableContr, btnPic);
@@ -132,11 +153,15 @@
                btnBelone.AddRightArrow();
                //底线
                btnBelone.AddBottomLine();
                //分享的房间不能修改
                if (this.editorRoom.IsSharedRoom == false)
                {
                btnBelone.ButtonClickEvent += (sender, e) =>
                {
                    //楼层选择
                    this.ShowSelectFloor(btnBelone);
                };
                }
            }
            //【温度】
@@ -148,11 +173,15 @@
            var btnTemper = rowTemperature.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300);
            //底线
            rowTemperature.AddBottomLine();
            //分享的房间不能修改
            if (this.editorRoom.IsSharedRoom == false)
            {
            rowTemperature.ButtonClickEvent += (sender, e) =>
            {
                //显示温度传感器列表
                this.ShowTemperatrueDevice(btnTemper);
            };
            }
            if (string.IsNullOrEmpty(cloneRoom.TemperatrueDevice) == false)
            {
                //获取温度
@@ -168,11 +197,15 @@
            var btnHumi = rowHumidity.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300);
            //底线
            rowHumidity.AddBottomLine();
            //分享的房间不能修改
            if (this.editorRoom.IsSharedRoom == false)
            {
            rowHumidity.ButtonClickEvent += (sender, e) =>
            {
                //显示湿度传感器列表
                this.ShowHumidityDevice(btnHumi);
            };
            }
            if (string.IsNullOrEmpty(cloneRoom.HumidityDevice) == false)
            {
                //获取湿度
@@ -182,6 +215,13 @@
            //初始化桌布完成
            tableContr.FinishInitControl(bodyFrameLayout, this.listview);
            tableContr = null;
            //分享的房间不能修改
            if (this.editorRoom.IsSharedRoom == true)
            {
                return;
            }
            //保存
            var btnFinish = new BottomClickButton();
            btnFinish.TextID = R.MyInternationalizationString.uSave;
@@ -220,17 +260,34 @@
                    }
                }
                bool changedFloor = editorRoom.FloorId != cloneRoom.FloorId;
                editorRoom.FloorId = cloneRoom.FloorId;
                editorRoom.Name = cloneRoom.Name;
                editorRoom.HumidityDevice = cloneRoom.HumidityDevice;
                if (cloneRoom.Humidity != -1000)
                {
                editorRoom.Humidity = cloneRoom.Humidity;
                }
                editorRoom.TemperatrueDevice = cloneRoom.TemperatrueDevice;
                if (cloneRoom.Temperatrue != -1000)
                {
                editorRoom.Temperatrue = cloneRoom.Temperatrue;
                }
                editorRoom.BackgroundImage = cloneRoom.BackgroundImage;
                editorRoom.BackgroundImageType = cloneRoom.BackgroundImageType;
                editorRoom.Save();
                FinishEditorEvent?.Invoke(this.editorRoom.Name);
                if (changedFloor == false)
                {
                    //刷新左滑的房间列表界面的指定房间的信息
                    MainPage.ListRoomViewFrom.Instance.RefreshRoomInfo(this.editorRoom);
                }
                else
                {
                    //刷新左滑的房间列表界面的房间列表信息
                    MainPage.ListRoomViewFrom.Instance.RefreshListRoom();
                }
                this.CloseForm();
            };
        }
@@ -520,7 +577,7 @@
                    this.cloneRoom.BackgroundImageType = 1;
                    imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
                    System.IO.File.Delete(imagePath);
                }, "HdlPic", 2, 1);
                }, "HdlPic", 16, 9);
            });
            //我的相册
            menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.MyAblums), () =>
@@ -537,7 +594,7 @@
                    imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
                    System.IO.File.Delete(imagePath);
                }, "HdlPic", 2, 1);
                }, "HdlPic", 16, 9);
            });
        }