WJC
2019-10-14 b78a4d0ca90416d37fcbaf5e54b00f7eaab53919
ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs
@@ -86,7 +86,8 @@
                Width = Application.GetRealWidth(400),
                Height = Application.GetRealHeight(69),
                Y = Application.GetRealHeight(92),
                TextID = MyInternationalizationString.customroom,
                //TextID = MyInternationalizationString.customroom,
                Text = Config.Instance.Home.GetCurrentFloorName,
            };
            topRowLayout.AddChidren(foolrname);
            var dropdown = new Button
@@ -161,7 +162,7 @@
            ///楼层点击事件
            foolrname.MouseUpEventHandler += (sender, e) =>
            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
            {
                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
@@ -172,6 +173,7 @@
                };
                var foolrbj = new VerticalScrolViewLayout
                {
                    Width = Application.GetRealWidth(400),
                    Height = Application.GetRealHeight(600),
                    X = Application.GetRealWidth(1080 - 400 - 60),
@@ -180,11 +182,9 @@
                    Radius = (uint)Application.GetRealHeight(30),
                };
                flMain.AddChidren(foolrbj);
                ///默认调试
                List<string> foolrlist = new List<string> { "一楼", "二楼", "三楼" };
                foreach (var foolr in foolrlist)
                foreach (var foolr in Config.Instance.Home.FloorDics)
                {
                    var foolrRowLayout = new FrameLayout
                    {
                        Height = Application.GetRealHeight(150),
@@ -195,34 +195,55 @@
                    {
                        Width = Application.GetRealWidth(250),
                        Height = Application.GetRealHeight(160),
                        Text = foolr,
                        Text = foolr.Value,
                        TextAlignment = TextAlignment.Center,
                        TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                        //SelectedTextColor=0xfffc744b,
                        Tag = foolr.Key,
                    };
                    foolrRowLayout.AddChidren(btnfoolrname);
                    EventHandler<MouseEventArgs> foolrclick = (sender13, e13) =>
                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
                    {
                        roomhorizontalScrol.RemoveAll();
                        foolrname.Text = btnfoolrname.Text;
                        flMain.RemoveFromParent();
                        ///备注:显示选中楼层的所有房间
                        AllRoomView(Common.Room.Lists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
                        AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
                    };
                    foolrRowLayout.MouseUpEventHandler += foolrclick;
                    btnfoolrname.MouseUpEventHandler += foolrclick;
                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
                }
            };
            foolrname.MouseUpEventHandler += foorlclick;
            dropdown.MouseUpEventHandler += foorlclick;
            ///第一次进来
            AllRoomView(Common.Room.Lists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
            var roomlists = new List<Common.Room>();
            roomlists.Clear();
            if (Config.Instance.Home.FloorDics.Count < 1)
            {
                foolrname.Visible = false;
                dropdown.Visible = false;
                if (Config.Instance.Home.FloorDics.Count == 0)
                {
                    roomlists.AddRange(Common.Room.Lists);
                }
                else
                {
                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
                }
            }
            else
            {
                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
            }
            AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
        }
        /// <summary>
        /// 加载所有房间的视图方法
@@ -274,6 +295,10 @@
                    var list = new List<DeviceUI>();
                    foreach (var device in room.DeviceUIList)
                    {
                        if (device.CommonDevice == null)
                        {
                            continue;
                        }
                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
                        {
                            continue;
@@ -297,6 +322,10 @@
                    var list = new List<DeviceUI>();
                    foreach (var device in room.DeviceUIList)
                    {
                        if (device.CommonDevice == null)
                        {
                            continue;
                        }
                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
                        {
                            continue;