From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期一, 14 十二月 2020 09:59:01 +0800 Subject: [PATCH] 请合并代码,完成晾衣架最终功能。 --- ZigbeeApp/Shared/Phone/UserCenter/Residence/SelectLocalRoomImageForm.cs | 121 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 121 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/SelectLocalRoomImageForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/SelectLocalRoomImageForm.cs new file mode 100755 index 0000000..1e55dcd --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/SelectLocalRoomImageForm.cs @@ -0,0 +1,121 @@ +锘縰sing System; +using Shared.Common; +using Shared.Phone.UserCenter; + +namespace Shared.Phone.UserCenter.Residence +{ + /// <summary> + /// 閫夋嫨鏈湴鎴块棿鍥剧墖鐨勭晫闈� + /// </summary> + public class SelectLocalRoomImageForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 缁撴潫閫夋嫨鐨勪簨浠�(鍥剧墖鍚嶅瓧) + /// </summary> + public Action<string> FinishSelectEvent = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText(Language.StringByID(R.MyInternationalizationString.LocalPicture)); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + //鍒楄〃鎺т欢 + var listView = new VerticalListControl(); + listView.Height = bodyFrameLayout.Height; + bodyFrameLayout.AddChidren(listView); + + int picHeight = this.GetPictrueRealSize(311); + int picWidth = this.GetPictrueRealSize(467); + int leftRightSpace = this.GetPictrueRealSize(58); + int space = listView.Width - leftRightSpace * 2 - picWidth * 2; + + //涓�鍏�14寮犲浘鐗� + FrameLayout frameRow = null; + for (int i = 0; i < 22; i++) + { + //鍥剧墖 + var btnIcon = new ImageView(); + + if (i % 2 == 0) + { + btnIcon.X = leftRightSpace; + + //琛屾帶浠� + frameRow = new FrameLayout(); + frameRow.Height = picHeight + Application.GetRealHeight(58); + listView.AddChidren(frameRow); + } + else + { + btnIcon.X = leftRightSpace + picWidth + space; + } + + btnIcon.Y = Application.GetRealHeight(58); + btnIcon.Width = picWidth; + btnIcon.Height = picHeight; + btnIcon.ImagePath = $"RoomIcon/{i}.jpg"; + btnIcon.Radius = (uint)Application.GetRealHeight(17); + frameRow.AddChidren(btnIcon); + + //鍥剧墖閬僵 + var btnZhezhao = new FrameLayout(); + btnZhezhao.Width = btnIcon.Width; + btnZhezhao.Height = btnIcon.Height; + btnZhezhao.Y = btnIcon.Y; + btnZhezhao.X = btnIcon.X; + btnZhezhao.Radius = (uint)Application.GetRealHeight(17); + btnZhezhao.BackgroundColor = UserCenterColor.Current.PictrueZhezhaoColor; + frameRow.AddChidren(btnZhezhao); + btnZhezhao.MouseUpEventHandler += (sender, e) => + { + //缁撴潫閫夋嫨鐨勪簨浠� + this.FinishSelectEvent?.Invoke(btnIcon.ImagePath); + this.CloseForm(); + }; + + } + + //搴曢儴闂磋窛 + var frameTemp = new FrameLayout(); + frameTemp.Height = Application.GetRealHeight(58); + listView.AddChidren(frameTemp); + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + this.FinishSelectEvent = null; + + base.CloseFormBefore(); + } + + #endregion + } +} -- Gitblit v1.8.0