From b186c02eb9e44268727b769be477d1956e97fbb0 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 02 一月 2020 09:08:05 +0800
Subject: [PATCH] 2019.1.2

---
 ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
index 4b8facc..ee83130 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
@@ -254,8 +255,8 @@
                         }
                     }
                 }
-
-                if (sceneTargetDevicesList.Count > 2)
+                
+                if (sceneTargetDevicesList.Count > 1)
                 {
                     var targetRowLayout = new RowLayout()
                     {
@@ -438,6 +439,7 @@
             targetFL.AddChidren(TargetListScrolView);
 
             confirmBtn = new CommonForm.CompleteButton(1656, 907, 127);
+            confirmBtn.TextID = R.MyInternationalizationString.Next;
             AddChidren(confirmBtn);
 
             if (isModify)
@@ -576,7 +578,7 @@
                 {
                     selectFL.RemoveFromParent();
                     var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
-                    var fileName = $"SceneIcon_{tradeTime}";
+                    var fileName = $"SceneIcon_{tradeTime}.png";
                     //閫氳繃鐩告満鎷嶇収瑁佸壀
                     CropImage.TakePicture((imagePath) =>
                     {
@@ -585,6 +587,7 @@
                             if (IconPathType != 0)
                             {
                                 Global.DeleteFilebyHomeId(backGround.ImagePath);
+                                HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
                             }
                         }
 
@@ -600,7 +603,7 @@
                 {
                     selectFL.RemoveFromParent();
                     var tradeTime = DateTime.Now.ToString("yyyyMMddHHmmss", DateTimeFormatInfo.InvariantInfo);
-                    var fileName = $"SceneIcon_{tradeTime}";
+                    var fileName = $"SceneIcon_{tradeTime}.png";
                     //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
                     CropImage.SelectPicture((imagePath) =>
                     {
@@ -609,6 +612,7 @@
                             if (IconPathType != 0)
                             {
                                 Global.DeleteFilebyHomeId(backGround.ImagePath);
+                                HdlAutoBackupLogic.DeleteFile(backGround.ImagePath);
                             }
                         }
 
@@ -870,7 +874,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 +901,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
@@ -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