From 00ab3ddb140ba8bb88b5cf572b004a85e1da85e9 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 02 一月 2020 19:51:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
index 4b8facc..316aa1c 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
@@ -4,6 +4,7 @@
 using Shared.Common;
 using Shared.Phone.Device.CommonForm;
 using Shared.Phone.Device.Room;
+using Shared.Phone.UserCenter;
 using static ZigBee.Device.Scene;
 
 namespace Shared.Phone.Device.Category
@@ -90,9 +91,11 @@
         /// <summary>
         /// selectedTimeAction
         /// </summary>
-        public Action<SceneTargetDeviceUI> selectedAction;
-
-
+        private Action<SceneTargetDeviceUI> selectedAction;
+        /// <summary>
+        /// 淇敼鍦烘櫙action
+        /// </summary>
+        public Action<SceneUI, Common.Room> EditorAction;
 
         #endregion
 
@@ -108,7 +111,6 @@
         /// </summary>
         public override void RemoveFromParent()
         {
-            Category.instance?.RefreshBodyView();
             base.RemoveFromParent();
         }
         /// <summary>
@@ -255,7 +257,7 @@
                     }
                 }
 
-                if (sceneTargetDevicesList.Count > 2)
+                if (sceneTargetDevicesList.Count > 1)
                 {
                     var targetRowLayout = new RowLayout()
                     {
@@ -438,6 +440,7 @@
             targetFL.AddChidren(TargetListScrolView);
 
             confirmBtn = new CommonForm.CompleteButton(1656, 907, 127);
+            confirmBtn.TextID = R.MyInternationalizationString.Next;
             AddChidren(confirmBtn);
 
             if (isModify)
@@ -576,15 +579,16 @@
                 {
                     selectFL.RemoveFromParent();
                     var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
-                    var fileName = $"SceneIcon_{tradeTime}";
+                    var fileName = $"SceneIcon_{tradeTime}.png";
                     //閫氳繃鐩告満鎷嶇収瑁佸壀
                     CropImage.TakePicture((imagePath) =>
-                    {
+                    {
                         if (isModify)
                         {
                             if (IconPathType != 0)
                             {
                                 Global.DeleteFilebyHomeId(backGround.ImagePath);
+                                HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
                             }
                         }
 
@@ -600,15 +604,16 @@
                 {
                     selectFL.RemoveFromParent();
                     var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
-                    var fileName = $"SceneIcon_{tradeTime}";
+                    var fileName = $"SceneIcon_{tradeTime}.png";
                     //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
                     CropImage.SelectPicture((imagePath) =>
-                    {
+                    {
                         if (isModify)
                         {
                             if (IconPathType != 0)
                             {
                                 Global.DeleteFilebyHomeId(backGround.ImagePath);
+                                HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
                             }
                         }
 
@@ -870,7 +875,7 @@
                         try
                         {
                             var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
-                            var fileName = $"SceneIcon_{tradeTime}";
+                            var fileName = $"SceneIcon_{tradeTime}.png";
                             if (modifySceneUI.Name != nameRow.NameText.Text.Trim())
                             {
                                 if (Common.Room.CurrentRoom.GetSameFloorScenes(curRoom.FloorId).Find(s => s.Name == nameRow.NameText.Text.Trim()) != null)
@@ -897,10 +902,13 @@
                             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));
+
                             }
                             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));
                                 modifySceneUI.IconPath = fileName;
                             }
                             else
@@ -1138,7 +1146,6 @@
                         {
                             CommonPage.Loading.Hide();
                         }
-
                     }
                 }
 
@@ -1240,7 +1247,7 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
@@ -1396,7 +1403,7 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
@@ -1561,7 +1568,7 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
@@ -1734,7 +1741,7 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,

--
Gitblit v1.8.0