黄学彪
2020-07-01 304dca51c28183a9dfc192c6b93ea1c00bdd5d97
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -51,7 +51,7 @@
        /// <summary>
        /// 保存完成按钮
        /// </summary>
        Button btnFinifh;
        Button btnFinish;
        /// <summary>
        /// 楼层文本
        /// </summary>
@@ -165,7 +165,7 @@
            };
            this.midFrameLayout.AddChidren(bottomFrameLayout);
            btnFinifh = new Button()
            btnFinish = new Button()
            {
                Width = Application.GetRealWidth(907),
                Gravity = Gravity.CenterHorizontal,
@@ -176,10 +176,10 @@
                IsBold = true,
                TextSize = 16,
            };
            bottomFrameLayout.AddChidren(btnFinifh);
            bottomFrameLayout.AddChidren(btnFinish);
            #endregion
            #region 数据处理
            #region 数据处理
            //获取楼层
            dicFloor = HdlRoomLogic.Current.GetFloorSortList();
            currentKey.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId();
@@ -236,25 +236,25 @@
            if (curRoom.ListSceneId.Count == 0)
            {
                btnFinifh.Enable = false;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                btnFinish.Enable = false;
                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
            }
            else
            {
                btnFinifh.Enable = true;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                btnFinish.Enable = true;
                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
            }
            if (targetListDevice.Count == 0 && targetListScene.Count == 0)
            {
                btnFinifh.Enable = false;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                btnFinish.Enable = false;
                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
            }
            else
            {
                btnFinifh.Enable = true;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                btnFinish.Enable = true;
                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
            }
            btnFinifh.MouseUpEventHandler += (sender, e) =>
            btnFinish.MouseUpEventHandler += (sender, e) =>
            {
                bool isFinish = false;
                System.Threading.Tasks.Task.Run(() =>
@@ -284,9 +284,9 @@
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        btnFinifh.Enable = true;
                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
                                        btnFinish.Enable = true;
                                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
                                        CommonPage.Loading.Hide();
                                    });
                                    return;
@@ -300,8 +300,8 @@
                            {
                                Application.RunOnMainThread(() =>
                                {
                                    btnFinifh.Enable = true;
                                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    btnFinish.Enable = true;
                                    btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    CommonPage.Loading.Hide();
                                    var myTip = new Tip();
                                    myTip.Direction = AMPopTipDirection.None;
@@ -318,8 +318,8 @@
                        {
                            Application.RunOnMainThread(() =>
                            {
                                btnFinifh.Enable = true;
                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                btnFinish.Enable = true;
                                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                CommonPage.Loading.Hide();
                                var myTip = new Tip();
                                myTip.Direction = AMPopTipDirection.None;
@@ -333,8 +333,8 @@
                        {
                            Application.RunOnMainThread(() =>
                            {
                                btnFinifh.Enable = true;
                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                btnFinish.Enable = true;
                                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                var myTip = new Tip();
                                myTip.Direction = AMPopTipDirection.None;
                                myTip.CloseTime = 2;
@@ -396,16 +396,16 @@
                                            this.RemoveFromParent();
                                        }
                                        CommonPage.Loading.Hide();
                                        btnFinifh.Enable = true;
                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        btnFinish.Enable = true;
                                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    });
                                }
                                else if (dev.addedDeviceBindResponseData.Result == 1)
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        btnFinifh.Enable = true;
                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        btnFinish.Enable = true;
                                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        CommonPage.Loading.Hide();
                                        new Tip()
                                        {
@@ -413,7 +413,7 @@
                                            Text = Language.StringByID(R.MyInternationalizationString.BindFailed),
                                            Direction = AMPopTipDirection.Up,
                                            CloseTime = 1
                                        }.Show(btnFinifh);
                                        }.Show(btnFinish);
                                    });
                                    return;
                                }
@@ -421,8 +421,8 @@
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                        btnFinifh.Enable = true;
                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        btnFinish.Enable = true;
                                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        CommonPage.Loading.Hide();
                                        new Tip()
                                        {
@@ -430,7 +430,7 @@
                                            Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError),
                                            Direction = AMPopTipDirection.Up,
                                            CloseTime = 1
                                        }.Show(btnFinifh);
                                        }.Show(btnFinish);
                                    });
                                    return;
@@ -440,10 +440,10 @@
                            {
                                Application.RunOnMainThread(() =>
                                {
                                    btnFinifh.Enable = true;
                                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    btnFinish.Enable = true;
                                    btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    CommonPage.Loading.Hide();
                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
                                });
                                return;
@@ -510,7 +510,7 @@
                var btnRoom = new Button
                {
                    Height = Application.GetRealHeight(58),
                    Width = Application.GetRealWidth(127),
                    Width = Application.GetRealWidth(255),
                    Y = Application.GetRealHeight(58),
                    X = Application.GetRealWidth(14),
                    Text = room.Name,
@@ -568,23 +568,23 @@
                    curRoom = room;
                    if (curRoom.ListSceneId.Count == 0)
                    {
                        btnFinifh.Enable = false;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                        btnFinish.Enable = false;
                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                    }
                    else
                    {
                        btnFinifh.Enable = true;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        btnFinish.Enable = true;
                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    }
                    if (targetListDevice.Count == 0 && targetListScene.Count == 0)
                    {
                        btnFinifh.Enable = false;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                        btnFinish.Enable = false;
                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                    }
                    else
                    {
                        btnFinifh.Enable = true;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        btnFinish.Enable = true;
                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    }
                    RefreshSceneList(curRoom);
@@ -593,7 +593,7 @@
                btnRoomFrameLayout.MouseUpEventHandler += eHandlerRoom;
                index++;
            }
            BindInfo.FinishDisplay(roomTempList, btnFinifh);
            BindInfo.FinishDisplay(roomTempList, btnFinish);
            RefreshSceneList(curRoom);
        }
@@ -613,8 +613,8 @@
            var currentSceneUIList = GetMatchSceneUIList(curRoom);
            if (currentSceneUIList.Count == 0)
            {
                btnFinifh.Enable = false;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                btnFinish.Enable = false;
                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                return;
            }
            foreach (var scene in currentSceneUIList)
@@ -736,13 +736,13 @@
                    }
                    if (targetListDevice.Count == 0 && targetListScene.Count == 0)
                    {
                        btnFinifh.Enable = false;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                        btnFinish.Enable = false;
                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                    }
                    else
                    {
                        btnFinifh.Enable = true;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        btnFinish.Enable = true;
                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    }
                };
                rowLayout.MouseUpEventHandler += hander;
@@ -753,13 +753,13 @@
            }
            if (targetListDevice.Count == 0 && targetListScene.Count == 0)
            {
                btnFinifh.Enable = false;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                btnFinish.Enable = false;
                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
            }
            else
            {
                btnFinifh.Enable = true;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                btnFinish.Enable = true;
                btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
            }
        }
@@ -906,13 +906,13 @@
                    RefreshSceneList(roomList[0]);
                    if (targetListDevice.Count == 0 && targetListScene.Count == 0)
                    {
                        btnFinifh.Enable = false;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                        btnFinish.Enable = false;
                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                    }
                    else
                    {
                        btnFinifh.Enable = true;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        btnFinish.Enable = true;
                        btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                    }
                    dialog.Close();
                };
@@ -942,7 +942,7 @@
        List<SceneUI> GetALlDispalyRoomSceneList()
        {
            currentKeyAllRoomSceneList.Clear();
            // 获取所有房间
            // 获取所有房间
            var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
            foreach (var room in listAllRoom)
            {