From a45fe56aeeac8f28a9891b83362954067c8166dc Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 14 八月 2020 09:07:05 +0800
Subject: [PATCH] 请合并新代码,更改多功能面板绑定表重复问题
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs | 106 ++++++++++++++--------------------------------------
1 files changed, 29 insertions(+), 77 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
index 22d6a8f..0f048dc 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
@@ -29,7 +29,14 @@
return m_Current;
}
}
-
+ /// <summary>
+ /// 娑堟伅鎺т欢鍗曞嚮鐨勪簨浠�
+ /// </summary>
+ public Action MsgClickEvent = null;
+ /// <summary>
+ /// 鐣岄潰鍏抽棴鐨勪簨浠�
+ /// </summary>
+ public Action CloseEvent = null;
/// <summary>
/// 瀹瑰櫒鎺т欢
/// </summary>
@@ -39,21 +46,9 @@
/// </summary>
private NormalViewControl btnText = null;
/// <summary>
- /// 杩涘害鍊兼枃鏈殑鏄剧ず鎺т欢
+ /// 杩涘害鏉℃帶浠�
/// </summary>
- private NormalViewControl btnProgressView = null;
- /// <summary>
- /// 杩涘害鍊艰兘澶熺Щ鍔ㄧ殑閭d釜妗嗘帶浠�
- /// </summary>
- private FrameLayout frameProgress = null;
- /// <summary>
- /// 杩涘害鏉�
- /// </summary>
- private FrameLayout btnProgressBar = null;
- /// <summary>
- /// 杩涘害鏉″鍣ㄧ殑鏈�澶у搴�
- /// </summary>
- private int ProRowWidth = 0;
+ private ProgressRowBar btnProgressBar = null;
/// <summary>
/// 鍘熸潵鐨勬粦鍔ㄦ爣璇�
/// </summary>
@@ -76,13 +71,13 @@
this.oldScrollEnabled = UserView.HomePage.Instance.ScrollEnabled;
UserView.HomePage.Instance.ScrollEnabled = false;
Shared.Common.CommonPage.BackKeyCanClick = false;
+
this.oldPrigressVisible = Common.CommonPage.Loading.Visible;
if (oldPrigressVisible == true)
{
//鍦嗗舰杩涘害鏉′复鏃跺叧闂�
Common.CommonPage.Loading.Hide();
}
-
//瀹瑰櫒
bodyFrameLayout = new FrameLayout();
bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor;
@@ -103,40 +98,17 @@
btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
btnText.TextAlignment = TextAlignment.Center;
frameBack.AddChidren(btnText);
+ btnText.ButtonClickEvent += (sender, e) =>
+ {
+ this.MsgClickEvent?.Invoke();
+ };
//杩涘害鏉�
- var btnProRow = new FrameLayout();
- btnProRow.Gravity = Gravity.CenterHorizontal;
- btnProRow.Y = Application.GetRealHeight(161);
- btnProRow.Width = Application.GetRealWidth(559);
- btnProRow.Height = Application.GetRealHeight(29);
- btnProRow.BackgroundColor = 0xfff5f5f5;
- btnProRow.Radius = (uint)Application.GetRealHeight(29) / 2;
- frameBack.AddChidren(btnProRow);
- this.btnProgressBar = new FrameLayout();
- btnProgressBar.Width = 0;
- btnProgressBar.Height = btnProRow.Height;
- btnProgressBar.BackgroundColor = 0xfffb744a;
- btnProgressBar.Radius = (uint)Application.GetRealHeight(29) / 2;
- btnProRow.AddChidren(btnProgressBar);
-
- //杩涘害鍊兼枃鏈�
- this.frameProgress = new FrameLayout();
- frameProgress.Width = Application.GetRealWidth(84);
- frameProgress.Height = Application.GetRealHeight(60);
- frameProgress.Y = Application.GetRealHeight(86);
- frameBack.AddChidren(frameProgress);
- frameProgress.X = btnProRow.X + btnProgressBar.Right - frameProgress.Width / 2;
- var btnProgressPic = new PicViewControl(84, 60);
- btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png";
- frameProgress.AddChidren(btnProgressPic);
- this.btnProgressView = new NormalViewControl(84, 45, true);
- btnProgressView.TextSize = 10;
- btnProgressView.TextAlignment = TextAlignment.Center;
- btnProgressView.Text = "0%";
- frameProgress.AddChidren(btnProgressView);
-
- this.ProRowWidth = btnProRow.Width;
+ this.btnProgressBar = new ProgressRowBar(559, 29);
+ btnProgressBar.Gravity = Gravity.CenterHorizontal;
+ btnProgressBar.Y = Application.GetRealHeight(161);
+ frameBack.AddChidren(btnProgressBar);
+ btnProgressBar.StartMode1(true);
}
#endregion
@@ -152,7 +124,7 @@
HdlThreadLogic.Current.RunMain(() =>
{
btnText.Text = msg;
- });
+ }, ShowErrorMode.NO);
}
#endregion
@@ -165,7 +137,7 @@
/// <param name="value">姝ゅ�间负鐧惧垎姣斿��(涔熷氨鏄皬浜庢垨鑰呯瓑浜�1鐨�)</param>
public void SetValue(decimal value)
{
- this.SetValueEx(value);
+ this.btnProgressBar?.SetValue(value);
}
/// <summary>
@@ -175,29 +147,7 @@
/// <param name="maxValue">鏈�澶у��</param>
public void SetValue(decimal value, decimal maxValue)
{
- decimal result = value / maxValue;
- this.SetValueEx(result);
- }
-
- /// <summary>
- /// 璁剧疆杩涘害鍊�
- /// </summary>
- /// <param name="value"></param>
- private void SetValueEx(decimal value)
- {
- if (btnProgressBar == null)
- {
- return;
- }
- HdlThreadLogic.Current.RunMain(() =>
- {
- int width = (int)(value * ProRowWidth);
- btnProgressBar.Width = width;
- //鏂囨湰鏄剧ず
- btnProgressView.Text = ((int)(value * 100)) + "%";
- //鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩
- frameProgress.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgress.Width / 2;
- });
+ this.btnProgressBar?.SetValue(value, maxValue);
}
#endregion
@@ -215,7 +165,7 @@
{
//鍒濆鍖栬繘搴︽潯
this.InitProgressFormBar();
- });
+ }, ShowErrorMode.NO);
}
}
@@ -245,10 +195,12 @@
bodyFrameLayout?.RemoveFromParent();
bodyFrameLayout = null;
btnText = null;
- btnProgressView = null;
- frameProgress = null;
btnProgressBar = null;
- });
+ this.MsgClickEvent = null;
+ //鍏抽棴浜嬩欢
+ this.CloseEvent?.Invoke();
+ this.CloseEvent = null;
+ }, ShowErrorMode.NO);
}
#endregion
--
Gitblit v1.8.0