From 4ce5177289b1d34e467de9d8790836559cc5a09e Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 18 十一月 2019 18:06:28 +0800 Subject: [PATCH] 合并了全部的代码 --- ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs | 54 ++++++++++++++++++++++++++---------------------------- 1 files changed, 26 insertions(+), 28 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs b/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs index 39cc2e4..70ab99a 100755 --- a/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs +++ b/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs @@ -50,40 +50,38 @@ }; this.AddChidren(midFl); - for (int i = 0; i < 25; i++) + + int k = 1; + for (int j = 0; j < 2; j++) { - var RoomRowView = new FrameLayout() + var itemView = new FrameLayout() { - Height = Application.GetRealHeight(600), - Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonPage.XLeft * 2), - Gravity=Gravity.CenterHorizontal, - BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, - Radius = CommonPage.BigFormRadius, + Height = Application.GetRealHeight(311 + CommonPage.XLeft) }; - midFl.AddChidren(RoomRowView); - - var backGroundBtn = new Button() + midFl.AddChidren(itemView); + for (int i = 0; i < 2; i++) { - Y = Application.GetRealHeight(50), - Width = Application.GetMinRealAverage(CommonPage.AppRealWidth - CommonPage.XLeft * 2), - Height = Application.GetMinRealAverage(550), - UnSelectedImagePath = "Room/r" + (i).ToString() + ".png", - Radius = CommonPage.BigFormRadius, - Gravity=Gravity.CenterHorizontal - }; - RoomRowView.AddChidren(backGroundBtn); - - backGroundBtn.MouseUpEventHandler += (sender, e) => - { - if (AddRoom.room.BackgroundImageType == 1 || AddRoom.room.BackgroundImageType == 2) + var icon = new Button() { - AddRoom.OldBackgroundImagePath = AddRoom.room.BackgroundImage; - } - //AddRoom.room.BackgroundImage = backGroundBtn.UnSelectedImagePath; - action?.Invoke(backGroundBtn.UnSelectedImagePath); - this.RemoveFromParent(); - }; + X = Application.GetRealWidth(CommonPage.XLeft + i * (467 + 32)), + Width = Application.GetMinRealAverage(467), + Height = Application.GetMinRealAverage(311), + Gravity = Gravity.CenterVertical, + UnSelectedImagePath = $"RoomIcon/{k}.JPG", + }; + itemView.AddChidren(icon); + k++; + + EventHandler<MouseEventArgs> selectIcon = (sender, e) => + { + action?.Invoke(icon.UnSelectedImagePath); + action = null; + this.RemoveFromParent(); + }; + icon.MouseUpEventHandler += selectIcon; + } } + #endregion } } -- Gitblit v1.8.0