gxc
2019-12-20 a2b0218c104808fc686a40f258b48dc70bdd7170
ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
@@ -40,7 +40,10 @@
        /// sceneUI
        /// </summary>
        public SceneUI sceneUI;
        /// <summary>
        /// 当前场景本身,添加场景时使用
        /// </summary>
        public SceneUI currentSceneUI;
        #endregion
@@ -66,7 +69,7 @@
            AddBodyView();
            RefreshBodyView();
            RefreshBodyView(Config.Instance.Home.CurrentFloorId);
        }
@@ -124,10 +127,10 @@
            var floors = new SelectFloor();
            AddChidren(floors);
            floors.Init(580, 184, Direction.Right);
            floors.FloorAction += (floorName) =>
            floors.FloorAction += (floorId) =>
            {
                floorBtn.Text = floorName;
                RefreshBodyView();
                floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
                RefreshBodyView(floorId);
            };
        }
        /// <summary>
@@ -161,15 +164,15 @@
        /// <summary>
        /// RefreshBodyView
        /// </summary>
        private void RefreshBodyView()
        private void RefreshBodyView(string floorId)
        {
            AddRoomView();
            AddRoomView(floorId);
        }
        /// <summary>
        /// AddRoomView
        /// </summary>
        private void AddRoomView()
        private void AddRoomView(string floorId)
        {
            var roomFL = new HorizontalScrolViewLayout()
            {
@@ -190,7 +193,7 @@
            bodyFrameLayout.AddChidren(functionSceneBodyView);
            Button curBtn = new Button();
            foreach (var room in Common.Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom())
            foreach (var room in Common.Room.CurrentRoom.GetRoomsByFloorIdAppendLoveRoom(floorId))
            {
                var row = new FrameLayout()
                {
@@ -270,6 +273,10 @@
                for (int i = 0; i < sceneList.Count; i++)
                {
                    var scene = sceneList[i];
                    if (currentSceneUI?.Id == scene.Id)
                    {
                        continue;
                    }
                    if (beforeSceneTargetDeviceUIs.Find((obj) => obj.SceneUI.Id == scene.Id) != null)
                    {
                        continue;
@@ -286,7 +293,7 @@
                    sceneRowLayout.Init();
                    sceneRowLayout.SetTitle(scene.Name);
                    sceneRowLayout.ClickButton.Tag = scene;
                    if(sceneUI==null)
                    if (sceneUI == null)
                    {
                        if (i == 0)
                        {
@@ -297,7 +304,7 @@
                    }
                    else
                    {
                        if(sceneUI.Id==scene.Id)
                        if (sceneUI.Id == scene.Id)
                        {
                            tempSceneRow = sceneRowLayout;
                            sceneUI = scene;