From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 28 二月 2020 15:25:13 +0800
Subject: [PATCH] 2020.2.28

---
 ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs |   84 ++++++++++++++++++++---------------------
 1 files changed, 41 insertions(+), 43 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
index 19d08f7..77d71a7 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
@@ -31,6 +31,10 @@
         /// </summary>
         private Button floorBtn;
         /// <summary>
+        /// 褰撳墠妤煎眰id
+        /// </summary>
+        private string curFloorId;
+        /// <summary>
         /// 閫夋嫨妤煎眰
         /// </summary>
         private Button selectFloorBtn;
@@ -148,11 +152,13 @@
             typeIdDic.Clear();
             foreach (var device in devList)
             {
-                var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device.CommonDevice });
+                var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice);
                 if (info.BeloneType == DeviceBeloneType.A寮�鍏� || info.BeloneType == DeviceBeloneType.A褰╃伅
                     || info.BeloneType == DeviceBeloneType.A鎻掑骇 || info.BeloneType == DeviceBeloneType.A鏅鸿兘绌哄紑
                     || info.BeloneType == DeviceBeloneType.A鐏厜 || info.BeloneType == DeviceBeloneType.A绌鸿皟
-                    || info.BeloneType == DeviceBeloneType.A绐楀笜 || info.BeloneType == DeviceBeloneType.A缁х數鍣�)
+                    || info.BeloneType == DeviceBeloneType.A绐楀笜 || info.BeloneType == DeviceBeloneType.A缁х數鍣�
+                    || info.BeloneType == DeviceBeloneType.A璋冨厜鍣�
+                    )
                 {
                     if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false)
                     {
@@ -224,9 +230,12 @@
         {
             var floors = new SelectFloor();
             AddChidren(floors);
+            floors.changeFloor = false;
+            floors.CurFloorId = curFloorId;
             floors.Init(580, 184, Direction.Right);
             floors.FloorAction += (floorId) =>
             {
+                curFloorId = floorId;
                 floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
                 RefreshBodyView(floorId);
             };
@@ -278,30 +287,20 @@
             };
             bodyFrameLayout.AddChidren(functionSceneBodyView);
 
-            Button curBtn = new Button();
+            RoomButton curBtn = new RoomButton(0, 0);
             foreach (var room in Common.Room.CurrentRoom.GetRoomsByFloorIdAppendLoveRoom(floorId))
             {
                 var row = new FrameLayout()
                 {
-                    Width = Application.GetRealWidth(187 + 50),
-                    Height = Application.GetRealHeight(204),
+                    Width = Application.GetRealWidth(255),
+                    Height = Application.GetRealHeight(167)
                 };
                 roomFL.AddChidren(row);
 
-                var roomBtn = new Button()
-                {
-                    Width = Application.GetRealWidth(187),
-                    Height = Application.GetRealHeight(78),
-                    Radius = (uint)Application.GetRealHeight(78 / 2),
-                    Gravity = Gravity.Center,
-                    Text = room.Name,
-                    TextColor = ZigbeeColor.Current.GXCTextGrayColor,
-                    SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
-                    BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor3,
-                    SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
-                    BorderColor = ZigbeeColor.Current.GXCBorderUnSelectedColor,
-                    BorderWidth = 1
-                };
+                RoomButton roomBtn = new RoomButton(0, 0);
+                roomBtn.Gravity = Gravity.Center;
+                roomBtn.Init();
+                roomBtn.SetTitle(room.Name);
                 row.AddChidren(roomBtn);
 
                 if (room.IsLove)
@@ -311,15 +310,15 @@
                     this.curRoom = room;
                     RefreshFunction(room);
                 }
-                roomBtn.MouseUpEventHandler += (sender, e) =>
+                roomBtn.ButtonClickEvent += (sender, e) =>
                 {
-                    if ((sender as Button) == curBtn)
+                    if (sender == curBtn)
                     {
                         return;
                     }
-                    (sender as Button).IsSelected = true;
+                    sender.IsSelected = true;
                     curBtn.IsSelected = false;
-                    curBtn = sender as Button;
+                    curBtn = sender;
                     this.curRoom = room;
                     RefreshFunction(room);
                 };
@@ -404,7 +403,7 @@
                     };
                     string imgPath = string.Empty;
                     string imgSeletedPath = string.Empty;
-                    Common.LocalDevice.Current.GetDeviceBeloneIcon(deviceType.Value, ref imgPath, ref imgSeletedPath);
+                    Common.LocalDevice.Current.GetDeviceObjectIcon(deviceType.Value, ref imgPath, ref imgSeletedPath);
                     functionTypeIMG.Init(imgPath, imgSeletedPath);
                     functionTypeIMG.SetTitle(deviceType.Key);
                     typeRowLayout.AddChidren(functionTypeIMG);
@@ -434,7 +433,7 @@
 
             var sameTypeList = new List<DeviceUI> { };
             sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())];
-            
+
             foreach (var device in sameTypeList)
             {
                 if (beforeSceneTargetDeviceUIs.Find((obj) => obj.DeviceUI.DeviceEpoint == device.DeviceEpoint && obj.DeviceUI.DeviceAddr == device.DeviceAddr) != null)
@@ -449,11 +448,13 @@
                 deviceListScrolView.AddChidren(deviceTypeRowLayout);
 
                 var deviceRow = new FunctionRow(0, 35);
-                deviceTypeRowLayout.AddChidren(deviceRow);
                 deviceRow.Init(device.IconPath, device.OnlineIconPath, true);
-                deviceRow.SetTitle(device.CommonDevice.DeviceEpointName);
+                deviceRow.SetTitle(Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice));
                 deviceRow.IsSelected = true;
                 deviceRow.HideSwitchBtn(false);
+                deviceRow.NameBtn.BackgroundColor = ZigbeeColor.Current.GXCRedColor;
+                deviceTypeRowLayout.AddChidren(deviceRow);
+
 
                 deviceRow.ClickBtn.MouseUpEventHandler += (sender, e) =>
                 {
@@ -484,7 +485,7 @@
                 Height = Application.GetRealHeight(200),
                 Width = Application.GetRealWidth(700),
                 Gravity = Gravity.CenterHorizontal,
-                Text = Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"),
+                Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"),
                 TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
                 TextAlignment = TextAlignment.Center,
                 IsMoreLines = true
@@ -582,11 +583,11 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
-                Text = device.CommonDevice.DeviceEpointName
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)
             };
             titleFL.AddChidren(deviceName);
 
@@ -738,11 +739,11 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
-                Text = device.CommonDevice.DeviceEpointName
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)
             };
             titleFL.AddChidren(deviceName);
 
@@ -795,7 +796,7 @@
                 dialog.RemoveFromParent();
             };
 
-            open.SeekBar.ProgressChanged += (sender, e) =>
+            open.SeekBar.OnProgressChangedEvent += (sender, e) =>
             {
                 open.IsSelected = true;
                 shut.IsSelected = false;
@@ -813,7 +814,7 @@
                 {
                     open.IsSelected = true;
                     shut.IsSelected = false;
-                    open.SetProgress(sceneTarget.TaskList[0].Data2);
+                    open.SetSeekBarProgress(sceneTarget.TaskList[0].Data2);
                 }
             }
 
@@ -903,12 +904,12 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
                 TextAlignment = TextAlignment.CenterLeft,
-                Text = device.CommonDevice.DeviceEpointName
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)
             };
             titleFL.AddChidren(deviceName);
 
@@ -961,7 +962,7 @@
                 dialog.RemoveFromParent();
             };
 
-            open.SeekBar.ProgressChanged += (sender, e) =>
+            open.SeekBar.OnProgressChangedEvent += (sender, e) =>
             {
                 open.IsSelected = true;
                 shut.IsSelected = false;
@@ -979,7 +980,7 @@
                 {
                     open.IsSelected = true;
                     shut.IsSelected = false;
-                    open.SetProgress(sceneTarget.TaskList[0].Data1);
+                    open.SetSeekBarProgress(sceneTarget.TaskList[0].Data1);
                 }
             }
 
@@ -1069,12 +1070,12 @@
 
             var deviceName = new Button
             {
-                Width = Application.GetRealWidth(400),
+                Width = Application.GetRealWidth(600),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 16,
                 TextAlignment = TextAlignment.CenterLeft,
-                Text = device.CommonDevice.DeviceEpointName
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice)
             };
             titleFL.AddChidren(deviceName);
 
@@ -1161,12 +1162,9 @@
                             tempId = open.temperatureList.IndexOf(tasklist.Data2/100);
                         }
                     }
-
                     open.pickerView.setCurrentItems(tempId, modelId, fanid);
                 }
             }
-
-
 
             comfrimBtn.MouseUpEventHandler = (sender, e) =>
             {

--
Gitblit v1.8.0