From 9cfd22c2c308adc7a7ce38cf96be04a70048de01 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 20 七月 2020 15:57:57 +0800
Subject: [PATCH] 2020-07-20-1
---
ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs | 97 ++++++++++++++++++++++++++++++------------------
1 files changed, 60 insertions(+), 37 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
index cc8fe56..f3f32b9 100755
--- a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
+++ b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs
@@ -15,6 +15,10 @@
#region 鈻� 鍙橀噺澹版槑___________________________
/// <summary>
+ /// 杩斿洖鎸夐敭鐨勭偣鍑讳簨浠�(濡傛灉瀹炵幇姝や簨浠�,鍒欏簳灞傜殑浜嬩欢灏嗕笉浼氬啀瑙﹀彂)
+ /// </summary>
+ public Action<BackViewControl> BackButtonClickEvent = null;
+ /// <summary>
/// TopMenuFrameLayout
/// </summary>
public FrameLayout topMenuFrameLayout = null;
@@ -31,7 +35,7 @@
/// </summary>
private bool m_ScrollEnabled = true;
/// <summary>
- /// 宸︽粦浣胯兘
+ /// 宸︽粦浣胯兘(鐣岄潰鍏抽棴鏃�,搴曞眰浼氳繕鍘�,鏃犻渶鍐嶅鐞�)
/// </summary>
public bool ScrollEnabled
{
@@ -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();
};
@@ -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 鈻� 鏄剧ず閲嶆柊鍔犺浇_______________________
@@ -277,35 +325,6 @@
{
}
- #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 鈻� 鏄剧ず娌℃湁鏁版嵁鐨勫浘鍍忔樉绀虹壒鏁坃________
@@ -380,7 +399,11 @@
{
return;
}
- bodyFrameLayout?.RemoveAll();
+ if (bodyFrameLayout == null || bodyFrameLayout.Parent == null)
+ {
+ return;
+ }
+ bodyFrameLayout.RemoveAll();
}
#endregion
--
Gitblit v1.8.0