| | |
| | | using System; |
| | | using System.Collections.Generic;
|
| | | using Shared.Common; |
| | | using Shared.Phone.Device.Category; |
| | | using Shared.Phone.Device.CommonForm; |
| | | using Shared.Phone.UserCenter;
|
| | | using Shared.Phone.UserView; |
| | |
| | | public static ListRoomViewFrom Instance |
| | | { |
| | | get |
| | | { |
| | | {
|
| | | if (roomManagement == null)
|
| | | {
|
| | | //初始化左滑菜单
|
| | | roomManagement = new ListRoomViewFrom();
|
| | | CommonPage.Instance.AddLeftView(roomManagement);
|
| | | roomManagement.ShowForm();
|
| | | } |
| | | return roomManagement; |
| | | } |
| | | } |
| | |
| | | //初始化中部控件 |
| | | this.InitBodyFrameLayout(); |
| | | |
| | | //设置头部信息 |
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.RoomList)); |
| | | |
| | | //初始化中部信息 |
| | | this.InitMiddleFrame(); |
| | | } |
| | |
| | | private void InitTopFrame()
|
| | | {
|
| | | //初始化头部控件
|
| | | this.InitTopFrameLayout(); |
| | | this.InitTopFrameLayout();
|
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.RoomList)); |
| | | |
| | | //重置返回按键的事件 |
| | | var btnBack = this.GetBackButton(); |
| | | btnBack.ButtonClickEvent = null; |
| | |
| | | };
|
| | |
|
| | | //获取楼层
|
| | | if (this.curFloorId == string.Empty)
|
| | | {
|
| | | this.curFloorId = Config.Instance.Home.CurrentFloorId;
|
| | | }
|
| | | var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
|
| | | if (dicFloor.Count == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | this.curFloorId = Config.Instance.Home.CurrentFloorId;
|
| | | //楼层图标
|
| | | var btnIconContr = new MostRightIconControl(69, 69);
|
| | | btnIconContr.UnSelectedImagePath = "Item/Drop_Down.png";
|
| | |
| | | btnIconContr.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //楼层菜单
|
| | | var floors = new SelectFloor();
|
| | | var floors = new Category.SelectFloorForm();
|
| | | AddChidren(floors);
|
| | | floors.changeFloor = false;
|
| | | floors.CurFloorId = curFloorId;
|
| | |
| | | /// </summary>
|
| | | public void RefreshListRoom()
|
| | | {
|
| | | //把头部也一起初始化了
|
| | | this.topFrameLayout.RemoveAll();
|
| | | //初始化头部信息
|
| | | this.InitTopFrame();
|
| | |
|
| | | //先清空
|
| | | this.listView.frameTable.RemoveAll();
|
| | | this.listView.frameTable.Height = Application.GetRealHeight(100);
|
| | |
| | | listRoom.Insert(0, HdlRoomLogic.Current.GetLoveRoom());
|
| | |
|
| | | //X轴
|
| | | int XX = Application.GetRealWidth(43);
|
| | | int XX = this.GetPictrueRealSize(43);
|
| | | //Y轴
|
| | | int YY = Application.GetRealWidth(58);
|
| | | int YY = this.GetPictrueRealSize(58);
|
| | | //房间计数
|
| | | int roomCount = 0;
|
| | | foreach (var room in listRoom)
|
| | |
| | | //加缓存
|
| | | this.dicCardControl[room.Id] = contr;
|
| | | //每两个重置X轴
|
| | | XX = roomCount % 2 == 0 ? Application.GetRealWidth(43) : contr.Right + Application.GetRealWidth(3);
|
| | | XX = roomCount % 2 == 0 ? this.GetPictrueRealSize(43) : contr.Right + this.GetPictrueRealSize(3);
|
| | | //每两个累加Y轴
|
| | | if (roomCount >= 2 && roomCount % 2 == 0)
|
| | | {
|
| | | YY = contr.Bottom + Application.GetRealHeight(14);
|
| | | YY = contr.Bottom + this.GetPictrueRealSize(14);
|
| | | }
|
| | | contr.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | });
|
| | | };
|
| | | }
|
| | | //初始化未分配卡片
|
| | | this.InitRoomCardControl(XX, YY);
|
| | | //成员是没有未分配这个东西出来的
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | {
|
| | | //初始化未分配卡片
|
| | | this.InitRoomCardControl(XX, YY);
|
| | | }
|
| | | //调整桌布高度
|
| | | this.listView.AdjustTableHeight();
|
| | | }
|
| | |
| | | var frameBack = new FrameLayoutControl();
|
| | | frameBack.X = XX;
|
| | | frameBack.Y = YY;
|
| | | frameBack.Width = Application.GetRealWidth(495);
|
| | | frameBack.Height = Application.GetRealHeight(354);
|
| | | frameBack.Width = this.GetPictrueRealSize(495);
|
| | | frameBack.Height = this.GetPictrueRealSize(354);
|
| | | listView.frameTable.AddChidren(frameBack);
|
| | |
|
| | | //底部阴影效果
|
| | |
| | | frameBack.AddChidren(btnShadow, ChidrenBindMode.NotBind);
|
| | |
|
| | | //背景控件
|
| | | var picBackGroud = new NormalViewControl(467, 311, true);
|
| | | var picBackGroud = new NormalViewControl(this.GetPictrueRealSize(467), this.GetPictrueRealSize(311), false);
|
| | | picBackGroud.Gravity = Gravity.CenterHorizontal;
|
| | | picBackGroud.Radius = (uint)Application.GetRealHeight(29);
|
| | | picBackGroud.Radius = (uint)this.GetPictrueRealSize(29);
|
| | | picBackGroud.BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor3;
|
| | | frameBack.AddChidren(picBackGroud, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //未分配图标
|
| | | var btnIcon = new PicViewControl(92, 72);
|
| | | btnIcon.X = Application.GetRealWidth(129);
|
| | | btnIcon.Y = Application.GetRealHeight(141);
|
| | | btnIcon.X = this.GetPictrueRealSize(129);
|
| | | btnIcon.Y = this.GetPictrueRealSize(141);
|
| | | btnIcon.UnSelectedImagePath = "Room/NoNameRoom.png";
|
| | | frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //未分配
|
| | | var btnName = new NormalViewControl(141, 84, true);
|
| | | btnName.X = Application.GetRealWidth(244);
|
| | | btnName.Y = Application.GetRealHeight(131);
|
| | | btnName.X = this.GetPictrueRealSize(244);
|
| | | btnName.Y = this.GetPictrueRealSize(131);
|
| | | btnName.IsBold = true;
|
| | | btnName.TextColor = UserCenterColor.Current.White;
|
| | | btnName.TextID = R.MyInternationalizationString.Unallocated;
|