From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs |  143 +++++++++++++++++++++--------------------------
 1 files changed, 64 insertions(+), 79 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
index 213e42d..ee0245f 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
@@ -21,18 +21,14 @@
         public HorizontalScrolViewLayout roomhorizontalScrol = new HorizontalScrolViewLayout
         {
             Width = Application.GetRealWidth(1080 - 58),
-            Height = Application.GetRealHeight(200),
+            Height = Application.GetRealHeight(204),
             Y = Application.GetRealHeight(184),
             X = Application.GetRealWidth(58),
         };
         public VerticalScrolViewLayout middle = new VerticalScrolViewLayout
         {
             Width = Application.GetRealWidth(1080),
-            Height = Application.GetRealHeight(1920 - 260 - 200 - 184),
-            BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-        };
-        public FrameLayout saveframeLayout = new FrameLayout {
-            Height = Application.GetRealHeight(260),
+            Height = Application.GetRealHeight(Method.H - 260 - 204 - 184),
             BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
         };
 
@@ -70,7 +66,7 @@
             #endregion
 
             ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
-            var listAllRoom = UserCenter.HdlRoomLogic.Current.GetAllListRooms();
+            var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
             if (listAllRoom.Count == 0)
             {
                 return;
@@ -79,27 +75,14 @@
             this.AddChidren(roomhorizontalScrol);
             middle.Y = roomhorizontalScrol.Bottom;
             this.AddChidren(middle);
-            saveframeLayout.Y = middle.Bottom;
-            this.AddChidren(saveframeLayout);
-
-            var btnsave = new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize = 16,
-            };
-            saveframeLayout.AddChidren(btnsave);
-
-            btnsave.MouseUpEventHandler += (sender2, e2) =>
+            LogicView.SaveView saveView = new LogicView.SaveView();
+            saveView.frameLayout.Y = middle.Bottom;
+            this.AddChidren(saveView.Show());
+            saveView.clickviewBtn.MouseUpEventHandler += (sender2, e2) =>
             {
                 if (clickTag == "no" || tempScene == null)
                 {
-                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+                    var alert = new ShowMsgControl(ShowMsgType.Normal,
                           Language.StringByID(MyInternationalizationString.scenetip),
                           Language.StringByID(MyInternationalizationString.confrim));
                     alert.Show();
@@ -183,8 +166,8 @@
 
                     var btnfoolricon = new Button
                     {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
+                        Width = Application.GetMinRealAverage(81),
+                        Height = Application.GetMinRealAverage(81),
                         UnSelectedImagePath = "Floor/Floor.png",
                         Gravity = Gravity.CenterVertical,
                     };
@@ -245,49 +228,31 @@
             for (int i = 0; i < RoomList.Count; i++)
             {
                 var room = RoomList[i];
-                var fra = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(200),
-                    Width = Application.GetRealWidth(255),
-                };
-                roomhorizontalScrol.AddChidren(fra);
 
-                var roombjBtn = new Button
-                {
-                    Height = Application.GetRealHeight(158),
-                    Width = Application.GetRealWidth(255),
-                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
-                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
-                    Y = Application.GetRealHeight(21),
-                };
-                fra.AddChidren(roombjBtn);
-
-                var roomnameBtn = new Button
-                {
-
-                    Height = Application.GetRealHeight(152 - 26 - 20),
-                    Width = Application.GetRealWidth(255 - 20 - 50),
-                    Text = room.Name,
-                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    Y = Application.GetRealHeight(21 + 13 + 10),
-                    X = Application.GetRealWidth(10 + 25),
-
-                };
-                fra.AddChidren(roomnameBtn);
+                LogicView.RoomClickView roomClickView = new LogicView.RoomClickView();
+                roomClickView.Show(roomhorizontalScrol);
+                roomClickView.roomnameBtn.Text =room.Name;
 
                 if (i == 0)
                 {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
 
+                    roombjButton.IsSelected = false;
+                    roomClickView.roombjBtn.Height = Application.GetRealHeight(135);
+                    roomClickView.roombjBtn.Width = Application.GetRealWidth(245);
+                    roomClickView.roombjBtn.Y = Application.GetRealHeight(40);
+                    roomClickView.roombjBtn.X = Application.GetRealWidth(0);
+                    roombjButton = roomClickView.roombjBtn;
+                    roomClickView.roombjBtn.IsSelected = true;
                     roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
+                    roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2);
+                    roomClickView.roomnameBtn.X = Application.GetRealWidth(60);
+                    roomTextButton = roomClickView.roomnameBtn;
+                    roomClickView.roomnameBtn.IsSelected = true;
+
                     SceneView(room.ListSceneId);
 
                 }
+
 
                 EventHandler<MouseEventArgs> roomclick = (sender, e) =>
                 {
@@ -296,17 +261,31 @@
                     clickbutton = null;
                     clickbutton = new Button();
 
+                    roombjButton.Height = Application.GetRealHeight(72);
+                    roombjButton.Width = Application.GetRealWidth(170);
+                    roombjButton.Y = Application.GetRealHeight(60);
+                    roombjButton.X = Application.GetRealWidth(26);
                     roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
 
+                    roomClickView.roombjBtn.Height = Application.GetRealHeight(135);
+                    roomClickView.roombjBtn.Width = Application.GetRealWidth(245);
+                    roomClickView.roombjBtn.Y = Application.GetRealHeight(40);
+                    roomClickView.roombjBtn.X = Application.GetRealWidth(0);
+                    roombjButton = roomClickView.roombjBtn;
+                    roomClickView.roombjBtn.IsSelected = true;
+
+                    roomTextButton.Width = Application.GetRealWidth(125);
+                    roomTextButton.X = Application.GetRealWidth(26 + 22);
                     roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
+                    roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2);
+                    roomClickView.roomnameBtn.X = Application.GetRealWidth(60);
+                    roomTextButton = roomClickView.roomnameBtn;
+                    roomClickView.roomnameBtn.IsSelected = true;
+
                     SceneView(room.ListSceneId);
                 };
-                roomnameBtn.MouseUpEventHandler += roomclick;
-                roombjBtn.MouseUpEventHandler += roomclick;
+                roomClickView.roomnameBtn.MouseUpEventHandler += roomclick;
+                roomClickView.roombjBtn.MouseUpEventHandler += roomclick;
 
             }
         }
@@ -319,10 +298,10 @@
             middle.RemoveAll();
             foreach (var sceneId in scenelist)
             {
-                var scene = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
-                if (scene == null)
-                {
-                    continue;
+                var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
+                if (scene == null)
+                {
+                    continue;
                 }
                 var sceneFramelayout = new FrameLayout
                 {
@@ -331,11 +310,10 @@
                 };
                 middle.AddChidren(sceneFramelayout);
 
-
                 var sceneIconBtn = new Button
                 {
-                    Width = Application.GetRealWidth(81),
-                    Height = Application.GetRealHeight(81),
+                    Width = Application.GetMinRealAverage(81),
+                    Height = Application.GetMinRealAverage(81),
                     X = Application.GetRealWidth(58),
                     Y = Application.GetRealHeight(55),
                     UnSelectedImagePath = "ZigeeLogic/scene.png",
@@ -349,8 +327,7 @@
                     Width = Application.GetRealWidth(850),
                     Height = Application.GetRealHeight(130),
                     X = Application.GetRealWidth(176 + 10),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
+                    LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                 };
                 sceneFramelayout.AddChidren(sceneRow);
 
@@ -366,15 +343,23 @@
 
                 var selectedBtn = new Button
                 {
-                    Width = Application.GetRealWidth(58),
-                    Height = Application.GetRealHeight(58),
+                    Width = Application.GetMinRealAverage(60),
+                    Height = Application.GetMinRealAverage(60),
                     X = Application.GetRealWidth(789),
                     UnSelectedImagePath = "ZigeeLogic/selected.png",
                     Visible = false,
                     Gravity = Gravity.CenterVertical,
                 };
                 sceneRow.AddChidren(selectedBtn);
-
+                var lineBtn = new Button
+                {
+                    Y = sceneFramelayout.Height - 1,
+                    Width = Application.GetRealWidth(850),
+                    Height = 1,
+                    X = Application.GetRealWidth(176 + 10),
+                    BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+                };
+                sceneFramelayout.AddChidren(lineBtn);
                 EventHandler<MouseEventArgs> sceneclick = (sender, e) =>
                 {
                     tempScene = scene;

--
Gitblit v1.8.0