From eb9cf55fc8568cb2d4b4bfac9deb617ce766a7a5 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 20 十二月 2019 14:58:37 +0800 Subject: [PATCH] 2019.12.30 --- ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs | 76 ++++++++++++++++++++++---------------- 1 files changed, 44 insertions(+), 32 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs index e4b3ceb..4e3beee 100644 --- a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs @@ -36,7 +36,7 @@ /// </summary> private string ImagePath="SceneIcon/1.png"; /// <summary> - /// 鍥剧墖鏉ユ簮 0--鏈湴鍥惧簱 1--鎷嶇収 2--绯荤粺鍥惧簱 + /// 鍥剧墖鏉ユ簮 0--鏈湴鍥惧簱 1--鎷嶇収 2--绯荤粺鍥惧簱 /// </summary> public int IconPathType = 0; /// <summary> @@ -59,7 +59,7 @@ /// <summary> /// backGround /// </summary> - private Button backGround; + private ImageView backGround; /// <summary> /// 鏄惁淇敼 @@ -159,7 +159,7 @@ targetRow.SetNameText(devNameText); targetRow.SetZoneText(targetDevice.SceneUI.GetZone()); } - + var editBtn = new Button() { BackgroundColor = ZigbeeColor.Current.GXCEditBackGroundColor, @@ -236,6 +236,7 @@ UserView.HomePage.Instance.PageIndex += 1; sceneView.sceneTargetDevice = targetDevice; sceneView.sceneUI = targetDevice.SceneUI; + sceneView.currentSceneUI = modifySceneUI; sceneView.Show(); sceneView.selectedAction = (selectedScene) => { @@ -250,8 +251,17 @@ }; } } + } - + if (sceneTargetDevicesList.Count > 2) + { + var targetRowLayout = new RowLayout() + { + Height = Application.GetRealHeight(300), + LineColor = ZigbeeColor.Current.GXCBackgroundColor, + BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor + }; + TargetListScrolView.AddChidren(targetRowLayout); } } } @@ -275,7 +285,7 @@ /// </summary> private void Init() { - + } /// <summary> @@ -320,13 +330,13 @@ }; 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); @@ -436,11 +446,11 @@ } 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}"); @@ -544,7 +554,7 @@ { IconPathType = 0; backGround.ImageBytes = null; - backGround.UnSelectedImagePath = imgPath; + backGround.ImagePath = imgPath; }; }; selectPhotographBtn.MouseUpEventHandler += (send, ee) => @@ -559,18 +569,18 @@ { 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(); @@ -583,13 +593,13 @@ { 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); @@ -631,7 +641,7 @@ { 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)); } @@ -651,7 +661,7 @@ { 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)); } @@ -662,15 +672,18 @@ 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; @@ -770,13 +783,14 @@ UserView.HomePage.Instance.AddChidren(sceneView); UserView.HomePage.Instance.PageIndex += 1; sceneView.beforeSceneTargetDeviceUIs = sceneTargetDevicesList; + sceneView.currentSceneUI = modifySceneUI; sceneView.Show(); sceneView.selectedAction = (selectedScene) => { sceneTargetDevicesList.Add(selectedScene); RefreshTargetListView(); }; - + }; //娣诲姞鏃堕棿闂撮殧 selectedTimerBtn.MouseUpEventHandler += (send, ee) => @@ -841,7 +855,7 @@ { 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()); @@ -871,7 +885,7 @@ } else { - modifySceneUI.IconPath = backGround.UnSelectedImagePath; + modifySceneUI.IconPath = backGround.ImagePath; } modifySceneUI.IconPathType = IconPathType; @@ -972,7 +986,6 @@ { if (modifyRoom != curRoom) { - modifyRoom.SceneUIList.Remove(modifySceneUI); modifyRoom.SceneUIFilePathList.Remove(modifySceneUI.FileName); curRoom.SceneUIList.Add(modifySceneUI); @@ -1027,7 +1040,7 @@ } else { - imgPath = backGround.UnSelectedImagePath; + imgPath = backGround.ImagePath; } if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null) { @@ -1109,7 +1122,6 @@ } } - }; #endregion } -- Gitblit v1.8.0