| | |
| | | /// </summary> |
| | | private string ImagePath="SceneIcon/1.png"; |
| | | /// <summary> |
| | | /// 图片来源 0--本地图库 1--拍照 2--系统图库 |
| | | /// 图片来源 0--本地图库 1--拍照 2--系统图库 |
| | | /// </summary> |
| | | public int IconPathType = 0; |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// backGround |
| | | /// </summary> |
| | | private Button backGround; |
| | | private ImageView backGround; |
| | | |
| | | /// <summary> |
| | | /// 是否修改 |
| | |
| | | targetRow.SetNameText(devNameText); |
| | | targetRow.SetZoneText(targetDevice.SceneUI.GetZone()); |
| | | } |
| | | |
| | | |
| | | var editBtn = new Button() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor, |
| | |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | if (sceneTargetDevicesList.Count > 2) |
| | | { |
| | | var targetRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(300), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | TargetListScrolView.AddChidren(targetRowLayout); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | private void Init() |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | }; |
| | | bodyFrameLayout.AddChidren(imgFL); |
| | | |
| | | backGround = new Button() |
| | | backGround = new ImageView() |
| | | { |
| | | Width = Application.GetMinRealAverage(930), |
| | | Height = Application.GetMinRealAverage(464), |
| | | Gravity = Gravity.Center, |
| | | Radius = (uint)Application.GetMinRealAverage(CommonFormResouce.BigFormRadius), |
| | | UnSelectedImagePath = "SceneIcon/3.jpg" |
| | | ImagePath = "SceneIcon/3.jpg" |
| | | }; |
| | | imgFL.AddChidren(backGround); |
| | | backGround.SetViewShadow(true); |
| | |
| | | } |
| | | if (modifySceneUI.IconPathType==0) |
| | | { |
| | | backGround.UnSelectedImagePath = modifySceneUI.IconPath; |
| | | backGround.ImagePath = modifySceneUI.IconPath; |
| | | } |
| | | else |
| | | { |
| | | backGround.UnSelectedImagePath = System.IO.Path.Combine(Config.Instance.FullPath, modifySceneUI.IconPath); |
| | | backGround.ImagePath = System.IO.Path.Combine(Config.Instance.FullPath, modifySceneUI.IconPath); |
| | | } |
| | | nameRow.SetTitle(modifySceneUI.Name); |
| | | zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(modifyRoom.FloorId)},{modifyRoom.Name}"); |
| | |
| | | { |
| | | IconPathType = 0; |
| | | backGround.ImageBytes = null; |
| | | backGround.UnSelectedImagePath = imgPath; |
| | | backGround.ImagePath = imgPath; |
| | | }; |
| | | }; |
| | | selectPhotographBtn.MouseUpEventHandler += (send, ee) => |
| | |
| | | { |
| | | if (IconPathType != 0) |
| | | { |
| | | Global.DeleteFilebyHomeId(backGround.UnSelectedImagePath); |
| | | Global.DeleteFilebyHomeId(backGround.ImagePath); |
| | | } |
| | | } |
| | | |
| | | IconPathType = 1; |
| | | backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath); |
| | | backGround.UnSelectedImagePath = imagePath; |
| | | backGround.ImagePath = imagePath; |
| | | System.IO.File.Delete(imagePath); |
| | | |
| | | |
| | | }, fileName, 2, 1); |
| | | }; |
| | | |
| | | |
| | | selectAblumsBtn.MouseUpEventHandler += (send, ee) => |
| | | { |
| | | selectFL.RemoveFromParent(); |
| | |
| | | { |
| | | if (IconPathType != 0) |
| | | { |
| | | Global.DeleteFilebyHomeId(backGround.UnSelectedImagePath); |
| | | Global.DeleteFilebyHomeId(backGround.ImagePath); |
| | | } |
| | | } |
| | | |
| | | IconPathType = 2; |
| | | backGround.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath); |
| | | backGround.UnSelectedImagePath = imagePath; |
| | | backGround.ImagePath = imagePath; |
| | | System.IO.File.Delete(imagePath); |
| | | |
| | | }, fileName, 2,1); |
| | |
| | | { |
| | | curRoom = rooms[index1][index2]; |
| | | zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}"); |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor), |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | |
| | | { |
| | | curRoom = rs[index1]; |
| | | zoneRow.SetTitle(rs[index1].Name); |
| | | }, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor), |
| | | }, 0, Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | |
| | | EventHandler<MouseEventArgs> targetAddHander = (sender, e) => |
| | | { |
| | | |
| | | if (curRoom == null) |
| | | //if (curRoom == null) |
| | | //{ |
| | | // RoomCommon.ShowTipNoRoom(); |
| | | // return; |
| | | //} |
| | | if(curRoom != null) |
| | | { |
| | | RoomCommon.ShowTipNoRoom(); |
| | | return; |
| | | } |
| | | if (curRoom.IsSharedRoom) |
| | | { |
| | | RoomCommon.ShowTipRoomIsShared(); |
| | | return; |
| | | if (curRoom.IsSharedRoom) |
| | | { |
| | | RoomCommon.ShowTipRoomIsShared(); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | int selectRow_Height = 150; |
| | |
| | | sceneTargetDevicesList.Add(selectedScene); |
| | | RefreshTargetListView(); |
| | | }; |
| | | |
| | | |
| | | }; |
| | | //添加时间间隔 |
| | | selectedTimerBtn.MouseUpEventHandler += (send, ee) => |
| | |
| | | { |
| | | if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) |
| | | { |
| | | Common.CommonPage.Instance.ShowErrorInfoAlert(R.MyInternationalizationString.TheSceneHadExist); |
| | | CommonFormResouce.ShowTip(Language.StringByID(R.MyInternationalizationString.TheSceneHadExist)); |
| | | return; |
| | | } |
| | | var r = await ZigBee.Device.Scene.RenameSceneAsync(modifySceneUI.Id, nameRow.NameText.Text.Trim()); |
| | |
| | | } |
| | | else |
| | | { |
| | | modifySceneUI.IconPath = backGround.UnSelectedImagePath; |
| | | modifySceneUI.IconPath = backGround.ImagePath; |
| | | } |
| | | modifySceneUI.IconPathType = IconPathType; |
| | | |
| | |
| | | { |
| | | if (modifyRoom != curRoom) |
| | | { |
| | | |
| | | modifyRoom.SceneUIList.Remove(modifySceneUI); |
| | | modifyRoom.SceneUIFilePathList.Remove(modifySceneUI.FileName); |
| | | curRoom.SceneUIList.Add(modifySceneUI); |
| | |
| | | } |
| | | else |
| | | { |
| | | imgPath = backGround.UnSelectedImagePath; |
| | | imgPath = backGround.ImagePath; |
| | | } |
| | | if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | }; |
| | | #endregion |
| | | } |