| | |
| | | floors.FloorAction += (floorId) =>
|
| | | {
|
| | | btnFloorName.Text = Config.Instance.Home.GetFloorNameById(floorId);
|
| | | HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | HdlRoomLogic.Current.NowCategoryRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | //刷新bodyView
|
| | | this.RefreshBodyView();
|
| | | };
|
| | |
| | | {
|
| | | //当前楼层的全部房间
|
| | | var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom();
|
| | | if (HdlRoomLogic.Current.NowCategoryRoom == null)
|
| | | {
|
| | | //设置第一个为初始房间
|
| | | HdlRoomLogic.Current.NowCategoryRoom = lisrRoom[0];
|
| | | }
|
| | | //房间菜单控件
|
| | | var roomSwitchContr = new RoomDeviceGroupMenuControl(lisrRoom);
|
| | | roomSwitchContr.Y = Application.GetRealHeight(-55);
|
| | | this.functionSceneAutoBodyView.AddChidren(roomSwitchContr);
|
| | | //设置初始值
|
| | | roomSwitchContr.SetDefultIndex(HdlRoomLogic.Current.CurrentRoom.Id);
|
| | | roomSwitchContr.SetDefultIndex(HdlRoomLogic.Current.NowCategoryRoom.Id);
|
| | | //选择事件
|
| | | roomSwitchContr.SelectRoomEvent += (selectRoom) =>
|
| | | {
|
| | | HdlRoomLogic.Current.CurrentRoom = selectRoom;
|
| | | HdlRoomLogic.Current.NowCategoryRoom = selectRoom;
|
| | | //场景
|
| | | if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 0)
|
| | | {
|
| | |
| | | cardContr.chidrenYaxis = listView.rowSpace / 2;
|
| | | //初始化卡片
|
| | | listView.AddChidren(cardContr);
|
| | | cardContr.InitControl(device);
|
| | | cardContr.InitControl(device, HdlRoomLogic.Current.NowCategoryRoom);
|
| | | //控件记录到缓存中
|
| | | this.dicDeviceRowControl[LocalDevice.Current.GetDeviceMainKeys(device)] = cardContr;
|
| | | //加缓存,然后发命令
|
| | |
| | | /// <param name="room"></param>
|
| | | private void RefreshSceneView(Room room)
|
| | | {
|
| | | //主人,管理员专用刷新控件
|
| | | VerticalListRefreshControl listview1 = null;
|
| | | //成员专用不能刷新的控件
|
| | | VerticalListControl listview2 = null;
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | {
|
| | | //主人,管理员专用刷新控件
|
| | | listview1 = new VerticalListRefreshControl();
|
| | | functionSceneBodyView.AddChidren(listview1);
|
| | | //下拉刷新
|
| | | listview1.BeginHeaderRefreshingAction += () =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //从网关刷新场景列表
|
| | | bool result = HdlSceneLogic.Current.RefreshSceneUIList();
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | listview1.EndHeaderRefreshing();
|
| | | if (result == true)
|
| | | {
|
| | | //在外面清空(特效的问题)
|
| | | this.functionSceneBodyView.RemoveAll();
|
| | | HdlThreadLogic.Current.RunMainInThread(() =>
|
| | | {
|
| | | //刷新场景分支控件
|
| | | this.RefreshSceneView(room);
|
| | | });
|
| | | }
|
| | | });
|
| | | });
|
| | | };
|
| | | }
|
| | | else
|
| | | {
|
| | | //成员专用不能刷新的控件
|
| | | listview2 = new VerticalListControl();
|
| | | functionSceneBodyView.AddChidren(listview2);
|
| | | }
|
| | |
|
| | | var listScene = new List<SceneUI>();
|
| | | foreach (var sceneId in room.ListSceneId)
|
| | | {
|
| | |
| | | }
|
| | | if (listScene.Count == 0)
|
| | | {
|
| | | //在滑动控件里面添加一个桌布
|
| | | var frameTable = new FrameLayout();
|
| | | listview1?.AddChidren(frameTable);
|
| | | listview2?.AddChidren(frameTable);
|
| | | //没有场景{0}请点击右上角添加
|
| | | string[] arryMsg = Language.StringByID(R.MyInternationalizationString.NoScene).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | this.ShowNotDataImage(functionSceneBodyView, arryMsg);
|
| | | this.ShowNotDataImage(frameTable, arryMsg);
|
| | | return;
|
| | | }
|
| | |
|
| | | var dicSceneContr = new Dictionary<int, SceneCategoryView>();
|
| | | //主人,管理员专用刷新控件
|
| | | VerticalListRefreshControl listview1 = null;
|
| | | //成员专用不能刷新的控件
|
| | | VerticalListControl listview2 = null;
|
| | | //if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | //{
|
| | | // listview1 = new VerticalListRefreshControl();
|
| | | // functionSceneBodyView.AddChidren(listview1);
|
| | | //}
|
| | | //else
|
| | | {
|
| | | listview2 = new VerticalListControl();
|
| | | functionSceneBodyView.AddChidren(listview2);
|
| | | } |
| | | |
| | | foreach (var scene in listScene)
|
| | | {
|
| | | //场景卡片控件
|