黄学彪
2020-04-29 b68cdc7e103a00d5df73e4b75603be8da1815b4a
ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs
@@ -1,7 +1,6 @@
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;
@@ -66,9 +65,6 @@
            //初始化中部控件
            this.InitBodyFrameLayout();
            //设置头部信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.RoomList));
            //初始化中部信息
            this.InitMiddleFrame();
        }
@@ -79,7 +75,11 @@
        private void InitTopFrame()
        {
            //初始化头部控件
            this.InitTopFrameLayout();
            this.InitTopFrameLayout();
            //设置头部信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.RoomList));
            //重置返回按键的事件
            var btnBack = this.GetBackButton();
            btnBack.ButtonClickEvent = null;
@@ -90,7 +90,10 @@
            };
            //获取楼层
            this.curFloorId = Config.Instance.Home.CurrentFloorId;
            if (this.curFloorId == string.Empty)
            {
                this.curFloorId = Config.Instance.Home.CurrentFloorId;
            }
            var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
            if (dicFloor.Count == 0)
            {
@@ -112,7 +115,7 @@
            btnIconContr.ButtonClickEvent += (sender, e) =>
            {
                //楼层菜单
                var floors = new SelectFloor();
                var floors = new Category.SelectFloorForm();
                AddChidren(floors);
                floors.changeFloor = false;
                floors.CurFloorId = curFloorId;
@@ -164,9 +167,9 @@
            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)
@@ -181,11 +184,11 @@
                //加缓存
                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) =>
                {
@@ -236,11 +239,11 @@
        private void InitRoomCardControl(int XX, int YY)
        {
            //桌布控件
            var frameBack = new FrameLayoutControl();
            var frameBack = new FrameLayoutStatuControl();
            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);
            //底部阴影效果
@@ -249,23 +252,23 @@
            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;