WJC
2020-03-23 bba578c2f0acf2eca747edcb69426771e0cadd32
ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs
@@ -54,21 +54,42 @@
            //清空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;
            btnPic.ImagePath = "RoomIcon/0.JPG";
            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.MouseUpEventHandler += (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);
            btnZhezhao.MouseUpEventHandler += (sender, e) =>
            {
                //房间图片选择
                this.RoomPictrueSelect(btnPic);
@@ -79,10 +100,6 @@
            newRoom.BackgroundImage = btnPic.ImagePath;
            newRoom.Humidity = -1000;
            newRoom.Temperatrue = -1000;
            //初始化桌布
            var tableContr = new InformationEditorControl();
            this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 562, 1175);
            //添加全部菜单
            this.AddAllMenuRow(tableContr, btnPic);
@@ -180,6 +197,14 @@
                }
                newRoom.FloorId = this.floorKeys;
                if (newRoom.Humidity == -1000)
                {
                    newRoom.Humidity = 0;
                }
                if (newRoom.Temperatrue == -1000)
                {
                    newRoom.Temperatrue = 0;
                }
                HdlRoomLogic.Current.AddRoom(newRoom);
                this.FinishEditorEvent?.Invoke();