From 8b4d79ca03495e522a1953e04ca17527f33c853a Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 28 十月 2019 13:22:17 +0800 Subject: [PATCH] 合并完成代码 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 165 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 132 insertions(+), 33 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs index be6c3a1..4e81bfb 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs @@ -17,11 +17,6 @@ /// <param name="common">Common.</param> public void Changed(CommonDevice common) { - //if (common.Type != ZigBee.Device.DeviceType.OnOffSwitch) - //{ - // return; - //} - Shared.Application.RunOnMainThread(() => { //var dev = common as Panel; @@ -57,37 +52,44 @@ { RemoveFromParent(); }; + this.btnTitle.Width = Application.GetRealWidth(1080 - 161 - 200 - 58); this.btnBack.MouseUpEventHandler += eHandlerBack; this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; this.MidFrameLayout(this); var btnAddFrameLayout = new FrameLayout { - X = Application.GetRealWidth(953), - Height = Application.GetRealHeight(72), - Width = Application.GetRealWidth(72), + X = Application.GetRealWidth(830), + Width = Application.GetRealWidth(0),//200 + BackgroundColor = 0xff00ff00, }; this.titleFrameLayout.AddChidren(btnAddFrameLayout); var btnFloorText = new Button { - Height = Application.GetRealHeight(84), - Width = Application.GetRealWidth(58), - X = Application.GetRealWidth(881), - Text = "涓�妤�", + Width = Application.GetRealWidth(110), + X = Application.GetRealWidth(15), + Text = Language.StringByID(R.MyInternationalizationString.FirstFloor), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, + TextSize = 15, + TextAlignment = TextAlignment.CenterRight, + BackgroundColor = 0xffff0000, }; btnAddFrameLayout.AddChidren(btnFloorText); var btnBindDown = new Button { - Height = Application.GetRealHeight(72), - Width = Application.GetRealWidth(72), - //UnSelectedImagePath = "BindPic/BindDown.png", + Height = Application.GetRealHeight(69), + Width = Application.GetRealWidth(69), + X = Application.GetRealWidth(200 - 69), + UnSelectedImagePath = "BindPic/BindDown.png", + Gravity = Gravity.CenterVertical, + BackgroundColor = 0xff0000ff, }; btnAddFrameLayout.AddChidren(btnBindDown); btnBindDown.MouseDownEventHandler += (sender, e) => { + SideslipFramelayout(); }; MidFrameLayoutContent(); } @@ -105,14 +107,6 @@ { }; btnMidTopLayout.AddChidren(btnHorizontalScrolViewLayout); - - //var btnLine = new Button - //{ - // Y = btnMidTopLayout.Bottom, - // Height = 1, - // BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTitleLine, - //}; - //this.midFrameLayout.AddChidren(btnLine); midVerticalScrolViewLayout = new VerticalScrolViewLayout() { @@ -320,11 +314,7 @@ #endregion } - /// <summary> - /// 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀� - /// </summary> - /// <param name="gateway">Gateway.</param> - /// <param name="key">Key.</param> + // 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀� void RefreshRoomList(Shared.Common.Room curRoom, Button btnFinish, ref int index2) { Button curentOldRoom = null; @@ -333,6 +323,11 @@ for (int i = 0; i < roomList.Count; i++) { var room = roomList[i]; + if (room.IsLove == true) + { + //; + } + var btnRoomFrameLayout = new FrameLayout { Height = Application.GetRealHeight(78), @@ -355,6 +350,8 @@ TextSize = 12, TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, Gravity = Gravity.Center, + //SelectedImagePath = "BindPic/BindRoomColorOn.png", + //UnSelectedImagePath = "BindPic/BindRoomColor.png", }; btnRoomFrameLayout.AddChidren(btnRoom); @@ -373,6 +370,7 @@ else { btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; + btnRoom.IsSelected = false; btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout; btnRoomFrameLayout.BorderWidth = 1; } @@ -462,11 +460,7 @@ } } - /// <summary> - /// 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀� - /// </summary> - /// <param name="gateway">Gateway.</param> - /// <param name="key">Key.</param> + //鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀� void RefreshSceneList(Shared.Common.Room curRoom) { midVerticalScrolViewLayout.RemoveAll(); @@ -591,6 +585,111 @@ } } + // 渚ц竟瀵艰埅鏍� + void SideslipFramelayout() + { + var dialog = new Dialog + { + }; + dialog.Show(); + + var flMain = new FrameLayout { BackgroundColor = 0x00000000 }; + dialog.AddChidren(flMain); + flMain.MouseUpEventHandler += (sender11, e11) => + { + dialog.Close(); + }; + + var sidelipFrameLayout = new FrameLayout() + { + Height = Application.GetRealHeight(783), + Width = Application.GetRealWidth(449), + Y = Application.GetRealHeight(161), + X = Application.GetRealWidth(596), + BackgroundImagePath = "DoorLock/SideslipPic.png", + }; + flMain.AddChidren(sidelipFrameLayout); + + var btnSelectFloor = new Button() + { + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(58), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + TextID = R.MyInternationalizationString.SelectFloor, + }; + sidelipFrameLayout.AddChidren(btnSelectFloor); + + var sidelipVerticalScrolViewLayout = new VerticalScrolViewLayout() + { + Height = Application.GetRealHeight(600), + Y = Application.GetRealHeight(173), + }; + sidelipFrameLayout.AddChidren(sidelipVerticalScrolViewLayout); + + //鑾峰彇妤煎眰 + var dicFloor = Common.Room.CurrentRoom.GetFloorSortList(); + + Button oldbutton = null; + Button oldbuttonText = null; + foreach (var floorId in dicFloor.Keys) + { + var rowFrameLayout = new RowLayout() + { + Height = Application.GetRealHeight(150), + }; + sidelipVerticalScrolViewLayout.AddChidren(rowFrameLayout); + + var btnAllMethod = new Button() + { + Width = Application.GetRealWidth(81), + Height = Application.GetRealHeight(81), + X = Application.GetRealWidth(81), + Y = Application.GetRealHeight(55), + }; + rowFrameLayout.AddChidren(btnAllMethod); + + var btnMethodText = new Button() + { + Width = Application.GetRealWidth(311), + Height = Application.GetRealHeight(58), + X = Application.GetRealWidth(173), + Y = Application.GetRealHeight(69), + TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + Text = dicFloor[floorId], + }; + rowFrameLayout.AddChidren(btnMethodText); + + EventHandler<MouseEventArgs> hander = (sender, e) => + { + if (!btnMethodText.IsSelected) + { + if (oldbutton != null) + { + oldbutton.IsSelected = false; + } + if (oldbuttonText != null) + { + oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; + } + oldbutton = btnMethodText; + oldbuttonText = btnMethodText; + btnMethodText.IsSelected = true; + oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; + } + dialog.Close(); + }; + btnAllMethod.MouseUpEventHandler += hander; + rowFrameLayout.MouseUpEventHandler += hander; + btnMethodText.MouseUpEventHandler += hander; + } + } + public void DeviceInfoChange(CommonDevice common, string typeTag) { } -- Gitblit v1.8.0