From 0bf9e65bc3ba98391e7835c922b15baab3c77876 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 01 六月 2020 14:59:39 +0800 Subject: [PATCH] 上传一个合并的版本 --- ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 100 insertions(+), 4 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs index 36dee6e..3b4222c 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/NewGateWayMenuSelectForm.cs @@ -5,7 +5,22 @@ /// 娣诲姞缃戝叧鐨勯�夋嫨鐢婚潰 /// </summary> public class NewGateWayMenuSelectForm : EditorCommonForm - { + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鏄惁鏄剧ず鎻愮ず璁剧疆浣忓畢鍦扮悊浣嶇疆 + /// </summary> + private bool showSettion = true; + /// <summary> + /// 鎻愮ず鐨凢rameLayout + /// </summary> + private FrameLayout frameTip = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + /// <summary> /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) /// </summary> @@ -27,7 +42,7 @@ this.ClearBodyFrame(); var listView = new VerticalListControl(29); - listView.Height = Application.GetRealHeight(340); + listView.Height = bodyFrameLayout.Height; listView.BackgroundColor = UserCenterColor.Current.White; bodyFrameLayout.AddChidren(listView); @@ -59,6 +74,7 @@ var btntext2 = row2.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uWirelessGateway), 500); btntext2.TextSize = 15; row2.AddRightArrow(); + row2.AddBottomLine(); row2.ButtonClickEvent += (sender, e) => { //妫�娴嬩綇瀹呯粡绾害 @@ -81,14 +97,70 @@ form.AddForm(); }); }; - } + //Mini缃戝叧 + var row3 = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(row3); + var btnIcon3 = row3.AddLeftIcon(81); + btnIcon3.UnSelectedImagePath = "Gateway/MiniGateway.png"; + var btntext3 = row3.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uMiniGateway), 500); + btntext3.TextSize = 15; + row3.AddRightArrow(); + row3.ButtonClickEvent += (sender, e) => + { + //妫�娴嬩綇瀹呯粡绾害 + if (this.CheckResidencePoint() == false) + { + return; + } + var form = new MiniGatewayDirection1Form(); + form.AddForm(); + }; + listView.AdjustRealHeight(Application.GetRealHeight(23)); + + //濡傛灉杩樻病鏈夎缃湴鐞嗕綅缃� + if (Common.Config.Instance.Home.Latitude == 0 && Common.Config.Instance.Home.Longitude == 0) + { + this.frameTip = new FrameLayout(); + frameTip.X = Application.GetRealWidth(179); + frameTip.Y = Application.GetRealHeight(1426); + frameTip.Height = Application.GetRealHeight(100); + frameTip.Width = Application.GetRealWidth(714); + bodyFrameLayout.AddChidren(frameTip); + + var btnIcon = new IconViewControl(58); + btnIcon.UnSelectedImagePath = "Item/Tips.png"; + frameTip.AddChidren(btnIcon); + + //濡傛灉涓嶈缃綇瀹呯殑鍦扮悊浣嶇疆,鍒欎細褰卞搷鑷姩鍖栧湴鐞嗗洿鏍忓姛鑳界殑璁剧疆 + var btnTip = new NormalViewControl(Application.GetRealWidth(636), Application.GetRealHeight(100), false); + btnTip.X = btnIcon.Right + Application.GetRealWidth(20); + btnTip.TextAlignment = TextAlignment.Center; + btnTip.TextColor = UserCenterColor.Current.TextGrayColor1; + btnTip.TextSize = 12; + btnTip.IsMoreLines = true; + btnTip.Text = Language.StringByID(R.MyInternationalizationString.uNotSetLocationWillAffectTheAutomaticGeofencingFunction); + frameTip.AddChidren(btnTip); + } + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + /// <summary> /// 妫�娴嬩綇瀹呯粡绾害 /// </summary> /// <returns></returns> private bool CheckResidencePoint() { + //鍙脊涓�娆� + if (this.showSettion == false) + { + return true; + } + this.showSettion = false; + if (Common.Config.Instance.Home.Latitude == 0 && Common.Config.Instance.Home.Longitude == 0) { //璇峰墠寰�浣忓畢绠$悊{0}璁剧疆浣忓畢鐨勫湴鐞嗕綅缃� @@ -102,6 +174,30 @@ return false; } return true; - } + } + + #endregion + + #region 鈻� 鐣岄潰閲嶆柊婵�娲讳簨浠禵__________________ + + /// <summary> + /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠� + /// </summary> + public override int FormActionAgainEvent() + { + if (frameTip == null) + { + return 0; + } + if (Common.Config.Instance.Home.Latitude != 0 || Common.Config.Instance.Home.Longitude != 0) + { + //绉婚櫎鎺夋彁绀� + frameTip.RemoveFromParent(); + return 1; + } + return 1; + } + + #endregion } } -- Gitblit v1.8.0