gxc
2020-01-02 34e965100d635346e2d4cd6e6013bdaed66b3004
ZigbeeApp/Shared/Phone/Device/Category/SelectDevice.cs
@@ -31,6 +31,10 @@
        /// </summary>
        private Button floorBtn;
        /// <summary>
        /// 当前楼层id
        /// </summary>
        private string curFloorId;
        /// <summary>
        /// 选择楼层
        /// </summary>
        private Button selectFloorBtn;
@@ -153,7 +157,7 @@
                    || info.BeloneType == DeviceBeloneType.A插座 || info.BeloneType == DeviceBeloneType.A智能空开
                    || info.BeloneType == DeviceBeloneType.A灯光 || info.BeloneType == DeviceBeloneType.A空调
                    || info.BeloneType == DeviceBeloneType.A窗帘 || info.BeloneType == DeviceBeloneType.A继电器
                    || info.BeloneType == DeviceBeloneType.A调光器
                    || info.BeloneType == DeviceBeloneType.A调光器
                    )
                {
                    if (typeDeviceDic.ContainsKey(info.BeloneTextId) == false)
@@ -226,9 +230,12 @@
        {
            var floors = new SelectFloor();
            AddChidren(floors);
            floors.changeFloor = false;
            floors.CurFloorId = curFloorId;
            floors.Init(580, 184, Direction.Right);
            floors.FloorAction += (floorId) =>
            {
                curFloorId = floorId;
                floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
                RefreshBodyView(floorId);
            };
@@ -280,30 +287,20 @@
            };
            bodyFrameLayout.AddChidren(functionSceneBodyView);
            Button curBtn = new Button();
            RoomButton curBtn = new RoomButton(0, 0);
            foreach (var room in Common.Room.CurrentRoom.GetRoomsByFloorIdAppendLoveRoom(floorId))
            {
                var row = new FrameLayout()
                {
                    Width = Application.GetRealWidth(187 + 50),
                    Height = Application.GetRealHeight(204),
                    Width = Application.GetRealWidth(255),
                    Height = Application.GetRealHeight(167)
                };
                roomFL.AddChidren(row);
                var roomBtn = new Button()
                {
                    Width = Application.GetRealWidth(187),
                    Height = Application.GetRealHeight(78),
                    Radius = (uint)Application.GetRealHeight(78 / 2),
                    Gravity = Gravity.Center,
                    Text = room.Name,
                    TextColor = ZigbeeColor.Current.GXCTextGrayColor,
                    SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
                    BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor3,
                    SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
                    BorderColor = ZigbeeColor.Current.GXCBorderUnSelectedColor,
                    BorderWidth = 1
                };
                RoomButton roomBtn = new RoomButton(0, 0);
                roomBtn.Gravity = Gravity.Center;
                roomBtn.Init();
                roomBtn.SetTitle(room.Name);
                row.AddChidren(roomBtn);
                if (room.IsLove)
@@ -313,15 +310,15 @@
                    this.curRoom = room;
                    RefreshFunction(room);
                }
                roomBtn.MouseUpEventHandler += (sender, e) =>
                roomBtn.ButtonClickEvent += (sender, e) =>
                {
                    if ((sender as Button) == curBtn)
                    if (sender == curBtn)
                    {
                        return;
                    }
                    (sender as Button).IsSelected = true;
                    sender.IsSelected = true;
                    curBtn.IsSelected = false;
                    curBtn = sender as Button;
                    curBtn = sender;
                    this.curRoom = room;
                    RefreshFunction(room);
                };
@@ -406,7 +403,7 @@
                    };
                    string imgPath = string.Empty;
                    string imgSeletedPath = string.Empty;
                    Common.LocalDevice.Current.GetDeviceBeloneIcon(deviceType.Value, ref imgPath, ref imgSeletedPath);
                    Common.LocalDevice.Current.GetDeviceObjectIcon(deviceType.Value, ref imgPath, ref imgSeletedPath);
                    functionTypeIMG.Init(imgPath, imgSeletedPath);
                    functionTypeIMG.SetTitle(deviceType.Key);
                    typeRowLayout.AddChidren(functionTypeIMG);
@@ -436,7 +433,7 @@
            var sameTypeList = new List<DeviceUI> { };
            sameTypeList = typeDeviceDic[int.Parse((typeSender as Button).Tag.ToString())];
            foreach (var device in sameTypeList)
            {
                if (beforeSceneTargetDeviceUIs.Find((obj) => obj.DeviceUI.DeviceEpoint == device.DeviceEpoint && obj.DeviceUI.DeviceAddr == device.DeviceAddr) != null)
@@ -486,7 +483,7 @@
                Height = Application.GetRealHeight(200),
                Width = Application.GetRealWidth(700),
                Gravity = Gravity.CenterHorizontal,
                Text = Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"),
                Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"),
                TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
                TextAlignment = TextAlignment.Center,
                IsMoreLines = true
@@ -584,7 +581,7 @@
            var deviceName = new Button
            {
                Width = Application.GetRealWidth(400),
                Width = Application.GetRealWidth(600),
                Gravity = Gravity.CenterHorizontal,
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                TextSize = 16,
@@ -740,7 +737,7 @@
            var deviceName = new Button
            {
                Width = Application.GetRealWidth(400),
                Width = Application.GetRealWidth(600),
                Gravity = Gravity.CenterHorizontal,
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                TextSize = 16,
@@ -905,7 +902,7 @@
            var deviceName = new Button
            {
                Width = Application.GetRealWidth(400),
                Width = Application.GetRealWidth(600),
                Gravity = Gravity.CenterHorizontal,
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                TextSize = 16,
@@ -1071,7 +1068,7 @@
            var deviceName = new Button
            {
                Width = Application.GetRealWidth(400),
                Width = Application.GetRealWidth(600),
                Gravity = Gravity.CenterHorizontal,
                TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                TextSize = 16,