From bba578c2f0acf2eca747edcb69426771e0cadd32 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 23 三月 2020 18:20:50 +0800
Subject: [PATCH] 2020-03-23-3

---
 ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs |  119 ++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 88 insertions(+), 31 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
index 05ce2f0..a849299 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs
@@ -69,11 +69,29 @@
             //娓呯┖bodyFrame
             this.ClearBodyFrame();
 
+            //鍔犱竴涓櫧鑹茶儗鏅�
+            var frameBack1 = new FrameLayout();
+            frameBack1.Height = Application.GetRealHeight(450);
+            frameBack1.Y = Application.GetRealHeight(196);
+            frameBack1.BackgroundColor = UserCenterColor.Current.White;
+            frameBack1.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            bodyFrameLayout.AddChidren(frameBack1);
+
+            //鍒濆鍖栦俊鎭甯�
+            var tableContr = new InformationEditorControl();
+            this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 613, 1175);
+
+            //鎴块棿鍥剧墖搴曢儴闃村奖
+            var btnShadow = new PicViewControl(994, 588);
+            btnShadow.Y = Application.GetRealHeight(58);
+            btnShadow.Gravity = Gravity.CenterHorizontal;
+            btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
+            bodyFrameLayout.AddChidren(btnShadow);
             //鎴块棿鍥剧墖
             var btnPic = new ImageView();
             btnPic.Y = Application.GetRealHeight(60);
-            btnPic.Width = Application.GetMinRealAverage(887);
-            btnPic.Height = Application.GetMinRealAverage(444);
+            btnPic.Width = Application.GetMinRealAverage(965);
+            btnPic.Height = Application.GetMinRealAverage(544);
             btnPic.Radius = (uint)Application.GetRealHeight(17);
             btnPic.Gravity = Gravity.CenterHorizontal;
             if (this.editorRoom.BackgroundImageType == 0)
@@ -85,20 +103,23 @@
                 btnPic.ImageBytes = Common.Global.ReadFileByHomeId(this.editorRoom.BackgroundImage);
             }
             bodyFrameLayout.AddChidren(btnPic);
-            var btnShadow = new PicViewControl(916, 487);
-            btnShadow.Y = btnPic.Y;
-            btnShadow.Gravity = Gravity.CenterHorizontal;
-            btnShadow.UnSelectedImagePath = "Room/RoomShadow.png";
-            bodyFrameLayout.AddChidren(btnShadow);
-            btnShadow.ButtonClickEvent += (sender, e) =>
+            //鍥剧墖閬僵
+            var btnZhezhao = new FrameLayout();
+            btnZhezhao.Width = btnPic.Width;
+            btnZhezhao.Height = btnPic.Height;
+            btnZhezhao.Y = btnPic.Y;
+            btnZhezhao.Gravity = Gravity.CenterHorizontal;
+            btnZhezhao.Radius = btnPic.Radius;
+            bodyFrameLayout.AddChidren(btnZhezhao);
+            //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+            if (this.editorRoom.IsSharedRoom == false)
             {
-                //鎴块棿鍥剧墖閫夋嫨
-                this.RoomPictrueSelect(btnPic);
-            };
-
-            //鍒濆鍖栨甯�
-            var tableContr = new InformationEditorControl();
-            this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 562, 1175);
+                btnZhezhao.MouseUpEventHandler += (sender, e) =>
+                {
+                    //鎴块棿鍥剧墖閫夋嫨
+                    this.RoomPictrueSelect(btnPic);
+                };
+            }
 
             //娣诲姞鍏ㄩ儴鑿滃崟
             this.AddAllMenuRow(tableContr, btnPic);
@@ -132,11 +153,15 @@
                 btnBelone.AddRightArrow();
                 //搴曠嚎
                 btnBelone.AddBottomLine();
-                btnBelone.ButtonClickEvent += (sender, e) =>
+                //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+                if (this.editorRoom.IsSharedRoom == false)
                 {
-                    //妤煎眰閫夋嫨
-                    this.ShowSelectFloor(btnBelone);
-                };
+                    btnBelone.ButtonClickEvent += (sender, e) =>
+                    {
+                        //妤煎眰閫夋嫨
+                        this.ShowSelectFloor(btnBelone);
+                    };
+                }
             }
 
             //銆愭俯搴︺��
@@ -148,11 +173,15 @@
             var btnTemper = rowTemperature.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300);
             //搴曠嚎
             rowTemperature.AddBottomLine();
-            rowTemperature.ButtonClickEvent += (sender, e) =>
+            //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+            if (this.editorRoom.IsSharedRoom == false)
             {
-                //鏄剧ず娓╁害浼犳劅鍣ㄥ垪琛�
-                this.ShowTemperatrueDevice(btnTemper);
-            };
+                rowTemperature.ButtonClickEvent += (sender, e) =>
+                {
+                    //鏄剧ず娓╁害浼犳劅鍣ㄥ垪琛�
+                    this.ShowTemperatrueDevice(btnTemper);
+                };
+            }
             if (string.IsNullOrEmpty(cloneRoom.TemperatrueDevice) == false)
             {
                 //鑾峰彇娓╁害
@@ -168,11 +197,15 @@
             var btnHumi = rowHumidity.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNothing), 300);
             //搴曠嚎
             rowHumidity.AddBottomLine();
-            rowHumidity.ButtonClickEvent += (sender, e) =>
+            //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+            if (this.editorRoom.IsSharedRoom == false)
             {
-                //鏄剧ず婀垮害浼犳劅鍣ㄥ垪琛�
-                this.ShowHumidityDevice(btnHumi);
-            };
+                rowHumidity.ButtonClickEvent += (sender, e) =>
+                {
+                    //鏄剧ず婀垮害浼犳劅鍣ㄥ垪琛�
+                    this.ShowHumidityDevice(btnHumi);
+                };
+            }
             if (string.IsNullOrEmpty(cloneRoom.HumidityDevice) == false)
             {
                 //鑾峰彇婀垮害
@@ -182,6 +215,13 @@
             //鍒濆鍖栨甯冨畬鎴�
             tableContr.FinishInitControl(bodyFrameLayout, this.listview);
             tableContr = null;
+
+            //鍒嗕韩鐨勬埧闂翠笉鑳戒慨鏀�
+            if (this.editorRoom.IsSharedRoom == true)
+            {
+                return;
+            }
+
             //淇濆瓨
             var btnFinish = new BottomClickButton();
             btnFinish.TextID = R.MyInternationalizationString.uSave;
@@ -220,17 +260,34 @@
                     }
                 }
 
+                bool changedFloor = editorRoom.FloorId != cloneRoom.FloorId;
                 editorRoom.FloorId = cloneRoom.FloorId;
                 editorRoom.Name = cloneRoom.Name;
                 editorRoom.HumidityDevice = cloneRoom.HumidityDevice;
-                editorRoom.Humidity = cloneRoom.Humidity;
+                if (cloneRoom.Humidity != -1000)
+                {
+                    editorRoom.Humidity = cloneRoom.Humidity;
+                }
                 editorRoom.TemperatrueDevice = cloneRoom.TemperatrueDevice;
-                editorRoom.Temperatrue = cloneRoom.Temperatrue;
+                if (cloneRoom.Temperatrue != -1000)
+                {
+                    editorRoom.Temperatrue = cloneRoom.Temperatrue;
+                }
                 editorRoom.BackgroundImage = cloneRoom.BackgroundImage;
                 editorRoom.BackgroundImageType = cloneRoom.BackgroundImageType;
                 editorRoom.Save();
 
                 FinishEditorEvent?.Invoke(this.editorRoom.Name);
+                if (changedFloor == false)
+                {
+                    //鍒锋柊宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈢殑鎸囧畾鎴块棿鐨勪俊鎭�
+                    MainPage.ListRoomViewFrom.Instance.RefreshRoomInfo(this.editorRoom);
+                }
+                else
+                {
+                    //鍒锋柊宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈢殑鎴块棿鍒楄〃淇℃伅
+                    MainPage.ListRoomViewFrom.Instance.RefreshListRoom();
+                }
                 this.CloseForm();
             };
         }
@@ -520,7 +577,7 @@
                     this.cloneRoom.BackgroundImageType = 1;
                     imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
                     System.IO.File.Delete(imagePath);
-                }, "HdlPic", 2, 1);
+                }, "HdlPic", 16, 9);
             });
             //鎴戠殑鐩稿唽
             menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.MyAblums), () =>
@@ -537,7 +594,7 @@
                     imageContr.ImageBytes = Shared.IO.FileUtils.ReadFile(imagePath);
                     System.IO.File.Delete(imagePath);
 
-                }, "HdlPic", 2, 1);
+                }, "HdlPic", 16, 9);
             });
         }
 

--
Gitblit v1.8.0