From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs |  102 ++++++++++++++++++++++++--------------------------
 1 files changed, 49 insertions(+), 53 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
index 27e8df6..9b7b4dc 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
@@ -21,14 +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(Method.H - 260 - 200 - 184),
+            Height = Application.GetRealHeight(Method.H - 260 - 204 - 184),
             BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
         };
 
@@ -82,7 +82,7 @@
             {
                 if (clickTag == "no" || tempScene == null)
                 {
-                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+                    var alert = new UserCenter.ShowMsgControl(ShowMsgType.Normal,
                           Language.StringByID(MyInternationalizationString.scenetip),
                           Language.StringByID(MyInternationalizationString.confrim));
                     alert.Show();
@@ -126,7 +126,7 @@
                 {
 
                     Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(780),
+                    Height = Application.GetRealWidth(780),
                     X = Application.GetRealWidth(1080 - 468 - 35),
                     Y = Application.GetRealHeight(184),
                     BackgroundImagePath = "Item/SelectFloor_Right.png",
@@ -166,8 +166,8 @@
 
                     var btnfoolricon = new Button
                     {
-                        Width = Application.GetMinRealAverage(81),
-                        Height = Application.GetMinRealAverage(81),
+                        Width = Application.GetRealWidth(81),
+                        Height = Application.GetRealWidth(81),
                         UnSelectedImagePath = "Floor/Floor.png",
                         Gravity = Gravity.CenterVertical,
                     };
@@ -228,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) =>
                 {
@@ -279,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;
 
             }
         }
@@ -303,9 +299,9 @@
             foreach (var sceneId in scenelist)
             {
                 var scene = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
-                if (scene == null)
-                {
-                    continue;
+                if (scene == null)
+                {
+                    continue;
                 }
                 var sceneFramelayout = new FrameLayout
                 {
@@ -316,8 +312,8 @@
 
                 var sceneIconBtn = new Button
                 {
-                    Width = Application.GetMinRealAverage(81),
-                    Height = Application.GetMinRealAverage(81),
+                    Width = Application.GetRealWidth(81),
+                    Height = Application.GetRealWidth(81),
                     X = Application.GetRealWidth(58),
                     Y = Application.GetRealHeight(55),
                     UnSelectedImagePath = "ZigeeLogic/scene.png",
@@ -347,8 +343,8 @@
 
                 var selectedBtn = new Button
                 {
-                    Width = Application.GetMinRealAverage(60),
-                    Height = Application.GetMinRealAverage(60),
+                    Width = Application.GetRealWidth(60),
+                    Height = Application.GetRealWidth(60),
                     X = Application.GetRealWidth(789),
                     UnSelectedImagePath = "ZigeeLogic/selected.png",
                     Visible = false,

--
Gitblit v1.8.0