黄学彪
2019-11-28 3a26f6025130dcaae4aa82ea19b16ad902450eb8
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/TextInputControls/DialogInputControl.cs
@@ -36,11 +36,11 @@
        /// <summary>
        /// 取消按钮
        /// </summary>
        private NormalViewControl btnCancel = null;
        private BottomLeftClickButton btnCancel = null;
        /// <summary>
        /// 确认按钮
        /// </summary>
        private NormalViewControl btnConfirm = null;
        private BottomRightClickButton btnConfirm = null;
        #endregion
@@ -95,79 +95,20 @@
            frameText.AddChidren(txtInput);
            //取消
            var frameCancel = new FrameLayoutControl();
            frameCancel.Height = Application.GetRealHeight(127);
            frameCancel.Width = Application.GetRealWidth(396);
            frameCancel.Gravity = Gravity.BottomLeft;
            frameCancel.Radius = 8;
            frameCancel.BackgroundColor = 0xfff5f6fa;
            frameBack.AddChidren(frameCancel);
            //把上圆角覆盖为方角
            var btnTopTemp1 = new NormalViewControl(frameCancel.Width, Application.GetRealHeight(40), false);
            btnTopTemp1.BackgroundColor = 0xfff5f6fa;
            frameCancel.AddChidren(btnTopTemp1, ChidrenBindMode.BindEventOnly);
            //把右下圆角覆盖为方角
            var btnBomTemp1 = new NormalViewControl(frameCancel.Width / 2, Application.GetRealHeight(40), false);
            btnBomTemp1.BackgroundColor = 0xfff5f6fa;
            btnBomTemp1.Gravity = Gravity.BottomRight;
            frameCancel.AddChidren(btnBomTemp1, ChidrenBindMode.BindEventOnly);
            //取消按钮
            this.btnCancel = new NormalViewControl(frameCancel.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
            btnCancel.Gravity = Gravity.Center;
            btnCancel.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnCancel.TextID = R.MyInternationalizationString.uCancel;
            btnCancel.TextAlignment = TextAlignment.Center;
            btnCancel.BackgroundColor = 0xfff5f6fa;
            frameCancel.AddChidren(btnCancel, ChidrenBindMode.BindEventOnly);
            frameCancel.ButtonClickEvent += (sender, e) =>
            this.btnCancel = new BottomLeftClickButton(Application.GetRealWidth(396), Application.GetRealHeight(127));
            frameBack.AddChidren(btnCancel);
            btnCancel.InitControl(Language.StringByID(R.MyInternationalizationString.uCancel));
            btnCancel.ButtonClickEvent += (sender, e) =>
            {
                //移除界面
                this.CloseDialog();
            };
            //重写控件点击状态
            frameCancel.SelectStatuEvent += (statu) =>
            {
                if (statu == true)
                {
                    frameCancel.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
                    btnTopTemp1.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
                    btnBomTemp1.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
                    btnCancel.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
                }
                else
                {
                    frameCancel.BackgroundColor = 0xfff5f6fa;
                    btnTopTemp1.BackgroundColor = 0xfff5f6fa;
                    btnBomTemp1.BackgroundColor = 0xfff5f6fa;
                    btnCancel.BackgroundColor = 0xfff5f6fa;
                }
            };
            //确认
            var frameConfirm = new FrameLayoutControl();
            frameConfirm.Height = Application.GetRealHeight(127);
            frameConfirm.Width = Application.GetRealWidth(396);
            frameConfirm.Gravity = Gravity.BottomRight;
            frameConfirm.Radius = 8;
            frameConfirm.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
            frameBack.AddChidren(frameConfirm);
            //把上圆角覆盖为方角
            var btnTopTemp2 = new NormalViewControl(frameConfirm.Width, Application.GetRealHeight(40), false);
            btnTopTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
            frameConfirm.AddChidren(btnTopTemp2, ChidrenBindMode.BindEventOnly);
            //把左下圆角覆盖为方角
            var btnBomTemp2 = new NormalViewControl(frameConfirm.Width / 2, Application.GetRealHeight(40), false);
            btnBomTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
            btnBomTemp2.Gravity = Gravity.BottomLeft;
            frameConfirm.AddChidren(btnBomTemp2, ChidrenBindMode.BindEventOnly);
            //确认按钮
            this.btnConfirm = new NormalViewControl(frameConfirm.Width - Application.GetRealWidth(10), Application.GetRealHeight(60), false);
            btnConfirm.Gravity = Gravity.Center;
            btnConfirm.TextColor = UserCenterColor.Current.White;
            btnConfirm.TextID = R.MyInternationalizationString.OkMsg;
            btnConfirm.TextAlignment = TextAlignment.Center;
            frameConfirm.AddChidren(btnConfirm, ChidrenBindMode.BindEventOnly);
            frameConfirm.ButtonClickEvent += (sender, e) =>
            this.btnConfirm = new BottomRightClickButton(frameBack.Width - btnCancel.Width, btnCancel.Height);
            frameBack.AddChidren(btnConfirm);
            btnConfirm.InitControl(Language.StringByID(R.MyInternationalizationString.OkMsg));
            btnConfirm.ButtonClickEvent += (sender, e) =>
            {
                if (this.Text == string.Empty && string.IsNullOrEmpty(this.txtInput.PlaceholderText) == false)
                {
@@ -177,24 +118,6 @@
                }
                //回调函数
                this.ComfirmClickEvent?.Invoke(this.Text);
            };
            //重写控件点击状态
            frameConfirm.SelectStatuEvent += (statu) =>
            {
                if (statu == true)
                {
                    frameConfirm.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
                    btnTopTemp2.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
                    btnBomTemp2.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
                    btnConfirm.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
                }
                else
                {
                    frameConfirm.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
                    btnTopTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
                    btnBomTemp2.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
                    btnConfirm.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
                }
            };
        }
@@ -229,7 +152,7 @@
        /// <param name="txtValue"></param>
        public void SetCancelButtonText(string txtValue)
        {
            this.btnCancel.Text = txtValue;
            this.btnCancel.SetButtonText(txtValue);
        }
        /// <summary>
@@ -238,7 +161,7 @@
        /// <param name="txtValue"></param>
        public void SetOkButtonText(string txtValue)
        {
            this.btnConfirm.Text = txtValue;
            this.btnConfirm.SetButtonText(txtValue);
        }
        /// <summary>