| | |
| | | }; |
| | | bodyFrameLayout.AddChidren(imgFL); |
| | | |
| | | var backGround1 = new ImageView() |
| | | { |
| | | Y = Application.GetRealHeight(46), |
| | | Width = Application.GetMinRealAverage(916), |
| | | Height = Application.GetMinRealAverage(487), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | ImagePath = "Room/Room_Rectangle.png" |
| | | }; |
| | | imgFL.AddChidren(backGround1); |
| | | |
| | | backGround = new ImageView() |
| | | { |
| | | Width = Application.GetMinRealAverage(930), |
| | | Height = Application.GetMinRealAverage(464), |
| | | Gravity = Gravity.Center, |
| | | Y = Application.GetRealHeight(46), |
| | | Width = Application.GetMinRealAverage(887), |
| | | Height = Application.GetMinRealAverage(444), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Radius = (uint)Application.GetMinRealAverage(CommonFormResouce.BigFormRadius), |
| | | ImagePath = "SceneIcon/3.jpg" |
| | | }; |
| | | imgFL.AddChidren(backGround); |
| | | backGround.SetViewShadow(true); |
| | | |
| | | var infoFL = new FrameLayout |
| | | { |
| | |
| | | //通过相机拍照裁剪 |
| | | CropImage.TakePicture((imagePath) => |
| | | {
|
| | | if (string.IsNullOrEmpty(imagePath)) |
| | | { |
| | | return; |
| | | } |
| | | if (isModify) |
| | | { |
| | | if (IconPathType != 0) |
| | |
| | | //从相册选择图片裁剪 |
| | | CropImage.SelectPicture((imagePath) => |
| | | {
|
| | | if (string.IsNullOrEmpty(imagePath)) |
| | | { |
| | | return; |
| | | } |
| | | if (isModify) |
| | | { |
| | | if (IconPathType != 0) |
| | |
| | | //区域 |
| | | EventHandler<MouseEventArgs> zoneHander = (sender, e) => |
| | | { |
| | | List<string> floorIds = new List<string> { }; |
| | | List<string> floorNames = new List<string> { }; |
| | | List<List<string>> roomNames = new List<List<string>> { }; |
| | | List<List<Common.Room>> rooms = new List<List<Common.Room>> { }; |
| | | List<Common.Room> rs = new List<Common.Room> { }; |
| | | List<string> rNames = new List<string> { }; |
| | | if (Config.Instance.Home.FloorDics.Count > 0) |
| | | var zone = new SelectZone(); |
| | | zone.Init(); |
| | | zone.ZoneAction += (selectRoom) => |
| | | { |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | if (Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key).Count > 0) |
| | | { |
| | | floorIds.Add(floor.Key); |
| | | floorNames.Add(floor.Value); |
| | | |
| | | roomNames.Add(Common.Room.CurrentRoom.GetRoomNamesByFloorId(floor.Key)); |
| | | rooms.Add(Common.Room.CurrentRoom.GetRoomsByFloorId(floor.Key)); |
| | | } |
| | | } |
| | | PickerView.ShowSecondary(floorNames, roomNames, (index1, index2) => |
| | | { |
| | | curRoom = rooms[index1][index2]; |
| | | zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}"); |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < Common.Room.Lists.Count; i++) |
| | | { |
| | | var r = Common.Room.Lists[i]; |
| | | if (r.IsLove) |
| | | { |
| | | continue; |
| | | } |
| | | rs.Add(r); |
| | | rNames.Add(r.Name); |
| | | } |
| | | PickerView.Show(rNames, (index1) => |
| | | { |
| | | curRoom = rs[index1]; |
| | | zoneRow.SetTitle(rs[index1].Name); |
| | | }, 0, Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | | curRoom = selectRoom; |
| | | zoneRow.SetTitle(selectRoom.GetZoneName()); |
| | | }; |
| | | }; |
| | | zoneRow.ClickBtn.MouseUpEventHandler += zoneHander; |
| | | |
| | |
| | | if (OldIconPathType != 0) |
| | | { |
| | | Shared.IO.FileUtils.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath)); |
| | | HdlAutoBackupLogic.DeleteFile(System.IO.Path.Combine(Config.Instance.FullPath, OldBackgroundImagePath)); |
| | | |
| | | HdlAutoBackupLogic.DeleteFile(OldBackgroundImagePath); |
| | | } |
| | | if (IconPathType == 1 || IconPathType == 2) |
| | | { |
| | | Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); |
| | | HdlAutoBackupLogic.AddOrEditorFile(System.IO.Path.Combine(Config.Instance.FullPath, fileName)); |
| | | HdlAutoBackupLogic.AddOrEditorFile(fileName); |
| | | modifySceneUI.IconPath = fileName; |
| | | } |
| | | else |
| | |
| | | if (IconPathType == 1 || IconPathType == 2) |
| | | { |
| | | Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Config.Instance.FullPath, fileName), backGround.ImageBytes); |
| | | HdlAutoBackupLogic.AddOrEditorFile(fileName); |
| | | imgPath = fileName; |
| | | } |
| | | else |
| | |
| | | } |
| | | } |
| | | |
| | | var result = await curRoom.AddScene(nameRow.NameText.Text, imgPath, memberDataList); |
| | | var result = await curRoom.AddScene(nameRow.NameText.Text, imgPath, memberDataList, IconPathType); |
| | | if (result == 1) |
| | | { |
| | | AddAction?.Invoke(); |
| | |
| | | dialog.RemoveFromParent(); |
| | | }; |
| | | |
| | | open.SeekBar.ProgressChanged += (sender, e) => |
| | | open.SeekBar.OnProgressChangedEvent += (sender, e) => |
| | | { |
| | | open.IsSelected = true; |
| | | shut.IsSelected = false; |
| | |
| | | { |
| | | open.IsSelected = true; |
| | | shut.IsSelected = false; |
| | | open.SetProgress(sceneTarget.TaskList[0].Data2); |
| | | open.SetSeekBarProgress(sceneTarget.TaskList[0].Data2); |
| | | } |
| | | } |
| | | |
| | |
| | | dialog.RemoveFromParent(); |
| | | }; |
| | | |
| | | open.SeekBar.ProgressChanged += (sender, e) => |
| | | open.SeekBar.OnProgressChangedEvent += (sender, e) => |
| | | { |
| | | open.IsSelected = true; |
| | | shut.IsSelected = false; |
| | |
| | | { |
| | | open.IsSelected = true; |
| | | shut.IsSelected = false; |
| | | open.SetProgress(sceneTarget.TaskList[0].Data1); |
| | | open.SetSeekBarProgress(sceneTarget.TaskList[0].Data1); |
| | | } |
| | | } |
| | | |