From c7df85937f73fb347ee0b19e9c052d2d00a6df6c Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 18 九月 2020 13:58:19 +0800 Subject: [PATCH] 新版本 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs | 65 ++++++++++++++++++++++++++++---- 1 files changed, 57 insertions(+), 8 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs index aebe897..d3be37f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/ProgressRowBar.cs @@ -12,6 +12,10 @@ #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> + /// 杩涘害鏉¤兘鍚﹀線鍥炶蛋(榛樿鍙互) + /// </summary> + public bool ProgressBarGoback = true; + /// <summary> /// 浼氱Щ鍔ㄧ殑杩涘害鏉� /// </summary> private FrameLayout btnProgressBar = null; @@ -32,6 +36,22 @@ /// </summary> private int m_ModeDiv = -1; + /// <summary> + /// 杩涘害鏉℃槸鍚﹀彲瑙� + /// </summary> + public new bool Visible + { + get { return base.Visible; } + set + { + if (this.frameProgressBack != null) + { + this.frameProgressBack.Visible = value; + } + base.Visible = value; + } + } + #endregion #region 鈻� 鍒濆鍖朹____________________________ @@ -39,8 +59,14 @@ /// <summary> /// 琛屾潯绫诲瀷鐨勮繘搴︽潯鎺т欢 /// </summary> - /// <param name="width">闈炵湡瀹炲��</param> - /// <param name="height">闈炵湡瀹炲��</param> + /// <param name="width"> + /// <para>妯″紡1:浼氬姩鐨勯偅涓繘搴︽潯鐨勫搴�(闈炵湡瀹炲��)</para> + /// <para>妯″紡2:杩涘害鏉″湪鎸佺画鏃犻檺鐨勬潵鍥炵Щ鍔ㄧ殑鍖哄煙瀹藉害(闈炵湡瀹炲��)</para> + /// </param> + /// <param name="height"> + /// <para>妯″紡1:浼氬姩鐨勯偅涓繘搴︽潯鐨勯珮搴�(闈炵湡瀹炲��)</para> + /// <para>妯″紡2:杩涘害鏉″湪鎸佺画鏃犻檺鐨勬潵鍥炵Щ鍔ㄧ殑楂樺害(闈炵湡瀹炲��)</para> + /// </param> public ProgressRowBar(int width, int height) { this.Height = Application.GetRealHeight(height); @@ -56,7 +82,10 @@ /// <summary> /// 妯″紡1 璇ユā寮忎负锛氭墜鍔ㄥ~鍐欒繘搴﹀�� /// </summary> - /// <param name="showText">鏄惁鍦ㄨ繘搴︽潯涓婃柟鏄剧ず鏁板�肩櫨鍒嗘瘮</param> + /// <param name="showText"> + /// <para>鏄惁鍦ㄨ繘搴︽潯涓婃柟鏄剧ず鏁板�肩櫨鍒嗘瘮</para> + /// <para>璇风‘淇濇帶浠剁殑涓婃柟鏈夎冻澶熺殑鍖哄煙(娉�:璇蜂笉瑕佹墿澶ф鎺т欢鐨勯珮搴�)</para> + /// </param> public void StartMode1(bool showText = false) { if (m_ModeDiv != -1) { return; } @@ -74,7 +103,7 @@ { //杩涘害鍊兼枃鏈� this.frameProgressBack = new FrameLayout(); - frameProgressBack.Width = Application.GetRealWidth(84); + frameProgressBack.Width = Application.GetRealWidth(120); frameProgressBack.Height = Application.GetRealHeight(60); frameProgressBack.Y = this.Y - Application.GetRealHeight(60); frameProgressBack.X = this.X - Application.GetRealWidth(84) / 2; @@ -82,12 +111,25 @@ var btnProgressPic = new PicViewControl(84, 60); btnProgressPic.UnSelectedImagePath = "Item/ProgressMsg.png"; + btnProgressPic.Gravity = Gravity.CenterHorizontal; frameProgressBack.AddChidren(btnProgressPic); - this.btnProgressTextView = new NormalViewControl(84, 45, true); + this.btnProgressTextView = new NormalViewControl(120, 45, true); btnProgressTextView.TextSize = 10; btnProgressTextView.TextAlignment = TextAlignment.Center; btnProgressTextView.Text = "0%"; + btnProgressTextView.Gravity = Gravity.CenterHorizontal; frameProgressBack.AddChidren(btnProgressTextView); + } + } + + /// <summary> + /// 閲嶇疆杩涘害鏉�(鍙妯″紡1鏈夋晥) + /// </summary> + public void ResetProgressBar() + { + if (this.m_ModeDiv == 1 && this.btnProgressBar != null) + { + this.btnProgressBar.Width = 0; } } @@ -117,20 +159,27 @@ /// <param name="value"></param> private void SetValueEx(decimal value) { - if (btnProgressBar == null || this.m_ModeDiv != 1 || value > 1) + if (btnProgressBar == null || this.m_ModeDiv != 1) { return; } + if (value > 1) { value = 1; } + HdlThreadLogic.Current.RunMain(() => { int width = (int)(value * this.Width); + if (this.ProgressBarGoback == false && btnProgressBar.Width >= width) + { + //涓嶈兘璁╄繘搴︽潯寰�鍥炶蛋 + return; + } btnProgressBar.Width = width; if (this.btnProgressTextView != null) { //鏂囨湰鏄剧ず btnProgressTextView.Text = ((int)(value * 100)) + "%"; //鏂囨湰鏄剧ず鐨勯偅涓浘鐗囨绉诲姩 - this.frameProgressBack.X = ControlCommonResourse.XXLeft + btnProgressBar.Right - frameProgressBack.Width / 2; + this.frameProgressBack.X = this.X + btnProgressBar.Right - frameProgressBack.Width / 2; } }); } @@ -142,7 +191,7 @@ /// <summary> /// 妯″紡2 璇ユā寮忎负锛氫笉鑳芥墜鍔ㄦ寚瀹氳繘搴﹀��,鐢卞唴閮ㄧ嚎绋嬪鐞�,杩涘害鏉″湪鎸佺画鏃犻檺鐨勬潵鍥炵Щ鍔� /// </summary> - /// <param name="proWidth">浼氱Щ鍔ㄧ殑杩涘害鏉$殑瀹藉害(闈炵湡瀹炲��)</param> + /// <param name="proWidth">鎸佺画鏃犻檺鐨勬潵鍥炵Щ鍔ㄧ殑杩涘害鏉$殑瀹藉害(闈炵湡瀹炲��)</param> public void StartMode2(int proWidth = 100) { if (m_ModeDiv != -1) { return; } -- Gitblit v1.8.0