黄学彪
2020-02-21 bd46c57c77c276014db3192a4e2cc96e23c93202
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/EditorCommonForm.cs
@@ -26,6 +26,25 @@
        /// </summary>
        public FrameLayout bodyFrameLayout = null;
        /// <summary>
        /// 左滑使能
        /// </summary>
        private bool m_ScrollEnabled = true;
        /// <summary>
        /// 左滑使能
        /// </summary>
        public bool ScrollEnabled
        {
            get { return m_ScrollEnabled; }
            set
            {
                if (UserView.HomePage.Instance.ScrollEnabled != value)
                {
                    UserView.HomePage.Instance.ScrollEnabled = value;
                    this.m_ScrollEnabled = value;
                }
            }
        }
        /// <summary>
        /// 缓存启动参数
        /// </summary>
        private object[] m_parameter = null;
@@ -46,6 +65,9 @@
            //初始化中部控件
            this.InitBodyFrameLayout();
            //初始左滑使能可
            this.ScrollEnabled = true;
        }
        /// <summary>
@@ -89,6 +111,12 @@
            topFrameLayout.Name = "topFrameLayout";
            this.AddChidren(topFrameLayout);
            //线
            var btnLine = new NormalViewControl(topFrameLayout.Width, 1, false);
            btnLine.BackgroundColor = 0x40000000;
            btnLine.Y = topFrameLayout.Height - 1;
            topFrameLayout.AddChidren(btnLine);
            //返回键
            var btnBack = new BackViewControl();
            topFrameLayout.AddChidren(btnBack);
@@ -103,6 +131,8 @@
            //标题
            var txttitle = new TopLayoutTitleControl();
            topFrameLayout.AddChidren(txttitle);
            //粗体
            txttitle.IsBold = true;
            topFrameLayout.AddTag("txtTitle", txttitle);
        }
@@ -139,6 +169,8 @@
        /// <param name="parameter">启动参数:参数由指定画面的ShowForm函数所指定</param>
        public override void AddForm(params object[] parameter)
        {
            base.AddForm(parameter);
            //检测能否追加画面
            if (UserCenterLogic.CheckCanAddForm(this) == false)
            {
@@ -162,13 +194,16 @@
        /// <summary>
        /// 画面关闭
        /// </summary>
        public override void CloseForm()
        public override void CloseFormBefore()
        {
            base.CloseFormBefore();
            //左滑使能
            this.ScrollEnabled = true;
            this.m_parameter = null;
            //清空bodyFrame
            this.ClearBodyFrame();
            base.CloseForm();
            this.ClearBodyFrame();
        }
        #endregion
@@ -234,9 +269,38 @@
        }
        #endregion
        #region ■ 添加帮助控件_______________________
        /// <summary>
        /// 添加查看帮助控件
        /// </summary>
        /// <returns></returns>
        public NormalViewControl AddHelpControl()
        {
            //查看帮助
            var btnHelp = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
            btnHelp.Y = Application.GetRealHeight(1388);
            btnHelp.TextSize = 12;
            btnHelp.TextAlignment = TextAlignment.Center;
            btnHelp.TextColor = UserCenterColor.Current.TextOrangeColor;
            btnHelp.Text = Language.StringByID(R.MyInternationalizationString.uSearchHelp);
            bodyFrameLayout.AddChidren(btnHelp);
            //底线
            int lineWidth = btnHelp.GetRealWidthByText();
            var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
            btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
            btnLine.Gravity = Gravity.CenterHorizontal;
            btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8);
            bodyFrameLayout.AddChidren(btnLine);
            return btnHelp;
        }
        #endregion
        #region ■ 显示没有数据的图像显示特效_________
        /// <summary>
        /// 显示没有数据的图像显示特效
        /// </summary>
@@ -247,24 +311,55 @@
        /// <param name="imageHeight">图像高度(非真实值)</param>
        public void ShowNotDataImage(FrameLayout frameTable, string i_Text, string Imagepath = "Item/NoFunction.png", int imageWith = 683, int imageHeight = 392)
        {
            //还没有绑定网关哦
            this.ShowNotDataImage(frameTable, new string[] { i_Text }, Imagepath, imageWith, imageHeight);
        }
        /// <summary>
        /// 显示没有数据的图像显示特效
        /// </summary>
        /// <param name="frameTable">容器</param>
        /// <param name="listText">显示文字</param>
        /// <param name="Imagepath">图像地址</param>
        /// <param name="imageWith">图像宽度(非真实值)</param>
        /// <param name="imageHeight">图像高度(非真实值)</param>
        public void ShowNotDataImage(FrameLayout frameTable, string[] listText, string Imagepath = "Item/NoFunction.png", int imageWith = 683, int imageHeight = 392)
        {
            var btnPic = new PicViewControl(imageWith, imageHeight);
            btnPic.UnSelectedImagePath = Imagepath;
            btnPic.Y = (int)(frameTable.Height * 0.382) - Application.GetRealHeight(imageHeight / 2);
            btnPic.Gravity = Gravity.CenterHorizontal;
            frameTable.AddChidren(btnPic);
            var btnView = new NormalViewControl(frameTable.Width, Application.GetRealHeight(50), false);
            btnView.Y = btnPic.Bottom + Application.GetRealHeight(32);
            btnView.Text = i_Text;
            btnView.TextAlignment = TextAlignment.Center;
            btnView.TextSize = 12;
            btnView.TextColor = UserCenterColor.Current.TextGrayColor1;
            frameTable.AddChidren(btnView);
            return;
            int yy = btnPic.Bottom + Application.GetRealHeight(32);
            for (int i = 0; i < listText.Length; i++)
            {
                var btnView = new NormalViewControl(frameTable.Width, Application.GetRealHeight(50), false);
                btnView.Y = yy;
                btnView.Text = listText[i];
                btnView.TextAlignment = TextAlignment.Center;
                btnView.TextSize = 12;
                btnView.TextColor = UserCenterColor.Current.TextGrayColor1;
                frameTable.AddChidren(btnView);
                yy = btnView.Bottom;
            }
        }
        #endregion
        #region ■ 界面重新激活事件___________________
        /// <summary>
        /// <para>自身的上层界面关闭后,它自身处于最上层时,触发的事件</para>
        /// <para>重写的时候返回值请返回1(返回值是给底层使用的)</para>
        /// </summary>
        public virtual int FormActionAgainEvent()
        {
            return -1;
        }
        #endregion
        #region ■ 清空BodyFrame______________________
        /// <summary>