From 2ed75b8b337048e5d75e6d9ec8307633134f02fd Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 10 十月 2019 11:33:04 +0800 Subject: [PATCH] 个人中心添加楼层和创建房间,实装二级验证 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DialogInputFrameControl.cs | 120 +++++++++++++++++++++++++++-------------------------------- 1 files changed, 55 insertions(+), 65 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DialogInputFrameControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DialogInputFrameControl.cs index ddf2ab9..2e11d1d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DialogInputFrameControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DialogInputFrameControl.cs @@ -14,9 +14,9 @@ #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> - /// 涓婇儴鑿滃崟鏍囬鐨勯珮搴� + /// 鑿滃崟鏍囬鐨勯珮搴� /// </summary> - public int topMenuHeight = 190; + public int topTitleHeight = 63; /// <summary> /// 鎸夐挳鐨勯珮搴� /// </summary> @@ -24,19 +24,15 @@ /// <summary> /// 杈撳叆妗嗙殑瀹藉害 /// </summary> - public int InputControlWidth = 800; + public int InputControlWidth = 677; /// <summary> - /// 纭鎸夐挳浜嬩欢 + /// 纭鎸夐挳浜嬩欢(鐢盩ext鑾峰彇杈撳叆鍊�,None妯″紡闄ゅ) /// </summary> - public delegate void _ComfirmClickEvent(); - /// <summary> - /// 鐢婚潰鍏抽棴浜嬩欢(鐢盜nputText鑾峰彇杈撳叆鍊�,None妯″紡闄ゅ) - /// </summary> - public _ComfirmClickEvent ComfirmClickEvent; + public Action<string> ComfirmClickEvent; /// <summary> /// 杈撳叆妗嗙殑鏂囨湰淇℃伅 /// </summary> - public string InputText + public string Text { get { @@ -94,15 +90,14 @@ { mainFrame.AddChidren(this); //鍒濆鍖栨甯冩帶浠� - this.InitframeControl(this.dialogFrameMode); + this.InitframeControl(); } } /// <summary> /// 鍒濆鍖栨甯冩帶浠� /// </summary> - /// <param name="i_dialogFrameMode">绐椾綋妯″紡</param> - public void InitframeControl(DialogFrameMode i_dialogFrameMode) + public void InitframeControl() { if (this.frameLayout != null) { @@ -114,48 +109,42 @@ } //杩欐槸涓�涓 - //this.frameLayout = new SpecialFrameLayout(960, 620, buttonHeight); this.frameLayout = new FrameLayout(); - frameLayout.Height = Application.GetRealHeight(620); - frameLayout.Width = Application.GetRealWidth(960); + frameLayout.Height = Application.GetRealHeight(538); + frameLayout.Width = Application.GetRealWidth(792); frameLayout.Gravity = Gravity.Center; - frameLayout.Radius = 5; - frameLayout.BackgroundColor = UserCenterColor.Current.BodyFrameLayout; + frameLayout.Radius = 6; + frameLayout.BackgroundColor = UserCenterColor.Current.White; base.AddChidren(frameLayout); //鏍囬淇℃伅 - var btnTitle = new NormalViewControl(frameLayout.Width, Application.GetRealHeight(topMenuHeight), false); + var btnTitle = new NormalViewControl(frameLayout.Width, Application.GetRealHeight(topTitleHeight), false); + btnTitle.Y = Application.GetRealHeight(69); btnTitle.TextColor = UserCenterColor.Current.TextColor1; - btnTitle.TextSize = 22; - btnTitle.TextAlignment = TextAlignment.BottomCenter; + btnTitle.TextSize = 16; + btnTitle.TextAlignment = TextAlignment.Center; frameLayout.AddChidren(btnTitle); frameLayout.AddTag("btnTitle", btnTitle); //涓棿绌虹櫧鍖哄煙 - int midHeight = frameLayout.Height - Application.GetRealHeight(topMenuHeight + buttonHeight); - //this.frameMiddle = new SpecialFrameLayout(frameLayout.Width, midHeight, buttonHeight, false); + int midHeight = frameLayout.Height - Application.GetRealHeight(btnTitle.Bottom + buttonHeight); this.frameMiddle = new FrameLayout(); frameMiddle.Height = midHeight; frameMiddle.Width = frameLayout.Width; frameMiddle.Y = btnTitle.Bottom; - //frameMiddle.BackgroundColor = UserCenterColor.Current.BodyFrameLayout; frameLayout.AddChidren(frameMiddle); //鍙栨秷(鍥犱负鏈夊彲鑳借鎵╁ぇ涓儴楂樺害锛屾墍浠ュ厛澹版槑) - var btnCancel = new NormalClickButton(frameLayout.Width / 2 - 1, Application.GetRealHeight(buttonHeight)); - btnCancel.BackgroundColor = 0; + var btnCancel = new NormalClickButton(frameLayout.Width / 2, Application.GetRealHeight(buttonHeight)); + btnCancel.BackgroundColor = 0x66cccccc; + btnCancel.TextColor = UserCenterColor.Current.TextGrayColor1; btnCancel.TextID = R.MyInternationalizationString.uCancel; - btnCancel.TextSize = 18; frameLayout.AddTag("btnCancel", btnCancel); //纭(鍥犱负鏈夊彲鑳借鎵╁ぇ涓儴楂樺害锛屾墍浠ュ厛澹版槑) - var btnOk = new NormalClickButton(frameLayout.Width / 2 - 1, Application.GetRealHeight(buttonHeight)); - btnOk.BackgroundColor = 0; + var btnOk = new NormalClickButton(frameLayout.Width / 2, Application.GetRealHeight(buttonHeight)); btnOk.TextID = R.MyInternationalizationString.OkMsg; - btnOk.TextSize = 18; - btnOk.TextColor = UserCenterColor.Current.TextBlueColor; frameLayout.AddTag("btnOk", btnOk); - if (dialogFrameMode == DialogFrameMode.None) { return; @@ -182,8 +171,7 @@ var frameText = this.InitInputTextLine(); this.frameMiddle.AddChidren(frameText); //杈撳叆妗� - this.txtInput = this.InitInputControl(frameText); - //frameText.AddChidren(txtInput, HeightAutoMode.IncreaseAll); + this.txtInput = this.InitInputControl(); frameText.AddChidren(txtInput); } @@ -195,12 +183,10 @@ //鍒濆鍖栬竟妗� var frameText = this.InitInputTextLine(); this.frameMiddle.AddChidren(frameText); - frameText.Radius = 8; //杈撳叆妗� - this.txtInput = this.InitInputControl(frameText); + this.txtInput = this.InitInputControl(); this.txtInput.SecureTextEntry = true; - //frameText.AddChidren(txtInput, HeightAutoMode.IncreaseAll); frameText.AddChidren(txtInput); } @@ -212,12 +198,10 @@ //鍒濆鍖栬竟妗� var frameText = this.InitInputTextLine(); this.frameMiddle.AddChidren(frameText); - frameText.Radius = 8; //杈撳叆妗� - this.txtInput = this.InitInputControl(frameText); + this.txtInput = this.InitInputControl(); this.txtInput.SecureTextEntry = true; - //frameText.AddChidren(txtInput, HeightAutoMode.IncreaseAll); frameText.AddChidren(txtInput); this.txtInput.Gravity = Gravity.Frame; @@ -234,12 +218,12 @@ /// </summary> public FrameLayout InitInputTextLine() { - //var frameText = new SpecialFrameLayout(this.InputControlWidth, 110, 20); var frameText = new FrameLayout(); frameText.Width = Application.GetRealWidth(this.InputControlWidth); - frameText.Height = Application.GetRealHeight(110); - frameText.Gravity = Gravity.Center; - frameText.BorderColor = UserCenterColor.Current.TextFrameColor; + frameText.Height = Application.GetRealHeight(100); + frameText.Y = Application.GetRealHeight(81); + frameText.Gravity = Gravity.CenterHorizontal; + frameText.BorderColor = 0xff676767; frameText.BorderWidth = 1; frameText.Radius = 8; @@ -249,11 +233,9 @@ /// <summary> /// 鍒濆鍖栬緭鍏ユ鎺т欢 /// </summary> - /// <param name="frameLine"></param> - public TextInputControl InitInputControl(FrameLayout frameLine) + public TextInputControl InitInputControl() { - var txtText = new TextInputControl(Application.CurrentWidth); - txtText.InitSize(frameLine.Width - Application.GetRealHeight(10), ControlCommonResourse.NormalControlHeight, false); + var txtText = new TextInputControl(this.InputControlWidth - 20, 69, true); txtText.TextAlignment = TextAlignment.Center; txtText.Gravity = Gravity.Center; @@ -314,32 +296,39 @@ this.RemoveFromParent(); return; } - this.ComfirmClickEvent(); + this.ComfirmClickEvent(this.Text); }; - - //鐏扮嚎 - var btnLine1 = new NormalViewControl(1, Application.GetRealHeight(buttonHeight), false); - btnLine1.X = btnCancel.Right; - btnLine1.Y = btnCancel.Y; - btnLine1.BackgroundColor = UserCenterColor.Current.Line; - frameLayout.AddChidren(btnLine1); - - //鐏扮嚎 - var btnLine2 = new NormalViewControl(frameLayout.Width, 1, false); - btnLine2.Y = btnOk.Y - 1; - btnLine2.BackgroundColor = UserCenterColor.Current.Line; - frameLayout.AddChidren(btnLine2); } /// <summary> /// 娣诲姞瀛愭帶浠� /// </summary> /// <param name="view"></param> - /// <param name="heightAutoMode">楂樺害鍙樻洿妯″紡</param> - public void AddChidren(View view, HeightAutoMode heightAutoMode = HeightAutoMode.None) + /// <param name="heightAutoMode">楂樺害鍙樻洿妯″紡(闈濶one鐨勬椂鍊欓兘鍚屼竴鑷姩璋冩暣)</param> + /// <param name="bottomSpace">涓棿绌虹櫧鍖哄煙閲岄潰鏈�搴曢儴鐨勬帶浠朵笌搴曢儴鎸夐挳鐨勯棿璺�(闈炵湡瀹炲��)</param> + public void AddChidren(View view, HeightAutoMode heightAutoMode = HeightAutoMode.None, int bottomSpace = 0) { - //this.frameMiddle.AddChidren(view, heightAutoMode); this.frameMiddle.AddChidren(view); + if (heightAutoMode != HeightAutoMode.None) + { + //鑾峰彇鏈�搴曢儴鎺т欢鐨勫潗鏍� + int realHeight = 0; + for (int i = 0; i < this.frameMiddle.ChildrenCount; i++) + { + var myView = this.frameMiddle.GetChildren(i); + if (myView.Bottom > realHeight) + { + realHeight = myView.Bottom; + } + } + int value = realHeight + Application.GetRealHeight(bottomSpace) - this.frameMiddle.Height; + if (value > 0) + { + //搴曢儴鎺т欢宸茬粡瓒呭嚭浜嗙洰鍓嶇殑楂樺害,鍒欐墿澶ф帶浠� + this.frameMiddle.Height += value; + this.frameLayout.Height += value; + } + } } /// <summary> @@ -347,6 +336,7 @@ /// </summary> public void CloseDialog() { + this.ComfirmClickEvent = null; this.RemoveFromParent(); } -- Gitblit v1.8.0