old mode 100644
new mode 100755
| | |
| | | public Action<List<BindListResponseObj>> action; |
| | | Button btnFinifh; |
| | | Button btnFloorText; |
| | | Dictionary<string, string> dicFloor;//楼层列表
|
| | | Dictionary<string, string> dicFloor;//楼层列表 |
| | | List<SceneUI> currentKeyAllRoomSceneList = new List<SceneUI>(); |
| | | #endregion |
| | | |
| | |
| | | var btnAddFrameLayout = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(830), |
| | | Width = Application.GetRealWidth(200), |
| | | }; |
| | | this.titleFrameLayout.AddChidren(btnAddFrameLayout); |
| | | |
| | |
| | | { |
| | | SideslipFramelayout(); |
| | | }; |
| | | if (Common.Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | btnAddFrameLayout.Width = 0; |
| | | } |
| | | else |
| | | { |
| | | btnAddFrameLayout.Width = Application.GetRealWidth(200); |
| | | } |
| | | MidFrameLayoutContent(btnFloorText); |
| | | } |
| | | |
| | |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | |
| | | if (Common.Config.Instance.Home.FloorDics.Count == 0) |
| | | {
|
| | | // 获取没有楼层房间
|
| | | { |
| | | // 获取没有楼层房间 |
| | | foreach (var room in Shared.Common.Room.Lists) |
| | | { |
| | | if (string.IsNullOrEmpty(room.FloorId)) |
| | | { |
| | | roomList.Add(room); |
| | | } |
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | // 获取楼层对应对房间
|
| | | foreach (var room in Shared.Common.Room.Lists)
|
| | | {
|
| | | if (room.FloorId == currentKey.currentSelectFloorId)
|
| | | {
|
| | | roomList.Add(room);
|
| | | }
|
| | | }
|
| | | }
|
| | | if (roomList.Count == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //首次拿到所有房间中按键的目标并存储
|
| | | } |
| | | } |
| | | else |
| | | { |
| | | // 获取楼层对应对房间 |
| | | foreach (var room in Shared.Common.Room.Lists) |
| | | { |
| | | if (room.FloorId == currentKey.currentSelectFloorId) |
| | | { |
| | | roomList.Add(room); |
| | | } |
| | | } |
| | | } |
| | | if (roomList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | //首次拿到所有房间中按键的目标并存储 |
| | | GetALlDispalyRoomSceneList(); |
| | | |
| | | if (currentKeyAllRoomSceneList.Count != 0) |
| | |
| | | { |
| | | var sc = currentKey.bindList.Find(obj => (obj != null) && (obj.BindScenesId == scTemp.Id)); |
| | | if (sc != null) |
| | | {
|
| | | targetList.Add(scTemp);
|
| | | { |
| | | targetList.Add(scTemp); |
| | | } |
| | | } |
| | | } |
| | |
| | | Shared.Common.Room curRoom = roomList[0]; |
| | | int index = 0; |
| | | RefreshRoomList(curRoom, ref index); |
| | | RefreshSceneList(roomList[index]); |
| | | //RefreshSceneList(roomList[index]); |
| | | |
| | | if (curRoom.SceneUIList.Count == 0) |
| | | { |
| | |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | }
|
| | | if (targetList.Count == 0)
|
| | | {
|
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
|
| | | }
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | }
|
| | | } |
| | | btnFinifh.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | bool isFinish = false; |
| | | try |
| | | { |
| | | if (targetList.Count == 0)
|
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | var myTip = new Tip();
|
| | | myTip.Direction = AMPopTipDirection.None;
|
| | | myTip.CloseTime = 2;
|
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.BindDeviceTargetIsEmpty);
|
| | | if (targetList.Count == 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var myTip = new Tip(); |
| | | myTip.Direction = AMPopTipDirection.None; |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.BindDeviceTargetIsEmpty); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | }); |
| | | return;
|
| | | return; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | {
|
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | var myTip = new Tip(); |
| | | myTip.Direction = AMPopTipDirection.None; |
| | |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | }); |
| | | btnFinifh.Enable = true;
|
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | |
| | | |
| | | var temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Scene_Trigger); |
| | | if (temp == null || temp.setWritableValueResponData == null) |
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | CommonPage.Loading.Hide();
|
| | | var myTip = new Tip();
|
| | | myTip.Direction = AMPopTipDirection.None;
|
| | | myTip.CloseTime = 2;
|
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
|
| | | myTip.Show(Common.CommonPage.Instance);
|
| | | });
|
| | | btnFinifh.Enable = true;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
|
| | | return;
|
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | var myTip = new Tip(); |
| | | myTip.Direction = AMPopTipDirection.None; |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | if (temp.setWritableValueResponData.Status != 0) |
| | | { |
| | |
| | | myTip.Direction = AMPopTipDirection.None; |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode); |
| | | myTip.Show(Common.CommonPage.Instance);
|
| | | CommonPage.Loading.Hide();
|
| | | myTip.Show(Common.CommonPage.Instance); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | btnFinifh.Enable = true;
|
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | |
| | | Width = Application.GetRealWidth(255), |
| | | Y = Application.GetRealHeight(23), |
| | | X = Application.GetRealWidth(5), |
| | | BackgroundImagePath = "Item/RoomIconBackground.png",
|
| | | BackgroundImagePath = "Item/RoomIconBackground.png", |
| | | BorderWidth = 1, |
| | | }; |
| | | btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayout); |
| | |
| | | btnRoom.IsSelected = false; |
| | | if (index == 0) |
| | | { |
| | | btnRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png";
|
| | | btnRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom = btnRoom; |
| | | curentOldRoomFrameLayout = btnRoomFrameLayout; |
| | |
| | | if (curentOldRoomFrameLayout != null) |
| | | { |
| | | curentOldRoomFrameLayout.BorderWidth = 1; |
| | | curentOldRoomFrameLayout.BorderColor = Shared.Common.ZigbeeColor.Current.XMOrange;
|
| | | curentOldRoomFrameLayout.BorderColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackground.png"; |
| | | } |
| | | curentOldRoomFrameLayout = btnRoomFrameLayout; |
| | |
| | | } |
| | | curRoom = room; |
| | | currentKey.RoomId = room.Id; |
| | | if (curRoom.SceneUIList.Count == 0)
|
| | | {
|
| | | btnFinifh.Enable = false;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnFinifh.Enable = true;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
|
| | | }
|
| | | if (targetList.Count == 0)
|
| | | {
|
| | | btnFinifh.Enable = false;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnFinifh.Enable = true;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
|
| | | if (curRoom.SceneUIList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | RefreshSceneList(curRoom); |
| | | |
| | |
| | | Y = Application.GetMinRealAverage(46), |
| | | Width = Application.GetMinRealAverage(81), |
| | | Height = Application.GetMinRealAverage(81), |
| | | UnSelectedImagePath = scene.IconPath, |
| | | UnSelectedImagePath = "Scene/SceneIcon.png",// scene.IconPath, |
| | | }; |
| | | rowLayout.AddChidren(devicePic); |
| | | |
| | |
| | | { |
| | | btnBindName.Text = scene.Name; |
| | | } |
| | | if (targetList.Count == 0)
|
| | | {
|
| | | foreach (var bindedSc in currentKey.bindList)
|
| | | {
|
| | | if (scene.Id == bindedSc.BindScenesId)
|
| | | {
|
| | | btnChoose.IsSelected = true;
|
| | | btnChoose.Visible = true;
|
| | | oldScene = btnChoose;
|
| | | targetList.Add(scene);
|
| | | }
|
| | | if (targetList.Count == 0) |
| | | { |
| | | foreach (var bindedSc in currentKey.bindList) |
| | | { |
| | | if (scene.Id == bindedSc.BindScenesId) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | btnChoose.Visible = true; |
| | | oldScene = btnChoose; |
| | | targetList.Add(scene); |
| | | } |
| | | } |
| | | }
|
| | | else
|
| | | {
|
| | | foreach (var bindedSc in targetList)
|
| | | } |
| | | else |
| | | { |
| | | foreach (var bindedSc in targetList) |
| | | { |
| | | var sc1 = (SceneUI)bindedSc; |
| | | if (scene.Id == sc1.Id)
|
| | | {
|
| | | btnChoose.IsSelected = true;
|
| | | btnChoose.Visible = true;
|
| | | if (scene.Id == sc1.Id) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | btnChoose.Visible = true; |
| | | oldScene = btnChoose; |
| | | }
|
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | currentKey.curSelectSceneID = scene.Id.ToString(); |
| | | targetList.Clear(); |
| | | targetList.Add(scene); |
| | | }
|
| | | if (targetList.Count == 0)
|
| | | {
|
| | | btnFinifh.Enable = false;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnFinifh.Enable = true;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
|
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | }; |
| | | rowLayout.MouseUpEventHandler += hander; |
| | |
| | | btnBindName.MouseUpEventHandler += hander; |
| | | btnChoose.MouseUpEventHandler += hander; |
| | | curIndex++; |
| | | }
|
| | | if (targetList.Count == 0)
|
| | | {
|
| | | btnFinifh.Enable = false;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnFinifh.Enable = true;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
|
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | |
| | |
| | | int index = 0; |
| | | RefreshRoomList(curRoom, ref index); |
| | | RefreshSceneList(roomList[0]); |
| | | if (targetList.Count == 0)
|
| | | {
|
| | | btnFinifh.Enable = false;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnFinifh.Enable = true;
|
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
|
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | |
| | | //当前按键所有显示房间的所有场景处理 |
| | | List<SceneUI> GetALlDispalyRoomSceneList() |
| | | { |
| | | currentKeyAllRoomSceneList.Clear();
|
| | | currentKeyAllRoomSceneList.Clear(); |
| | | // 获取所有房间 |
| | | foreach (var room in Shared.Common.Room.Lists)
|
| | | foreach (var room in Shared.Common.Room.Lists) |
| | | { |
| | | //如果房间为喜爱,则不显示 |
| | | if (room.IsLove == true) |
| | |
| | | continue; |
| | | } |
| | | |
| | | foreach (var scene in room.SceneUIList)
|
| | | {
|
| | | currentKeyAllRoomSceneList.Add(scene);
|
| | | }
|
| | | foreach (var scene in room.SceneUIList) |
| | | { |
| | | currentKeyAllRoomSceneList.Add(scene); |
| | | } |
| | | } |
| | | return currentKeyAllRoomSceneList; |
| | | } |