From 081ea8d273048fd03756718ac6fb48a3c09218e9 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 29 十月 2019 13:10:00 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/Device/Category/Category.cs |   91 ++++++++++++++++++++++++++++++---------------
 1 files changed, 60 insertions(+), 31 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
old mode 100755
new mode 100644
index 9ed8a71..76ab7ed
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -543,7 +543,7 @@
         /// <param name="selectedBtn">閫変腑閭d釜鐣岄潰 0--鍔熻兘 1--鍦烘櫙 2--鑷姩鍖� </param>
         public void Show(int selectedBtn = 1)
         {
-            
+
             ZbGateway.StatusList.Add(this);
             RemoveAll();
 
@@ -585,7 +585,7 @@
             var midFL = new FrameLayout
             {
                 Y = topView.Bottom,
-                Height = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.TabbarHeight) - topView.Bottom,
+                Height = Application.GetRealHeight(1549),
                 BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
             };
             AddChidren(midFL);
@@ -596,18 +596,17 @@
                 BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
             };
             midFL.AddChidren(functionSceneAutoBG);
-            //鍔熻兘
-            functionBtn = new ButtonLineForm(CommonFormResouce.X_Left, 34, 150, 68);
-            functionSceneAutoBG.AddChidren(functionBtn);
-            functionBtn.Init();
-            functionBtn.SetTitle(R.MyInternationalizationString.Function);
 
             //鍦烘櫙
-            sceneBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 + 20, 34, 150, 68);
+            sceneBtn = new ButtonLineForm(CommonFormResouce.X_Left, 34, 150, 68);
             functionSceneAutoBG.AddChidren(sceneBtn);
             sceneBtn.Init();
             sceneBtn.SetTitle(R.MyInternationalizationString.Scence);
-
+            //鍔熻兘
+            functionBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 + 20, 34, 150, 68);
+            functionSceneAutoBG.AddChidren(functionBtn);
+            functionBtn.Init();
+            functionBtn.SetTitle(R.MyInternationalizationString.Function);
             //鑷姩鍖�
             automationBtn = new ButtonLineForm(CommonFormResouce.X_Left + 150 * 2 + 20, 34, 150, 68);
             automationBtn.Init();
@@ -895,11 +894,10 @@
                 deviceListScrolView = new VerticalScrolViewLayout
                 {
                     X = Application.GetRealWidth(CommonFormResouce.X_Left),
-                    Y = functionTypeScrowView.Bottom + Application.GetRealHeight(50),
+                    Y = Application.GetRealHeight(35+275),
                     Width = Application.GetRealWidth(1028),
-                    Height = functionSceneBodyView.Height - Application.GetRealHeight(279 + 50) - 1,
+                    Height = Application.GetRealHeight(938) - 1,
                     BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
-
                 };
                 functionSceneBodyView.AddChidren(deviceListScrolView);
                 tempFunctionTypeBtn = new FunctionButton();
@@ -987,18 +985,18 @@
 
                             var deviceTypeRowLayout = new RowLayout()
                             {
-                                Height = Application.GetRealHeight(127 + 35),
+                                Height = Application.GetRealHeight(129 + 35),
                                 LineColor = ZigbeeColor.Current.GXCBackgroundColor,
                                 Tag = deviceUI
                             };
                             deviceListScrolView.AddChidren(deviceTypeRowLayout);
 
-                            var deviceRow = new FunctionRow(0, 35);
+                            var deviceRow = new CategoryFunctionRow(0, 35);
                             deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
                             deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                             deviceRow.SetStatu(light.IsOnline == 1);
+                            deviceRow.SetZoneText(deviceUI.GetZone());
                             deviceTypeRowLayout.AddChidren(deviceRow);
-
 
                             deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
                             {
@@ -1007,6 +1005,7 @@
                                 zbGateway.ReportAction += UpdateDeviceControllStatu;
                                 AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
                                 (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
+                                deviceRow.IsSelected = (send2 as Button).IsSelected;
                                 if ((send2 as Button).IsSelected)
                                 {
                                     light.SwitchControl(1);
@@ -1028,6 +1027,15 @@
                                         DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
                                     }
                                 });
+                            };
+
+                            deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+                            {
+                                var lightControl = new Phone.Device.Light.LightControl();
+                                UserView.HomePage.Instance.AddChidren(lightControl);
+                                UserView.HomePage.Instance.PageIndex += 1;
+                                lightControl.action = RefreshBodyView;
+                                lightControl.Show(deviceUI, room);
                             };
 
                             var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1080,10 +1088,11 @@
                             };
                             deviceListScrolView.AddChidren(deviceTypeRowLayout);
 
-                            var deviceRow = new FunctionRow(0, 35);
+                            var deviceRow = new CategoryFunctionRow(0, 35);
                             deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
                             deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                             deviceRow.SetStatu(airSwitch.IsOnline == 1);
+                            deviceRow.SetZoneText(deviceUI.GetZone());
                             deviceTypeRowLayout.AddChidren(deviceRow);
 
                             deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
@@ -1093,8 +1102,8 @@
                                 zbGateway.ReportAction += UpdateDeviceControllStatu;
                                 AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
 
-                                (send2 as CommonForm.SelectedStatuButton).IsSelected = !(send2 as CommonForm.SelectedStatuButton).IsSelected;
-                                if ((send2 as CommonForm.SelectedStatuButton).IsSelected)
+                                (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
+                                if ((send2 as Button).IsSelected)
                                 {
                                     airSwitch.SwitchControl(1);
                                 }
@@ -1115,6 +1124,15 @@
                                         DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
                                     }
                                 });
+                            };
+
+                            deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+                            {
+                                var lightControl = new Phone.Device.Light.LightControl();
+                                UserView.HomePage.Instance.AddChidren(lightControl);
+                                UserView.HomePage.Instance.PageIndex += 1;
+                                lightControl.action = RefreshBodyView;
+                                lightControl.Show(deviceUI, room);
                             };
 
                             var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1163,16 +1181,17 @@
 
                             var deviceTypeRowLayout = new RowLayout()
                             {
-                                Height = Application.GetRealHeight(127 + 35),
+                                Height = Application.GetRealHeight(129 + 35),
                                 LineColor = ZigbeeColor.Current.GXCBackgroundColor,
                                 Tag = deviceUI
                             };
                             deviceListScrolView.AddChidren(deviceTypeRowLayout);
 
-                            var deviceRow = new FunctionRow(0, 35);
+                            var deviceRow = new CategoryFunctionRow(0, 35);
                             deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
                             deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
                             deviceRow.SetStatu(dimmableLight.IsOnline == 1);
+                            deviceRow.SetZoneText(deviceUI.GetZone());
                             deviceTypeRowLayout.AddChidren(deviceRow);
 
                             deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) =>
@@ -1182,8 +1201,8 @@
                                 zbGateway.ReportAction += UpdateDeviceControllStatu;
                                 AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice);
 
-                                (send2 as CommonForm.SelectedStatuButton).IsSelected = !(send2 as CommonForm.SelectedStatuButton).IsSelected;
-                                if ((send2 as CommonForm.SelectedStatuButton).IsSelected)
+                                (send2 as Button).IsSelected = !(send2 as Button).IsSelected;
+                                if ((send2 as Button).IsSelected)
                                 {
                                     dimmableLight.SwitchControl(1);
                                 }
@@ -1204,6 +1223,16 @@
                                         DeviceUI.ShowStatuTip(R.MyInternationalizationString.FAIL);
                                     }
                                 });
+                            };
+
+                            deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
+                            {
+                                var dimmableLightControl = new Phone.Device.Light.DimmableLightControl();
+                                UserView.HomePage.Instance.AddChidren(dimmableLightControl);
+                                UserView.HomePage.Instance.PageIndex += 1;
+                                UserView.HomePage.Instance.ScrollEnabled = false;
+                                dimmableLightControl.action = RefreshBodyView;
+                                dimmableLightControl.Show(deviceUI, room);
                             };
 
                             var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1434,7 +1463,7 @@
                     typeRowLayout.AddChidren(functionTypeIMG);
 
                     functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction;
-                   
+
 
                     if (deviceType == room.DeviceUIList[0].CommonDevice.Type)
                     {
@@ -1452,7 +1481,7 @@
             var roomFL = new HorizontalScrolViewLayout()
             {
                 X = Application.GetRealWidth(CommonFormResouce.X_Left),
-                Height = Application.GetRealHeight(167),
+                Height = Application.GetRealHeight(170),
                 Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonFormResouce.X_Left),
                 BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
             };
@@ -1462,7 +1491,7 @@
             functionSceneBodyView = new FrameLayout()
             {
                 Y = roomFL.Bottom,
-                Height = Application.GetRealHeight(1316),
+                Height = Application.GetRealHeight(973+279),
                 BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
             };
             functionSceneAutoBodyView.AddChidren(functionSceneBodyView);
@@ -1505,7 +1534,7 @@
                     {
                         RefreshFunction(room);
                     }
-                   
+
                 }
                 roomBtn.MouseUpEventHandler += (sender, e) =>
                 {
@@ -1526,7 +1555,7 @@
                     }
                 };
             }
-            
+
         }
 
         #endregion
@@ -1556,7 +1585,7 @@
             {
                 var sceneScrolView = new VerticalScrolViewLayout
                 {
-                    Y = Application.GetRealHeight(58)
+                    //Y = Application.GetRealHeight(58)
                 };
                 functionSceneBodyView.AddChidren(sceneScrolView);
                 foreach (var scene in sceneList)
@@ -1611,7 +1640,7 @@
                         Tag = scene
                     };
                     leftFL.AddChidren(collectionBtn);
-                    
+
                     var sceneNameBtn = new Button()
                     {
                         Width = Application.GetRealWidth(176),
@@ -1760,7 +1789,7 @@
                                 }
                             };
                         }
-                        
+
                     };
                     deleteBtn.MouseUpEventHandler += delEvent;
                     //缂栬緫鍦烘櫙
@@ -1825,7 +1854,7 @@
         {
 
             functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            
+
             var bjFrameLayout = new FrameLayout
             {
                 Width = Application.GetRealWidth(1080 - 58),

--
Gitblit v1.8.0