| | |
| | | //清空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)
|
| | |
| | | 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)
|
| | | {
|
| | | //房间图片选择
|
| | | this.RoomPictrueSelect(btnPic);
|
| | | };
|
| | |
|
| | | //初始化桌布
|
| | | var tableContr = new InformationEditorControl();
|
| | | this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 562, 1175);
|
| | | btnZhezhao.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | //房间图片选择
|
| | | this.RoomPictrueSelect(btnPic);
|
| | | };
|
| | | }
|
| | |
|
| | | //添加全部菜单
|
| | | this.AddAllMenuRow(tableContr, btnPic);
|
| | |
| | | btnBelone.AddRightArrow();
|
| | | //底线
|
| | | btnBelone.AddBottomLine();
|
| | | btnBelone.ButtonClickEvent += (sender, e) =>
|
| | | //分享的房间不能修改
|
| | | if (this.editorRoom.IsSharedRoom == false)
|
| | | {
|
| | | //楼层选择
|
| | | this.ShowSelectFloor(btnBelone);
|
| | | };
|
| | | btnBelone.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //楼层选择
|
| | | this.ShowSelectFloor(btnBelone);
|
| | | };
|
| | | }
|
| | | }
|
| | |
|
| | | //【温度】
|
| | |
| | | var btnTemper = rowTemperature.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300);
|
| | | //底线
|
| | | rowTemperature.AddBottomLine();
|
| | | rowTemperature.ButtonClickEvent += (sender, e) =>
|
| | | //分享的房间不能修改
|
| | | if (this.editorRoom.IsSharedRoom == false)
|
| | | {
|
| | | //显示温度传感器列表
|
| | | this.ShowTemperatrueDevice(btnTemper);
|
| | | };
|
| | | rowTemperature.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //显示温度传感器列表
|
| | | this.ShowTemperatrueDevice(btnTemper);
|
| | | };
|
| | | }
|
| | | if (string.IsNullOrEmpty(cloneRoom.TemperatrueDevice) == false)
|
| | | {
|
| | | //获取温度
|
| | |
| | | var btnHumi = rowHumidity.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300);
|
| | | //底线
|
| | | rowHumidity.AddBottomLine();
|
| | | rowHumidity.ButtonClickEvent += (sender, e) =>
|
| | | //分享的房间不能修改
|
| | | if (this.editorRoom.IsSharedRoom == false)
|
| | | {
|
| | | //显示湿度传感器列表
|
| | | this.ShowHumidityDevice(btnHumi);
|
| | | };
|
| | | rowHumidity.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //显示湿度传感器列表
|
| | | this.ShowHumidityDevice(btnHumi);
|
| | | };
|
| | | }
|
| | | if (string.IsNullOrEmpty(cloneRoom.HumidityDevice) == false)
|
| | | {
|
| | | //获取湿度
|
| | |
| | | //初始化桌布完成
|
| | | tableContr.FinishInitControl(bodyFrameLayout, this.listview);
|
| | | tableContr = null;
|
| | |
|
| | | //分享的房间不能修改
|
| | | if (this.editorRoom.IsSharedRoom == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //保存
|
| | | var btnFinish = new BottomClickButton();
|
| | | btnFinish.TextID = R.MyInternationalizationString.uSave;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | bool changedFloor = editorRoom.FloorId != cloneRoom.FloorId;
|
| | | editorRoom.FloorId = cloneRoom.FloorId;
|
| | | editorRoom.Name = cloneRoom.Name;
|
| | | editorRoom.HumidityDevice = cloneRoom.HumidityDevice;
|
| | | editorRoom.Humidity = cloneRoom.Humidity;
|
| | | if (cloneRoom.Humidity != -1000)
|
| | | {
|
| | | editorRoom.Humidity = cloneRoom.Humidity;
|
| | | }
|
| | | editorRoom.TemperatrueDevice = cloneRoom.TemperatrueDevice;
|
| | | editorRoom.Temperatrue = cloneRoom.Temperatrue;
|
| | | 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();
|
| | | };
|
| | | }
|
| | |
| | | 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), () =>
|
| | |
| | | imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
|
| | | System.IO.File.Delete(imagePath);
|
| | |
|
| | | }, "HdlPic", 2, 1);
|
| | | }, "HdlPic", 16, 9);
|
| | | });
|
| | | }
|
| | |
|