From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期一, 14 十二月 2020 09:59:01 +0800
Subject: [PATCH] 请合并代码,完成晾衣架最终功能。
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 208 insertions(+), 0 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
new file mode 100755
index 0000000..0f048dc
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressFormBar.cs
@@ -0,0 +1,208 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 鐣岄潰绫诲瀷鐨勮繘搴︽潯鎺т欢
+ /// </summary>
+ public class ProgressFormBar
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鐣岄潰绫诲瀷鐨勮繘搴︽潯鎺т欢
+ /// </summary>
+ private static ProgressFormBar m_Current = null;
+ /// <summary>
+ /// 鐣岄潰绫诲瀷鐨勮繘搴︽潯鎺т欢
+ /// </summary>
+ public static ProgressFormBar Current
+ {
+ get
+ {
+ if (m_Current == null)
+ {
+ m_Current = new ProgressFormBar();
+ }
+ return m_Current;
+ }
+ }
+ /// <summary>
+ /// 娑堟伅鎺т欢鍗曞嚮鐨勪簨浠�
+ /// </summary>
+ public Action MsgClickEvent = null;
+ /// <summary>
+ /// 鐣岄潰鍏抽棴鐨勪簨浠�
+ /// </summary>
+ public Action CloseEvent = null;
+ /// <summary>
+ /// 瀹瑰櫒鎺т欢
+ /// </summary>
+ private FrameLayout bodyFrameLayout = null;
+ /// <summary>
+ /// 淇℃伅鎺т欢
+ /// </summary>
+ private NormalViewControl btnText = null;
+ /// <summary>
+ /// 杩涘害鏉℃帶浠�
+ /// </summary>
+ private ProgressRowBar btnProgressBar = null;
+ /// <summary>
+ /// 鍘熸潵鐨勬粦鍔ㄦ爣璇�
+ /// </summary>
+ private bool oldScrollEnabled = false;
+ /// <summary>
+ /// 鍘熸潵鐨勯偅涓渾褰㈣繘搴︽潯鏄惁鍙
+ /// </summary>
+ private bool oldPrigressVisible = false;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒濆鍖栬繘搴︽潯
+ /// </summary>
+ private void InitProgressFormBar()
+ {
+ //瀹夊崜鍙互鐐瑰嚮绯荤粺鐨勮繑鍥為敭
+ 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;
+ Common.CommonPage.Instance.AddChidren(bodyFrameLayout);
+
+ var frameBack = new FrameLayout();
+ frameBack.Width = Application.GetRealWidth(674);
+ frameBack.Height = Application.GetRealHeight(386);
+ frameBack.BackgroundColor = UserCenterColor.Current.White;
+ frameBack.Gravity = Gravity.CenterHorizontal;
+ frameBack.Y = Application.GetRealHeight(683);
+ frameBack.Radius = (uint)Application.GetRealHeight(17);
+ bodyFrameLayout.AddChidren(frameBack);
+
+ //杩涘害鏄剧ず鏂囨湰
+ this.btnText = new NormalViewControl(frameBack.Width, Application.GetRealHeight(58), false);
+ btnText.Y = Application.GetRealHeight(248);
+ btnText.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnText.TextAlignment = TextAlignment.Center;
+ frameBack.AddChidren(btnText);
+ btnText.ButtonClickEvent += (sender, e) =>
+ {
+ this.MsgClickEvent?.Invoke();
+ };
+
+ //杩涘害鏉�
+ this.btnProgressBar = new ProgressRowBar(559, 29);
+ btnProgressBar.Gravity = Gravity.CenterHorizontal;
+ btnProgressBar.Y = Application.GetRealHeight(161);
+ frameBack.AddChidren(btnProgressBar);
+ btnProgressBar.StartMode1(true);
+ }
+
+ #endregion
+
+ #region 鈻� 璁剧疆淇℃伅___________________________
+
+ /// <summary>
+ /// 璁剧疆鏄剧ず淇℃伅
+ /// </summary>
+ /// <param name="msg"></param>
+ public void SetMsg(string msg)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ btnText.Text = msg;
+ }, ShowErrorMode.NO);
+ }
+
+ #endregion
+
+ #region 鈻� 璁剧疆杩涘害鍊糭________________________
+
+ /// <summary>
+ /// 璁剧疆杩涘害鍊�
+ /// </summary>
+ /// <param name="value">姝ゅ�间负鐧惧垎姣斿��(涔熷氨鏄皬浜庢垨鑰呯瓑浜�1鐨�)</param>
+ public void SetValue(decimal value)
+ {
+ this.btnProgressBar?.SetValue(value);
+ }
+
+ /// <summary>
+ /// 璁剧疆杩涘害鍊�
+ /// </summary>
+ /// <param name="value">杩涘害鍊�,鍐呴儴浼氶櫎浠axValue</param>
+ /// <param name="maxValue">鏈�澶у��</param>
+ public void SetValue(decimal value, decimal maxValue)
+ {
+ this.btnProgressBar?.SetValue(value, maxValue);
+ }
+
+ #endregion
+
+ #region 鈻� 寮�鍚繘搴︽潯_________________________
+
+ /// <summary>
+ /// 寮�鍚繘搴︽潯
+ /// </summary>
+ public void Start()
+ {
+ if (this.bodyFrameLayout == null)
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鍒濆鍖栬繘搴︽潯
+ this.InitProgressFormBar();
+ }, ShowErrorMode.NO);
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鍏抽棴杩涘害鏉________________________
+
+ /// <summary>
+ /// 鍏抽棴杩涘害鏉�
+ /// </summary>
+ public void Close()
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ if (this.oldScrollEnabled == true)
+ {
+ //濡傛灉瀹冨師鏉ュ氨鏄笉鍙互婊戝姩鐨勮瘽锛屼笉澶勭悊
+ UserView.HomePage.Instance.ScrollEnabled = true;
+ }
+ Shared.Common.CommonPage.BackKeyCanClick = true;
+ if (this.oldPrigressVisible == true)
+ {
+ //濡傛灉鍘熸潵鐨勮繘搴︽潯鏄彲瑙佺殑璇�,杩樺師鍥炲幓
+ Common.CommonPage.Loading.Start(Common.CommonPage.Loading.Text);
+ }
+
+ bodyFrameLayout?.RemoveFromParent();
+ bodyFrameLayout = null;
+ btnText = null;
+ btnProgressBar = null;
+ this.MsgClickEvent = null;
+ //鍏抽棴浜嬩欢
+ this.CloseEvent?.Invoke();
+ this.CloseEvent = null;
+ }, ShowErrorMode.NO);
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0