From 16604a593202f2f87adf71abd57d036fe7da3b52 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 18 十一月 2019 10:39:42 +0800
Subject: [PATCH] 同步了全部的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs |  112 ++++++++++++++++++-------------------------------------
 1 files changed, 37 insertions(+), 75 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
index 3bd0b32..5943cbb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -114,13 +114,14 @@
             midVerticalScrolViewLayout = new VerticalScrolViewLayout()
             {
                 Y = btnMidTopLayout.Bottom,
+                Height = Application.GetRealHeight(1145),
             };
             this.midFrameLayout.AddChidren(midVerticalScrolViewLayout);
 
             var bottomFrameLayout = new FrameLayout()
             {
                 Width = LayoutParams.MatchParent,
-                Height = Application.GetRealHeight(1737 - 1472),
+                Height = Application.GetRealHeight(127),
                 Y = Application.GetRealHeight(1472),
             };
             this.midFrameLayout.AddChidren(bottomFrameLayout);
@@ -128,9 +129,8 @@
             btnFinifh = new Button()
             {
                 Width = Application.GetRealWidth(907),
-                Height = Application.GetRealHeight(127),
                 Gravity = Gravity.CenterHorizontal,
-                Radius = (uint)Application.GetRealHeight(120) / 2,
+                Radius = (uint)Application.GetRealHeight(127) / 2,
                 TextID = R.MyInternationalizationString.Save,
                 BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                 TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
@@ -200,15 +200,14 @@
                         }
                         else
                         {
-                            var btn = new Button()
-                            {
-                                Gravity = Gravity.Center,
-                            };
-                            this.midFrameLayout.AddChidren(btn);
                             Application.RunOnMainThread(() =>
                             {
-                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btn);
-                            });
+                                var myTip = new Tip();
+                                myTip.Direction = AMPopTipDirection.None;
+                                myTip.CloseTime = 2;
+                                myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
+                                myTip.Show(Common.CommonPage.Instance);
+                             });
                         }
                     }
 
@@ -217,7 +216,12 @@
                     {
                         Application.RunOnMainThread(() =>
                         {
-                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
+                            var myTip = new Tip();
+                            myTip.Direction = AMPopTipDirection.None;
+                            myTip.CloseTime = 2;
+                            myTip.Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode);
+                            myTip.Show(Common.CommonPage.Instance);
+                            //new Tip() { Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(btnFinifh);
                             btnFinifh.Enable = true;
                             btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                         });
@@ -364,8 +368,12 @@
             #endregion
         }
 
-        // 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
-        void RefreshRoomList(Shared.Common.Room curRoom, Button btnFinish, ref int index2)
+        /// <summary>
+        /// 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
+        /// </summary>
+        /// <param name="gateway">Gateway.</param>
+        /// <param name="key">Key.</param>
+        void RefreshRoomList(Shared.Common.Room curRoom, Button btnChooseKeyMode, ref int index2)
         {
             if (roomList.Count == 0)
             {
@@ -386,7 +394,7 @@
                     continue;
                 }
 
-                //濡傛灉鎴块棿涓病鏈夎澶囷紝鍒欎笉鏄剧ず
+                //濡傛灉鎴块棿涓病鏈夊満鏅紝鍒欎笉鏄剧ず
                 if (room.SceneUIList.Count == 0)
                 {
                     continue;
@@ -405,6 +413,7 @@
                     Height = Application.GetRealHeight(78),
                     Width = Application.GetRealWidth(187),
                     Y = Application.GetRealHeight(58),
+                    X = Application.GetRealWidth(58),
                     Radius = (uint)Application.GetMinRealAverage(78 / 2),
                     BorderColor = Shared.Common.ZigbeeColor.Current.XMOrange,
                     BorderWidth = 1,
@@ -421,15 +430,10 @@
                     TextSize = 12,
                     TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                     Gravity = Gravity.Center,
-                    //SelectedImagePath = "BindPic/BindRoomColorOn.png",
-                    //UnSelectedImagePath = "BindPic/BindRoomColor.png",
                 };
                 btnRoomFrameLayout.AddChidren(btnRoom);
 
-
                 btnRoom.IsSelected = false;
-
-                //榛樿閫変腑姣忎釜妤煎眰鐨勭涓�涓埧闂�
                 if (index == 0)
                 {
                     btnRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
@@ -439,48 +443,6 @@
                     curentOldRoom = btnRoom;
                     curentOldRoomFrameLayout = btnRoomFrameLayout;
                 }
-
-                //璁板綍涔嬪墠閫変腑鐨勬埧闂�
-                //if (currentKey.RoomId == "")
-                //{
-                //    if (i == index)
-                //    {
-                //        btnRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
-                //        btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
-                //        btnRoomFrameLayout.BorderWidth = 0;
-                //        btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite;
-                //        curentOldRoom = btnRoom;
-                //        curentOldRoomFrameLayout = btnRoomFrameLayout;
-                //    }
-                //    else
-                //    {
-                //        btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
-                //        btnRoom.IsSelected = false;
-                //        btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout;
-                //        btnRoomFrameLayout.BorderWidth = 1;
-                //    }
-                //}
-                //else
-                //{
-                //    if (currentKey.RoomId == room.Id)
-                //    {
-                //        btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite;
-                //        btnRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
-                //        btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
-                //        btnRoomFrameLayout.BorderWidth = 0;
-                //        curentOldRoom = btnRoom;
-                //        curentOldRoomFrameLayout = btnRoomFrameLayout;
-                //        curRoom = room;
-                //        index2 = i;
-                //    }
-                //    else
-                //    {
-                //        btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
-                //        btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout;
-                //        btnRoomFrameLayout.BorderWidth = 1;
-                //    }
-                //}
-
                 EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
                 {
                     if (!btnRoom.IsSelected)
@@ -495,17 +457,17 @@
                         curentOldRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
                         curRoom = room;
                         currentKey.RoomId = room.Id;
+                        RefreshSceneList(curRoom);
                         if (curRoom.SceneUIList.Count == 0)
                         {
-                            btnFinish.Enable = false;
-                            btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
+                            btnChooseKeyMode.Enable = false;
+                            btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                         }
                         else
                         {
-                            btnFinish.Enable = true;
-                            btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                            btnChooseKeyMode.Enable = true;
+                            btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                         }
-                        RefreshSceneList(curRoom);
                     }
 
                     if (btnRoomFrameLayout.BorderWidth == 1)
@@ -520,17 +482,17 @@
                         curentOldRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
                         curRoom = room;
                         currentKey.RoomId = room.Id;
+                        RefreshSceneList(curRoom);
                         if (curRoom.SceneUIList.Count == 0)
                         {
-                            btnFinish.Enable = false;
-                            btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
+                            btnChooseKeyMode.Enable = false;
+                            btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                         }
                         else
                         {
-                            btnFinish.Enable = true;
-                            btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                            btnChooseKeyMode.Enable = true;
+                            btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                         }
-                        RefreshSceneList(curRoom);
                     }
                 };
                 btnRoom.MouseUpEventHandler += eHandlerRoom;
@@ -542,10 +504,10 @@
                     X = btnRoom.Right,
                 };
                 btnHorizontalScrolViewLayout.AddChidren(btnEmpty);
+                index++;
             }
-
-            BindInfo.FinishDisplay(roomTempList, btnFinish);
-            index++;
+            BindInfo.FinishDisplay(roomTempList, btnChooseKeyMode);
+            RefreshSceneList(curRoom);
         }
 
         //鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
@@ -575,7 +537,7 @@
                     Y = Application.GetMinRealAverage(46),
                     Width = Application.GetMinRealAverage(81),
                     Height = Application.GetMinRealAverage(81),
-                    UnSelectedImagePath = scene.IconPath,
+                    UnSelectedImagePath = "SceneIcon/4.png",// scene.IconPath,
                 };
                 rowLayout.AddChidren(devicePic);
 

--
Gitblit v1.8.0