| | |
| | | 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); |
| | |
| | | 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, |
| | |
| | | } |
| | | 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); |
| | | }); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | 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; |
| | | }); |
| | |
| | | #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) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | //如果房间中没有设备,则不显示 |
| | | //如果房间中没有场景,则不显示 |
| | | if (room.SceneUIList.Count == 0) |
| | | { |
| | | continue; |
| | |
| | | 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, |
| | |
| | | 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; |
| | |
| | | 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) |
| | |
| | | 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) |
| | |
| | | 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; |
| | |
| | | X = btnRoom.Right, |
| | | }; |
| | | btnHorizontalScrolViewLayout.AddChidren(btnEmpty); |
| | | index++; |
| | | } |
| | | |
| | | BindInfo.FinishDisplay(roomTempList, btnFinish); |
| | | index++; |
| | | BindInfo.FinishDisplay(roomTempList, btnChooseKeyMode); |
| | | RefreshSceneList(curRoom); |
| | | } |
| | | |
| | | //按键绑定场景表显示 |
| | |
| | | Y = Application.GetMinRealAverage(46), |
| | | Width = Application.GetMinRealAverage(81), |
| | | Height = Application.GetMinRealAverage(81), |
| | | UnSelectedImagePath = scene.IconPath, |
| | | UnSelectedImagePath = "SceneIcon/4.png",// scene.IconPath, |
| | | }; |
| | | rowLayout.AddChidren(devicePic); |
| | | |