From 9ef48d7b2da7c408b53f73be0f6eef3cbac1c84a Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 19 十一月 2020 10:23:45 +0800
Subject: [PATCH] Evoyo.Home1.1.0120111601_Release

---
 ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs |  140 +++++++++++++++++++++++++++++++++-------------
 1 files changed, 100 insertions(+), 40 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
index 92435b1..9629a44 100755
--- a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
@@ -15,17 +15,21 @@
         #region 鈻� 鍙橀噺澹版槑___________________________
 
         /// <summary>
+        /// 杩斿洖鎸夐敭鐨勭偣鍑讳簨浠�(濡傛灉瀹炵幇姝や簨浠�,鍒欏簳灞傜殑浜嬩欢灏嗕笉浼氬啀瑙﹀彂)
+        /// </summary>
+        public Action<BackViewControl> BackButtonClickEvent = null;
+        /// <summary>
         /// TopMenuFrameLayout
         /// </summary>
-        public FrameLayout topMenuFrameLayout = null;
+        public NormalFrameLayout topMenuFrameLayout = null;
         /// <summary>
         /// TopFrameLayout
         /// </summary>
-        public FrameLayout topFrameLayout = null;
+        public NormalFrameLayout topFrameLayout = null;
         /// <summary>
         /// bodyFrameLayout
         /// </summary>
-        public FrameLayout bodyFrameLayout = null;
+        public NormalFrameLayout bodyFrameLayout = null;
         /// <summary>
         /// 宸︽粦浣胯兘
         /// </summary>
@@ -98,14 +102,14 @@
             }
 
             //TopMenuFrameLayout鍋氭垚
-            topMenuFrameLayout = new FrameLayout();
+            topMenuFrameLayout = new NormalFrameLayout();
             topMenuFrameLayout.Height = ControlCommonResourse.TopMenuFrameHeight;
             topMenuFrameLayout.BackgroundColor = UserCenterColor.Current.TopFrameLayout;
             topMenuFrameLayout.Name = "topMenuFrameLayout";
             this.AddChidren(topMenuFrameLayout);
 
             //TopFrameLayout鍋氭垚
-            topFrameLayout = new FrameLayout();
+            topFrameLayout = new NormalFrameLayout();
             topFrameLayout.Height = ControlCommonResourse.TopFrameHeight;
             topFrameLayout.BackgroundColor = UserCenterColor.Current.TopFrameLayout;
             topFrameLayout.Y = topMenuFrameLayout.Bottom;
@@ -117,6 +121,7 @@
             btnLine.BackgroundColor = 0x40000000;
             btnLine.Y = topFrameLayout.Height - 1;
             topFrameLayout.AddChidren(btnLine);
+            topFrameLayout.AddTag("btnLine", btnLine);
 
             //杩斿洖閿�
             var btnBack = new BackViewControl();
@@ -124,6 +129,12 @@
             btnBack.InitControl();
             btnBack.ButtonClickEvent += (sender, e) =>
             {
+                if (this.BackButtonClickEvent != null)
+                {
+                    //濡傛灉瀹炵幇姝や簨浠�,鍒欏簳灞傜殑浜嬩欢灏嗕笉浼氬啀瑙﹀彂
+                    BackButtonClickEvent(btnBack);
+                    return;
+                }
                 //鐢婚潰鍏抽棴
                 this.CloseForm();
             };
@@ -158,7 +169,7 @@
             {
                 bodyFrameLayout.RemoveAll();
             }
-            bodyFrameLayout = new FrameLayout();
+            bodyFrameLayout = new NormalFrameLayout();
             bodyFrameLayout.Height = ControlCommonResourse.BodyFrameHeight;
             bodyFrameLayout.Y = topFrameLayout.Bottom;
             bodyFrameLayout.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
@@ -178,13 +189,16 @@
         /// <param name="parameter">鍚姩鍙傛暟锛氬弬鏁扮敱鎸囧畾鐢婚潰鐨凷howForm鍑芥暟鎵�鎸囧畾</param>
         public override void AddForm(params object[] parameter)
         {
+            //鐣岄潰鍔犺浇涓�
+            ControlCommonResourse.IsFormAdding = true;
+
             base.AddForm(parameter);
 
-            //妫�娴嬭兘鍚﹁拷鍔犵敾闈�
-            if (UserCenterLogic.CheckCanAddForm(this) == false)
-            {
-                return;
-            }
+            //妫�娴嬭兘鍚﹁拷鍔犵敾闈� 2020.05.14鑸嶅純
+            //if (UserCenterLogic.CheckCanAddForm(this) == false)
+            //{
+            //    return;
+            //}
 
             UserView.HomePage.Instance.AddChidren(this);
             UserView.HomePage.Instance.PageIndex += 1;
@@ -194,6 +208,9 @@
 
             //鎵цShowForm()鏂规硶
             this.LoadShowFormMethod(parameter);
+
+            //鐣岄潰鍔犺浇缁撴潫
+            ControlCommonResourse.IsFormAdding = false;
         }
 
         #endregion
@@ -210,12 +227,43 @@
             //宸︽粦浣胯兘
             this.ScrollEnabled = true;
 
+            this.BackButtonClickEvent = null;
+
             this.m_parameter = null;
             //娓呯┖bodyFrame
             this.ClearBodyFrame();
-        }
+        }
 
         #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 鈻� 鏄剧ず閲嶆柊鍔犺浇_______________________
 
@@ -224,7 +272,7 @@
         /// </summary>
         public override void ShowReLoadView()
         {
-            Application.RunOnMainThread(() =>
+            HdlThreadLogic.Current.RunMain(() =>
             {
                 if (bodyFrameLayout == null || bodyFrameLayout.Parent == null)
                 {
@@ -244,6 +292,9 @@
                 frame.AddChidren(btnReLoad);
                 btnReLoad.ButtonClickEvent += (sender, e) =>
                 {
+                    //鐐瑰嚮閲嶆柊鍔犺浇鏃�,鍏佽鍐嶆鑱旂綉
+                    HdlWifiLogic.Current.CanAccessHttp = true;
+
                     //娓呴櫎鍏ㄩ儴鎺т欢
                     this.ClearBodyFrame();
 
@@ -279,34 +330,43 @@
 
         #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);
+        #region 鈻� 鏄剧ず寮圭獥杈撳叆鐣岄潰___________________
 
-            return btnHelp;
-        }
-
-        #endregion
+        /// <summary>
+        /// <para>鏄剧ず涓�涓狣ialog鐨勫脊绐楄緭鍏ョ晫闈�,瀹冧笉浼氳嚜鍔ㄥ叧闂�,闇�瑕佹墜鍔ㄥ叧闂�</para>
+        /// <para>.CloseDialog()涓哄叧闂脊绐�</para>
+        /// <para>濡傛灉杈撳叆妗嗙殑鍐呭涓虹┖,骞朵笖璁剧疆鏈夈�恑_TipText銆�,鍒欎笉浼氳皟鐢ㄥ洖璋冨嚱鏁�,骞朵笖鎻愮ず銆恑_TipText銆戠殑鍐呭</para>
+        /// </summary>
+        /// <param name="i_TitleText">寮圭獥鐨勬爣棰樹俊鎭�</param>
+        /// <param name="i_InputText">杈撳叆妗嗗垵濮嬪寲鍊�(蹇界暐璇疯缃负null)</param>
+        /// <param name="i_TipText">杈撳叆妗嗙伆鑹插瓧浣撹鏄�(蹇界暐璇疯缃负null)</param>
+        /// <param name="i_ComfirmClickEvent">纭鎸夐挳浜嬩欢</param>
+        /// <returns></returns>
+        public void ShowDialogInputForm(string i_TitleText, string i_InputText, string i_TipText, Action<DialogInputControl, string> i_ComfirmClickEvent)
+        {
+            //鐢熸垚涓�涓脊绐楃敾闈�
+            var dialogForm = new DialogInputControl();
+            //鏍囬
+            dialogForm.SetTitleText(i_TitleText);
+            //杈撳叆妗嗙伆鑹插瓧浣撹鏄�
+            if (i_TipText != null)
+            {
+                dialogForm.SetTipText(i_TipText);
+            }
+            //杈撳叆妗嗗垵濮嬪��
+            if (i_InputText != null)
+            {
+                dialogForm.Text = i_InputText;
+            }
+
+            //鎸変笅纭鎸夐挳
+            dialogForm.ComfirmClickEvent += ((textValue) =>
+            {
+                i_ComfirmClickEvent?.Invoke(dialogForm, textValue);
+            });
+        }
+
+        #endregion
 
         #region 鈻� 鏄剧ず娌℃湁鏁版嵁鐨勫浘鍍忔樉绀虹壒鏁坃________
 

--
Gitblit v1.8.0