黄学彪
2020-04-08 4dce704aaf8587cf3f91cf88f2208315a03c4cbb
ZigbeeApp/Shared/Phone/UserCenter/Guide/GuideCommonForm.cs
@@ -62,15 +62,44 @@
            btnHouse.TextID = R.MyInternationalizationString.uMyResidence;
            this.AddChidren(btnHouse);
            //左右滑动控件的背景容器
            var frameBack = new FrameLayout();
            frameBack.Y = Application.GetRealHeight(302);
            frameBack.Width = this.Width; ;
            frameBack.Height = Application.GetRealHeight(478);
            this.AddChidren(frameBack);
            //房间滑动控件左边的虚拟图片
            var mLeftImageView = new ImageView();
            mLeftImageView.ImagePath = "RoomIcon/1.jpg";
            mLeftImageView.Radius = (uint)Application.GetRealHeight(17);
            mLeftImageView.Width = Application.GetRealWidth(717);
            mLeftImageView.Height = Application.GetRealHeight(478);
            //房间滑动控件右边的虚拟图片
            var mRightImageView = new ImageView();
            mRightImageView.ImagePath = "RoomIcon/2.jpg";
            mRightImageView.Radius = (uint)Application.GetRealHeight(17);
            mRightImageView.Width = mLeftImageView.Width;
            mRightImageView.Height = mLeftImageView.Height;
            //左右滑动的房间
            var roomPageView = new HorizontalPages();
            roomPageView.Y = Application.GetRealHeight(302);
            roomPageView.Height = Application.GetRealHeight(478);
            this.AddChidren(roomPageView);
            roomPageView.Width = frameBack.Width;
            roomPageView.Height = frameBack.Height;
            frameBack.AddChidren(roomPageView);
            //突出边距
            roomPageView.TCBJ = Application.GetRealWidth(124);
            //两个page之间的间距
            roomPageView.JMBJ = Application.GetRealWidth(58);
            //在这个控件的下面添加阴影效果
            var btnRoomBottomShadow = new NormalViewControl(717, 81, true);
            btnRoomBottomShadow.Y = frameBack.Bottom;
            btnRoomBottomShadow.Gravity = Gravity.CenterHorizontal;
            btnRoomBottomShadow.UnSelectedImagePath = "Room/RoomCardShadow.png";
            this.AddChidren(btnRoomBottomShadow);
            //设置控制最左和最右2边填充的假背景View,不设置不显示,需要在AddChidren 前调用该方法
            roomPageView.SetLeftAndRightImageView(mLeftImageView, mRightImageView);
            //客厅
            var room1 = new Common.Room();
@@ -79,6 +108,7 @@
            var roomView1 = new Phone.Device.CommonForm.RoomView(0, 0);
            roomPageView.AddChidren(roomView1);
            roomView1.Init(room1);
            roomView1.HideName(false);
            //阳台
            var room2 = new Common.Room();
            room2.BackgroundImage = "RoomIcon/1.jpg";
@@ -86,6 +116,7 @@
            var roomView2 = new Phone.Device.CommonForm.RoomView(0, 0);
            roomPageView.AddChidren(roomView2);
            roomView2.Init(room2);
            roomView2.HideName(true);
            //卧室
            var room3 = new Common.Room();
            room3.BackgroundImage = "RoomIcon/2.jpg";
@@ -93,12 +124,63 @@
            var roomView3 = new Phone.Device.CommonForm.RoomView(0, 0);
            roomPageView.AddChidren(roomView3);
            roomView3.Init(room3);
            roomView3.HideName(true);
            roomPageView.PageIndex = 1;
            //在房间卡片左边添加遮罩
            var btnRoomLeftShadow = new FrameLayout();
            btnRoomLeftShadow.Width = Application.GetRealWidth(124);
            btnRoomLeftShadow.Height = roomPageView.Height - roomPageView.JMBJ * 2;
            btnRoomLeftShadow.Gravity = Gravity.CenterVertical;
            btnRoomLeftShadow.BackgroundColor = 0x1c000000;
            btnRoomLeftShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopRight | HDLUtils.RectCornerBottomRight);
            frameBack.AddChidren(btnRoomLeftShadow);
            //在房间卡片右边添加遮罩
            var btnRoomRightShadow = new FrameLayout();
            btnRoomRightShadow.Width = btnRoomLeftShadow.Width;
            btnRoomRightShadow.Height = btnRoomLeftShadow.Height;
            btnRoomRightShadow.X = Application.GetRealWidth(956);
            btnRoomRightShadow.Gravity = Gravity.CenterVertical;
            btnRoomRightShadow.BackgroundColor = btnRoomLeftShadow.BackgroundColor;
            btnRoomRightShadow.SetCornerWithSameRadius(Application.GetRealHeight(12), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft);
            frameBack.AddChidren(btnRoomRightShadow);
            //控件开始滑动的事件
            roomPageView.StartScrollAction += () =>
            {
                //开始滑动时,隐藏当前的数据显示
                (roomPageView.GetChildren(roomPageView.PageIndex) as Phone.Device.CommonForm.RoomView).HideName(true);
                btnRoomLeftShadow.Visible = false;
                btnRoomRightShadow.Visible = false;
                btnRoomBottomShadow.Visible = false;
            };
            roomPageView.EndScrollAction += () =>
            {
                int curIndex = roomPageView.PageIndex;
                //前一张卡片
                if (roomPageView.GetChildren(curIndex - 1) != null)
                {
                    (roomPageView.GetChildren(curIndex - 1) as Phone.Device.CommonForm.RoomView).HideName(true);
                }
                //当前卡片
                if (roomPageView.GetChildren(curIndex) != null)
                {
                    (roomPageView.GetChildren(curIndex) as Phone.Device.CommonForm.RoomView).HideName(false);
                }
                //下一张卡片
                if (roomPageView.GetChildren(curIndex + 1) != null)
                {
                    (roomPageView.GetChildren(curIndex + 1) as Phone.Device.CommonForm.RoomView).HideName(true);
                }
                btnRoomLeftShadow.Visible = true;
                btnRoomRightShadow.Visible = true;
                btnRoomBottomShadow.Visible = true;
            };
            roomPageView.PageIndex = 0;
            //场景和功能的控件
            this.contrSwitch = new FrameLayout();
            contrSwitch.Y = roomPageView.Bottom + Application.GetRealHeight(52);
            contrSwitch.Y = frameBack.Bottom + Application.GetRealHeight(52);
            contrSwitch.Gravity = Gravity.CenterHorizontal;
            contrSwitch.Width = Application.GetRealWidth(804);
            contrSwitch.Height = Application.GetRealHeight(124);
@@ -125,29 +207,29 @@
            contrSwitch.AddChidren(btnFunction);
            //自定义场景1
            var sceneView1 = new Phone.Device.CommonForm.SceneMainView(0, 0);
            var sceneView1 = new MainPage.Controls.SceneCardControl();
            sceneView1.X = Application.GetRealWidth(46);
            sceneView1.Y = roomPageView.Bottom + Application.GetRealHeight(233);
            sceneView1.Y = frameBack.Bottom + Application.GetRealHeight(233);
            this.AddChidren(sceneView1);
            sceneView1.Init(new Common.SceneUI() { Name = "Getup", IconPath = "SceneIcon/0.png" });
            sceneView1.InitControl(new Common.SceneUI() { Name = "Getup", IconPath = "SceneIcon/0.png" });
            //自定义场景2
            var sceneView2 = new Phone.Device.CommonForm.SceneMainView(0, 0);
            var sceneView2 = new MainPage.Controls.SceneCardControl();
            sceneView2.X = Application.GetRealWidth(553);
            sceneView2.Y = sceneView1.Y;
            this.AddChidren(sceneView2);
            sceneView2.Init(new Common.SceneUI() { Name = "Relax", IconPath = "SceneIcon/1.png" });
            sceneView2.InitControl(new Common.SceneUI() { Name = "Relax", IconPath = "SceneIcon/1.png" });
            //自定义场景3
            var sceneView3 = new Phone.Device.CommonForm.SceneMainView(0, 0);
            var sceneView3 = new MainPage.Controls.SceneCardControl();
            sceneView3.X = sceneView1.X;
            sceneView3.Y = sceneView1.Bottom + Application.GetRealHeight(14);
            this.AddChidren(sceneView3);
            sceneView3.Init(new Common.SceneUI() { Name = "Dinner", IconPath = "SceneIcon/2.png" });
            sceneView3.InitControl(new Common.SceneUI() { Name = "Dinner", IconPath = "SceneIcon/2.png" });
            //自定义场景4
            var sceneView4 = new Phone.Device.CommonForm.SceneMainView(0, 0);
            var sceneView4 = new MainPage.Controls.SceneCardControl();
            sceneView4.X = sceneView2.X;
            sceneView4.Y = sceneView3.Y;
            this.AddChidren(sceneView4);
            sceneView4.Init(new Common.SceneUI() { Name = "Goodnight", IconPath = "SceneIcon/3.png" });
            sceneView4.InitControl(new Common.SceneUI() { Name = "Goodnight", IconPath = "SceneIcon/3.png" });
            //底部菜单
            var frameMenu = new FrameLayout();