黄学彪
2019-11-18 16604a593202f2f87adf71abd57d036fe7da3b52
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);